Re: Re: Sharing Aggregate Roots between Bounded Contexts
Paul Rayner <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAKKp0qjsD-=BV05q+YN_U1Zg6cdCKs8mKA=jp=CSfZU=ezEb1Q@mail.gmail.com> |
On Sun, May 26, 2013 at 5:29 PM, wonderfulworldofpingpong < [email protected]> wrote: > ** > > > Thanks Paul. > > So, even though it causes code duplication but it is required that two BCs > need to have it's own aggregates else it needs to be in a shared kernel. Am > I right? > Right. Bounded contexts have different models. There is nothing to share, concept-wise. Start with the model. I get the sense you are thinking implementation-only. And avoid shared kernels, if you can. > > Is it okay to share the implementation of a repository? > Generally, no. Why would you want to do this, since it would couple two bounded contexts tightly together? I would need to see an example. > > > --- In [email protected], Paul Rayner <paul@...> wrote: > > > > Not ok. There is one exception, which is Shared Kernel. > > > > On Sun, May 26, 2013 at 5:13 AM, wonderfulworldofpingpong < > > varghese.pallathu@...> wrote: > > > > > ** > > > > > > > > > > Is it okay to share Aggregate roots between bounded contexts? For > example, > > > a 'contact' aggregate root shared between two BCs like Project > Management > > > and Contact Management? > > > > > > When an aggregate root is shared between Bounded Contexts, the > repository > > > also can be shared. > > > > > > Is this domains corruption or is it within DDD best practice? > > > > > > > > > > > > > >