Replies: 2 comments 13 replies
-
Hi @jmahmud, I feel you are over complicating things, while your repositories are secondary I would ask why you would modularise this? Personally I would do what you said above, you could even look at your entities creating the Created event, I.e. when you make a change to your Entity in your repository it crease an event. keep in mind that you want your database updates and eventing to happen inside of the same transaction (This is where the outbox comes in) so you can ensure that they both happen together or fail together. Hope this helps |
Beta Was this translation helpful? Give feedback.
-
Thanks again @preardon - I guess I have one other complication here in my model/domain that I was attempting to do in a purest way:
So I what want in a
Again, the reason for raising this (sorry to go into so much detail) is becasue I began with implementing a strict domain, and wanted to model what made sense, and now running into difficulty invoking the domain from the 'adapter'/'application' and want to use Brighter to try and achieve this, but want to make sure I've not confused things... Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi
I was wondering if anyone can suggest whether I'm barking up the wrong tree here....
So understanding that Ports in the Hexagonal Pattern is the way in which to interact with the Domain of a system - there seems to be a sub-categorisation in some discussions of:
So as Brighter documentation suggests, the invocation of the port to interact with the domain can be separated via the CommandProcessor/Dispatcher pattern in order to maintain pure behaviour-oriented definitions of interactions as well as all the other benefits of the pattern - but the discussions and examples all seem to relate to Primary Ports.
So my question, is whether this idea can/should be applied to secondary ports - or would this be over-engineering? Using an example:
So could the IOrderRepository actually be replaced by: a SaveOrderCommand, using the Dispatcher again to dispatch to a SaveOrderHandler which is actually an implementation of some SqlSaveOrderHandler abstracting saving to DB etc...
Appreciate there may not be a straightforward answer to this - but interested in anyone's opinion on this...
Thanks
Josh
Beta Was this translation helpful? Give feedback.
All reactions