﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>This should go to the castle mailing list
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment19</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment19</guid><pubDate>Thu, 13 Aug 2009 03:29:38 GMT</pubDate></item><item><title>Gauthier Segay commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Ayende, (as you are officially known to master Castle MK/Windsor ;),
  
  
could you point or elaborate on how Event Registration Facility may help to wire such design without friction?
  
  
I've not used it yet but thinking of triggering all components satisfying IEventHappeningListener
&lt;tevent,&gt;
 seems interresting.
  
  
But there are some rules to think about such as ordering of the handlers, being atomic or compounded, etc.
  
  
So this look like a tricky issue when dealing with larger than sample code but still my aim for "project+1", just because the provided decoupling is great for evolutivity/maintability
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment18</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment18</guid><pubDate>Thu, 13 Aug 2009 02:33:20 GMT</pubDate></item><item><title>Ayende Rahien commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Tim,
  
The difference between having a smart persistence model and a domain model are quite large. It is more related to structuring of the application and the code than just how you handle persistence.
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment17</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment17</guid><pubDate>Sat, 08 Aug 2009 13:55:37 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>John,
  
  
No problem man just a "small overreaction" :-)
  
  
Santos 
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment16</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment16</guid><pubDate>Fri, 07 Aug 2009 02:30:03 GMT</pubDate></item><item><title>John commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Santos,
  
  
I didn't mean to offend anyone. 
  
  
I thought u might have missed it and just pointed it out.
  
  
chill out man ;)
  
  
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment15</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment15</guid><pubDate>Thu, 06 Aug 2009 23:19:03 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Well, "John" in that case I was responding to Oren and I do not need a translator!
  
  
Thanks,
  
  
Santos 
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment14</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment14</guid><pubDate>Thu, 06 Aug 2009 18:09:48 GMT</pubDate></item><item><title>John commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>I think Erik has clearly mentioned above the difference between Specification and Domain Event:
  
  
"Specification-- Does something Meet some criteria
  
Domain Event- Something Interesting Happened."
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment13</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment13</guid><pubDate>Thu, 06 Aug 2009 05:24:14 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Oren,
  
  
Specifications have worked fine for me but I don't know too much about Domain Events yet. As I as said in my first post I just wonder how much better it is than using Specifications. As soon as I have a chance I'll give it a try.  For now I just take your word for it.
  
  
Santos
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment12</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment12</guid><pubDate>Thu, 06 Aug 2009 04:59:32 GMT</pubDate></item><item><title>Dinesh Gajjar commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>While I agree with all of your article, still DDD is not the only way to go. My only point is while for DB apps : DDD is great for managing complexity, still there are other cases to not use DDD. 
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment11</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment11</guid><pubDate>Tue, 04 Aug 2009 08:54:14 GMT</pubDate></item><item><title>Tim Ross commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>I often hear that you should only use the domain model pattern for complex scenarios. What is a good pattern for the "simple" cases? How do you know if you have a domain model or just a persistant object model? I find encapsulating business rules in "domain" objects to be beneficial even in simple cases. Am I missing something here?
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment10</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment10</guid><pubDate>Tue, 04 Aug 2009 07:49:45 GMT</pubDate></item><item><title>Ayende Rahien commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Santos,
  
As Erik pointed out, this is not something that can track state changes, which is what we are interested in here.
  
Second, this means that now you have to _manage_ specifications, that is ugly. I don't want to have lots of if statements all of over the place.
  
Domain events make all of that complexity just go away
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment9</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment9</guid><pubDate>Tue, 04 Aug 2009 06:10:00 GMT</pubDate></item><item><title>Erik commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Ayende,
  
  
    Yeah the thing I really like about it is that it allows you to be much more OCP with your Domain Model and services while still adding Interesting behavior to Domain Event Handlers.  The number of reasons for both your service class and Domain classes to change just reduced considerably when you follow his guidance in the article.
  
  
This coupled with the way he does different models for different bounded contexts (or no model at all in some bounded contexts if it is not justified) likely reduces the urge to move domain behavior out of your models.
  
  
  
Erik
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment8</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment8</guid><pubDate>Mon, 03 Aug 2009 18:45:51 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Oren,
  
  
In that case you could encapsulate all the other predicates in the IsSatisfiedBy in a more general/composite specification. But usually those conditions are within the Aggregate or are accessible from the specification. 
  
  
If there is a better way I am open to use it! 
  
  
Santos
  
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment7</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment7</guid><pubDate>Mon, 03 Aug 2009 18:40:18 GMT</pubDate></item><item><title>Ayende Rahien commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Santos,
  
That looks _really_ bad. Imagine that we have 10 such conditions.
  
Are you going to have 10 if statements? Or would you rather have it in the a more loosely coupled way?
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment6</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment6</guid><pubDate>Mon, 03 Aug 2009 18:16:42 GMT</pubDate></item><item><title>Erik commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Wow,  I really should proofread prior to hitting submit especially if typing while having another conversation.
  
  
Corrections:
  
send the customer an email every time they submit an order
  
assume that there
  
criteria, but
  
meet some criteria?
  
----All the really weird capitalization
  
  
  
  
Erik
  
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment5</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment5</guid><pubDate>Mon, 03 Aug 2009 17:32:40 GMT</pubDate></item><item><title>Erik commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>That would send the customer an order every time they submit an Order.  Not just when they become preferred.  Also,  Assume that their are multiple ways that a customer may become preferred.  The specification may tell you if a customer meets some criteria.  But it won't tell you when that customer change happened.  
  
  
Specification-- Does something Meet some criteria
  
Domain Event-  Something Interesting Happened.
  
  
Usages
  
  
If (Specification.IsSatisfiedBy(something))
  
        Do Something 
  
  
  
Whenever (Something Interesting Happens)
  
      Do Something (1.Log it happened,2Publish It happened on a bus,3, Let some other object know it happened, etc...)
  
  
The two are Orthogonal IMO.
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment4</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment4</guid><pubDate>Mon, 03 Aug 2009 17:27:33 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Well, one way to do it, of the top of my mind:
  
  
  
  
	public class OrderService
  
	{
  
		IOrderRepository mRepository;
  
		IMailService mMailService
  
		public OrderService(IOrderRepository repository, IMailService mailService)
  
		{
  
			if(repository == null)
  
				throw new ...
  
			if(mailService==null)
  
				throw new ...
  
			mRepository = repository;
  
			mMailService = mailService;
  
		}
  
  
		public void Submit(IOrder order)
  
		{
  
			order = mRepository.AddNew(order);
  
			if(order.PreferredSpecification.IsSatisfiedBy(order))
  
				mMailService.SendMail(order.Customer)
  
		}
  
	} 
  
  
  
	public class OrderPreferredSpecification : Specification
&lt;order  
	{
  
  
		public override bool IsSatisfiedBy(Order order)
  
		{
  
			// Build your predicates here and return true/false
  
		}	
  
	}
  
  
  
	public class Order
  
	{
  
		//...Other properties
  
  
		public PreferredSpecification { get; }
  
	}
  
  
&gt;  
  
BTW in regards to EF he could have used ORM then!
  
  
Santos
  
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment3</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment3</guid><pubDate>Mon, 03 Aug 2009 16:10:55 GMT</pubDate></item><item><title>Erik commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>Specifications ??
  
  How could you do the following from the article with specifications?  I am not really seeing the connection?
  
  
public class CustomerBecamePreferredHandler : Handles
&lt;customerbecamepreferred  
{ 
  
   public void Handle(CustomerBecamePreferred args)
  
   {
  
      // send email to args.Customer
  
   }
  
} 
  
  
  
Also, the only reference to the EF is a picture where your choice of ORM is really a peripheral matter.  Was there somthing else?
&gt;</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment2</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment2</guid><pubDate>Mon, 03 Aug 2009 14:53:41 GMT</pubDate></item><item><title>Santos Ray Victorero, II commented on Your domain model isn’t in the Entity Relationship Diagram</title><description>I liked the article and I like the idea of domain events but I wonder how much better it is than using DDD Specifications. 
  
  
IMO if you submit the aggregate for persistence and apply the Specification to the returned persisted one it will work  exactly the same.
  
Anyway they are to separate concerns.
  
  
Also I have some questions about the second part of the article. It looks to me like a kiss in the EF ass. :-)
  
  
Santos
  
</description><link>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment1</link><guid>http://ayende.com/4095/your-domain-model-isn-t-in-the-entity-relationship-diagram#comment1</guid><pubDate>Mon, 03 Aug 2009 03:29:51 GMT</pubDate></item></channel></rss>