egoholic / domain-driven-toolkit Goto Github PK
View Code? Open in Web Editor NEWExperimental super-duper toolkit for Domain-Driven Development (also known as DDD). Use it for profit and happiness.
License: MIT License
Experimental super-duper toolkit for Domain-Driven Development (also known as DDD). Use it for profit and happiness.
License: MIT License
An instance of Application class should provide an access to main things like: Entity, Aggregate, Service.
Here is how should looks like:
app = DomainDrivenToolkit.application(:my_app)
app.define do
service :do_something do
# ...
end
end
service = app[:do_something].service
@SunnyMagadan what do you think about this API?
We need to implement custom RSpec matchers to easily describe our Entities, Services, Aggregates, etc.
We need Loader and Registerer traits which allow to easily load their nesting and register them.
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.).
We need to implement TimeInterval
as one of predefined ValueObjects.
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.
We need to implement DateInterval
as one of predefined ValueObjects.
We need to implement basic Money
pattern as one of predefined Value-Objects.
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
We need implement form-objects and validators.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.