Vernon’s book Implementing DDD and modeling of underlying concepts

domain-driven-design

Following questions all refer to examples presented in Implementing DDD

In article we can see from Figure 6 that both BankingAccount and PayeeAccount represent the same underlying concept of Banking Account BA

1. On page 64 author gives an example of a publishing organization, where the life-cycle of a book goes through several stages ( proposing a book, editorial process, translation of the book … ) and at each of those stages this book has a different definition.

Each stage of the book is defined in a different Bounded Context, but do all these different definitions still represent the same underlying concept of a Book, just like both BankingAccount and PayeeAccount represent the same underlying concept of a BA?

2.

a) I understand why User shouldn't exist in Collaboration Context ( CC ), but instead should be defined within Identity and Access Context IAC ( page 65 ). But still, do User ( IAC ), Moderator ( CC ), Author ( CC ),Owner ( CC ) and Participant ( CC ) all represent different aspects of the same underlying concept?

b) If yes, then this means that CC contains several model elements ( Moderator, Author, Owner and Participant ), each representing different aspect of the same underlying concept ( just like both BankingAccount and PayeeAccount represent the same underlying concept of a BA ).

But isn't this considered a duplication of concepts ( Evan's book, page 339 ), since several model elements in CC represent the same underlying concept?

c) If Moderator, Author … don't represent the same underlying concept, then what underlying concept does each represent?

3. In an e-commerce system, the term Customer has multiple meanings ( page 49 ): When user is browsing the Catalog, Customer has different meaning than when user is placing an Order.

But do these two different definitions of a Customer represent the same underlying concept, just like both BankingAccount and PayeeAccount represent the same underlying concept of a BA?

UPDATE:

2.

2a) As with the book, they refer to the same identity but express
different aspects of that identity in a specific context. Sort of like
a single object implementing multiple interfaces which embody the
roles that object plays.

a) Does having two model elements ( both within same BC ) , each representing different aspect of the same underlying concept, result in what Evans calls duplicate concepts?

b) I thought terms "representing different aspects of an identity within particular BC" and "representing different aspects of the same underlying concept within particular BC" are interchangeable ( ie they mean the same thing )? If not, how do they differ?

c)

Sort of like a single object implementing multiple interfaces which
embody the roles that object plays.

I assumed each role represents a particular aspect of the underlying concept, but you're saying it doesn't? What then does role model and how is the thing that role models conceptually different from an aspect of the underlying concept?

2. UPDATE:

2.

a)

Does having two model elements ( both within same BC ) , each
representing different aspect of the same underlying concept, result
in what Evans calls duplicate concepts?

I don't recall what Evans called duplicate concepts so not sure.

On page 339 Evans describes Duplicate concepts as being one of the two conceptual splinters that cause the unification of a model to break down. Here's the quote:

Combining elements of distinct models causes two categories of
problems: duplicate concepts and false cognates. Duplication of
concepts means that there are two model elements ( and attendant
implementations ) that actually represent the same concept. Evry time
this information changes, it has to be updated in two places with
conversions. Every time new knowledge leads to a change in one of the
objects, other has to be reanalyzed and changed too. Except the
reanalysis doesn't happen in reality, so the result is two versions of
the same concept that follow different rules and even have different
data.

b) and c)

This may be a linguistic issue. The way I see it, an identity can have
different concepts associated with it depending on the context.

Again this seems to be a linguistic issue. You use "underlying
concept" to refer to identity which I think isn't clear enough to
distinguish from simply "concept" which by itself isn't sufficient.

Perhaps the following will make my questions clearer: By underlying concept I'm referring to an aspect of reality ( ie the thing ) which we try to model.

thanks

Best Answer

1) The models of books in different stages refer to the same book. I wouldn't say that they refer to the same underlying concept because the concepts are different in the different contexts. They do refer to the same book in that the identity of the book is shared among the BCs.

2a) As with the book, they refer to the same identity but express different aspects of that identity in a specific context. Sort of like a single object implementing multiple interfaces which embody the roles that object plays.

2b) It isn't duplication of concepts because the concepts are different, only the identity is shared. Remember, the goal of DDD and programming in general is to create a model of your domain. All models are incomplete, but good models provide utility.

2c) You can say that a Moderator is a role played by a user in a specific context.

3) Same as above. They refer to the same identity, the same person, but different roles.

UPDATE

Does having two model elements ( both within same BC ) , each representing different aspect of the same underlying concept, result in what Evans calls duplicate concepts?

I don't recall what Evans called duplicate concepts so not sure.

I thought terms "representing different aspects of an identity within particular BC" and "representing different aspects of the same underlying concept within particular BC" are interchangeable ( ie they mean the same thing )? If not, how do they differ?

This may be a linguistic issue. The way I see it, an identity can have different concepts associated with it depending on the context.

I assumed each role represents a particular aspect of the underlying concept, but you're saying it doesn't? What then does role model and how is the thing that role models conceptually different from an aspect of the underlying concept?

Again this seems to be a linguistic issue. You use "underlying concept" to refer to identity which I think isn't clear enough to distinguish from simply "concept" which by itself isn't sufficient.

Related Topic