Where to put logic in a rich domain model
I have a "news item" model that contains text, image, etc. to display the latest news across multiple pages on a website. This "news item" can also be posted on Twitter or Facebook. Is it clean to embed a method message inside a news model and embed various post implementations as a strategy? Or is it better to have a separate app service for this?
thanks
+2
a source to share
2 answers
I would put them in so called ModelCommands.
So, for every unit of change you want to make, the domain model completes them in the model command, which are then executed separately or in a chain. It also allows for the implementation of the Unit of Work pattern, which makes transactions unreliable.
Take a look: http://msdn.microsoft.com/en-us/magazine/dd882510.aspx
0
a source to share