views:

28

answers:

1

Here's an example of what an Exclusivity Arc is (the green arc); what it's saying is that a Plane can have either Propellers or Jet Engines - but not both.

In Barker ER notation, an exclusion constraint over two or more roles is shown as an “exclusive arc” connected to the roles with a small dot or circle.

By the way - can you have them in DDD? (I'm assuming you can if they're part of UML).

Edit - my question around DDD isa bit misleading and I put it inas an after-thought, but @sfinnies answer raises another valid question which I'll ask separately (after some research).

alt text

+1  A: 

Not sure what you mean by "supported by DDD"?

DDD doesn't provide a modelling language itself: it's a combination of method (how to attack the problem) and architecture (how to structure your application).

You're expressing a business rule: a plane can have either jet engines or propeller engines but not both.

That's a valid constraint from the Domain, presumably it's relevant to your application, and therefore it needs to be captured in the domain logic. So from that perspective yes, it is supported by DDD.

How you implement it will depend partly on your language choice, but I'd make a guess that Plane will be an Aggregate root and so be responsible for ensuring the constraint is met. What DDD says is that, as a Domain constraint, it should be captured in your domain logic: not some other architectural layer.

hth

sfinnie
Thanks sfinnie. I wondered how DDD dealt with articulating this kind of constraint - but that's more of a side issue. My main iquestion is around this: In Data Modelling you can have an 'Exclusivity Arc' (specifically in Barker ER notation) - I just want to know if UML has an equivalent and what it's called.
Adrian K
Ahh - ok. Yes, UML has an equivalent - the xor constraint. Drawn as a dashed line between (or among) the mutually exclusive classes. See figure 7.34 on p61 of the UML superstructure spec (http://www.omg.org/spec/UML/2.3/Superstructure/PDF/).
sfinnie
Thanks sfinnie - your comment was what sealed the 'correct answer' :)
Adrian K
Glad to help. Support for xor is a bit patchy in modelling tools - yet another advantage of the mighty whiteboard :-)
sfinnie