That sounds fine but what if the email compozition refers to some business rules. It should be modeled in the domain, no ? A business Service ? But stil the...
22452
Jörgen Andersson
jorgenstockholm
Nov 2, 2011 2:15 am
Hi Alex, Here are my thoughts after reading your mail. - What to include in a single transaction? Is every every unloaded line on the Receipt Note considered...
22453
Joseph Daigle
daigoba66
Nov 2, 2011 1:34 pm
I don't think an e-mail service would typically be part of an domain model, and so whether or not it's part of a bounded context isn't relevant. As previously...
22454
the chaz
chasemyaccord
Nov 2, 2011 11:00 pm
Unless I'm mistaken, a value object can still have identity (local within the aggregate root), just not conceptual/global identity. Is this correct? ... have...
22455
Jörgen Andersson
jorgenstockholm
Nov 3, 2011 3:42 am
No, since value objects are only about the values they hold and immutable, there is no such thing as an id. However, the id attribute of an entity is often...
22456
Jörgen Andersson
jorgenstockholm
Nov 3, 2011 3:52 am
Hi, From your description I gather the following: PricingSchedule is what you sell. It is configured in the database with a price a duration (perhaps?) and...
22457
eben_roux
Nov 3, 2011 4:30 am
Hello, I have a sneaky suspicion that you may be thinking about the entities within the aggregate root. Should those have identity it will typically only be...
22458
Giacomo Tesio
giacomo@...
Nov 3, 2011 9:00 am
I would just add that, outside the aggregate root, you should never hold any reference to a local entity that is inside the aggregate. You can just hold the...
22459
mike_mccarthy3
Nov 3, 2011 3:06 pm
So, in this example, would: notebook[pageNumber].Content return a Page object (I would think not considering you're saying there should be no reference held to...
22460
Greg Young
gumboismadeo...
Nov 3, 2011 3:08 pm
What if I had a value object called CustomerKey? :) Its actually quite a common VO 2011/11/2 Jörgen Andersson <jorgen.x.andersson@...> ... -- Le doute...
22461
Greg Young
gumboismadeo...
Nov 3, 2011 3:09 pm
replied to wrong email (you mention this as well) ... -- Le doute n'est pas une condition agréable, mais la certitude est absurde. replied to wrong email (you...
22462
mike_mccarthy3
Nov 3, 2011 3:30 pm
Or you could say a Firm has, or doesn't have a PricingSchedule. If the Firm has no PricingSchedule, then they do not get access to the system. Again, the word...
22463
Jon Ceanfaglione
cis_jcean
Nov 3, 2011 3:34 pm
Using the decorator pattern here would probably eliminate your code smell. Regards, Jon...
22464
the chaz
chasemyaccord
Nov 3, 2011 4:00 pm
Hmm...I guess you're right. I thought I read something before indicating that value objects could still have identity, but only within the AR and not globally....
22465
Greg Young
gumboismadeo...
Nov 3, 2011 4:01 pm
entities have an identity but it only *need* be unique within an aggregate boundary ... -- Le doute n'est pas une condition agréable, mais la certitude est...
22466
mike_mccarthy3
Nov 3, 2011 4:04 pm
John, thanks for the idea of using Decorator here. Mike...
22467
Giacomo Tesio
giacomo@...
Nov 3, 2011 4:05 pm
notebook[pageNumber].Content could be either a string or an enumeration of lines or anything else useful to clients (aka meaningful in the domain). Of course...
22468
mike_mccarthy3
Nov 3, 2011 4:17 pm
Okay, so getting a reference to a Page via the Notebook is allowed. Notebook Agg Root is guarding its Entity correctly. If I wanted to make a change to the...
22469
Jörgen Andersson
jorgenstockholm
Nov 3, 2011 4:49 pm
Hi, I start to suspect it is not clear to le what the model looks like. Therefor it is hard to give any precise modeling advice. I'll have to start with some...
22470
Giacomo Tesio
giacomo@...
Nov 3, 2011 5:05 pm
... Is allowed to get a reference "transiently". I mean: no one should take a Page and keep it in a field. We enforce such rule by application developer's...
22471
mike_mccarthy3
Nov 3, 2011 5:06 pm
Jörgen, The start and end dates are fixed by passing a Duration object to the constructor of a PricingSchedule in combination with a StartDate. A Duration...
22472
Jörgen Andersson
jorgenstockholm
Nov 3, 2011 7:48 pm
Mike, Thanks for the clarifications. I think what you said makes perfect sense and I agree, the PriceScedule is definately a value object. Even if you get the...
22473
Nuno Lopes
nbplopes
Nov 3, 2011 8:29 pm
I already told you, you are mixing Bounded Contexts. - One context is a PricingSchedule as Product in the catalogue. - Another context is a PricingSchedule...
22474
Joey Samonte
dyowee23
Nov 3, 2011 9:45 pm
Good day, Â I'm trying read through the DDD book, but I'm confused on the Enterprise segment pattern in the Cargo example, on how it relates to Cargo types,...
22475
Andrew D
andrewdeakins
Nov 3, 2011 10:36 pm
Hi there, even if you weren't breaking CQRS you would still be breaking SOLID's Single responsibility principle. Ideally, you would seperate into 2 functions...
22476
mike_mccarthy3
Nov 4, 2011 1:42 am
Nuno, I understand that they are separate bounded contexts... the fact is, that I've never worked with more than one Bounded Context before b/c I just start...
22477
Jörgen Andersson
jorgenstockholm
Nov 4, 2011 5:09 am
Mike and Nuno, In this case I must say I can't see any reason for complicating things by separation into different BCs. In the general case I agree separating...
22478
Jörgen Andersson
jorgenstockholm
Nov 4, 2011 5:45 am
Depending on the requirements in the context it could be a Content object wrapping the text of the page, pictures and formatting. It might also be "scrollable"...
22479
Giacomo Tesio
giacomo@...
Nov 4, 2011 8:51 am
I agree.. It's a good advise (and BTW, a real world notebook page would be probably value objects themselves! that's why the example sucks...) On the matter I...
22480
Nuno Lopes
nbplopes
Nov 4, 2011 10:02 am
HI, Here is an outline of what you can do. // Catalogue Aggregate // value object class PricingScheduleInCatalogue { int productId; // SKU or whatever int...