Re: Why should the schema be in the bounded context?

"zampano3000" <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
IMHO it at least should be, if not must.

See the classical e-commerce example:
"Visitor" or "Customer" is a concept of the Shopping BC and UL.

But if a user really becomes a customer (he buys something) then other BC come into play, like Shipping and Accounting.
They should have their own schema representing the concept of the customer.
Worse, perhaps they don't even have the concept of Customer but Buyer or Recipient. 
Would they extend the schema of Customer from Shopping BC for their own needs, like introducing new state columns or different delivery addresses for them? 
Guess not.

Perhaps they share some kind of company-wide identifier for a customer (e.g. CustomerNumber) but not more.

Don't do integrations of BCs via the database as long as you don't want to get into schema-dependency-hell.

My 0.02
Cheers!


--- In [email protected], "tomas.jansson@..." <tomas.jansson@...> wrote:
>
> It sort of makes sense :). 
> 
> I see the bounded context as some sort of container that contains several things where the UL is one of them and the schema could be one.
> 
> --- In [email protected], "zampano3000" <don@> wrote:
> >
> > Hi Tomas,
> > 
> > it's quite simple:
> > Each Model in  BC maintains its (data) integrity in that context.
> > Because a database is the persistence of that it should follow the same rule, maintain your schema in that context.
> > Otherwise another model would use the same schema for a completely other context and perhaps would change it. This would lead to inconsistency and death. 
> > Only if they cooperate very closely it may work.
> > 
> > Regarding Vaughns statement:
> > perhaps it's a bit confusing to say BC is a lingustic matter.
> > But if you think of a BC as a tool in the solution space - for a model that's defined in its linguistic border (the UL) being implemented with a specific schema then it makes sense.
> > Does that make sense? ;-)
> > 
> > Cheers,
> > Nino
> > 
> > 
> > --- In [email protected], "tomas.jansson@" <tomas.jansson@> wrote:
> > >
> > > I'm reading Implementing DDD by Vaughn Vernon and have a couple of questions. I take them in separate posts so I don't mix the threads.
> > > 
> > > In the book he says you should keep the schema, if you have implemented it yourself, inside the boundary of the bounded context. That goes against the earlier statement that the bounded context should match the lingustic. I really doubt that the domain expert will talk about the database schema.
> > > 
> > > I guess what he tries to emphasize is that there are some technical aspects part of the bounded context as well that might not be part of the ubiquitous language. For example, if we have somekind of implementation detail like a factory for creating something it is part of bounded context but maybe not of the language you use when talking to the domain expert. To the domain expert you only mention the "thing" the factory creates.
> > > 
> > > Short version, why should the schema be part of the bounded context?
> > >
> >
>




------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.