GithubHelp home page GithubHelp logo

egoholic / domain-driven-toolkit Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 204 KB

Experimental super-duper toolkit for Domain-Driven Development (also known as DDD). Use it for profit and happiness.

License: MIT License

Ruby 98.67% Shell 1.33%

domain-driven-toolkit's People

Watchers

 avatar  avatar

domain-driven-toolkit's Issues

Data Access Layer (DAL) Mock

We need a DAL mock to make data storage agnostic toolkit. We should develop an example of data storage adapter API which should be implemented for any data storage (MySQL, PostgreSQL, Oracle, MongoDB, Cassandra, Redis, etc.).

DataMapper pattern for Entity

We need a simple implementation of DataMapper (DM) pattern for our entities. It should provide an ability to build entities with attributes from tuples using declarative code with description of allowed for public access attributes.

For the current moment the simplest DM implementation could looks like hashes merging and defining accessors. For example, we have products relation and relation phones. In the first one we store information about products: price, available_quantity, etc. In the second we store some phone-specific data, like name, manufacturer_id and color. Also we have orders and order_items. For OrderItem entity we want to have methods like: product_name and price. The first one it should get from products relation and the second from phones. In result of JOIN we get new relation order_items* but not always we can use SQL's JOINs. When we create new OrderItem we just use 2 other entities (their hash representations), we don't get whole hash from order_items* relation so we should merge them and define accessors.

Money Value-object

We need to implement basic Money pattern as one of predefined Value-Objects.

DSL for Aggregators

We need a simple DSL to describe aggregators around ROOT-entities to provide awesomeness =)

It should looks like:

aggregate :invoice do
  root_entity :invoice # by default Root entity has the same name as an aggregate

  aggregates_many_instances_of :product, with: -> (invoice) { some_query_code }

  # There are should be `product` aggregate which describes how to get product's price.
  aggregates_many_instances_of :price, through: :product

  aggregates_one_instance_of :creator, with: -> (invoice) { some_query_code } 
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.