-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize way to map fields on DDD elements #48
Comments
I have a feeling we need to use a method for objects that are extended from |
Also need to consider if this backwards compatibility class should be removed now, freeing up the mixin to be named `Space.messaging.Serializable' |
We just have to mixin |
Consideration for upgrade path, or internal? Right now it's a little disjointed as we have an extended object that's really suited to being a trait that's added via a mixin, so can't use the obvious name in the current API. |
We just have to check where it is used and update all places 😉 |
If that's the only issue I'd suggest we proceed with that. I can do it this evening so we can release messaging without a delay. Now is the time for breaking things if there's a good reason 😄 @qejk Thoughts? |
Haha, yeah it seems like it's never a good time to break things 😉 but yes, let's do that. |
Yes! Like we spoke @DominikGuzei We store on MongoDB our Then afterwards, when we need to talk with persistence (via IMPORTANT: will it work for partial data that have mappings in fields as non |
FYI the mixin is now named Space.messaging.Ejsonable since it's a hard implementation for EJSON.
If I'm understanding correctly, yes since it's all based on your match statement per field. |
Are we sure we want to refactor |
It's not so much about refactoring the names of the classes but splitting up the domain related parts ( |
Ok so I agree here that switching the |
|
@DominikGuzei Yep, but as you pointed out in Slack, we could support object field props, which is better |
Yep, that's definitely an option. This would be an issue for people using ES6 / CS |
Yes, please make Aggregate.fields a method for consistency with the rest of space:base and space:domain. |
Currently, there are two ways to map(describe) fields in DDD elements - via methods and objects:
Entity
: require to map fields as a methodValueObject
: require to map fields as a method or objectAggregate/Process
: require objectsCommand
,Event
- both store fields as objectsCommand Handlers
,Event Handlers
- methods (on aggregate, processor)API endpoints
- methodsWe should have standardized way to map fields, so there is no confusion what type of mapping we need to use on each DDD element and how to access them everywhere(this is very important). Another option is to allow both mappings (by doing in every place where its needed - a check for fn/object and acting accordingly) however by doing so - this can be confusing on long run.
By allowing objects were supporting extensibility, but the cost of confusion that you can extend anything from anywhere easily like that can let to bad design choices in developers code.
The text was updated successfully, but these errors were encountered: