multiple bounded contexts in a migration path
"Tom Eugelink [email protected] [domaindrivendesign]" <[email protected]> Thu, 02 Oct 2014 09:44:45 +0200
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Triggering on your "extend" comment: would one actually extend another domain's entity? I'm currently in the situation where an entity in one BC creates (syncs) an entity in another BC. It involves a 10 year old system, where all the old code in placed in a "legacy BC" and we try to build new BC's when refactoring. Refactoring must be done in small steps, so compromises must be made. One of these refactorings requires us to create entities in the legacy BC. I either: 1. create a duplicate entity in the new BC, complete with persistence 2. reuse the entity from the legacy BC, but should I do that in the boundary (repository) or allow it to be present as an entity (extending the entity in the legacy BC?) 3. move the data part (fields and JPA annotations) into a shared domain and use that from both BC 4. Extend the entity from the legacy domain. 5. have the new BC send a "current situation changed" event and have the legacy BC react to that by syncing the entity. Currently I'm leaning toward solving this in the repository (2.); there information about other domains is allowed. After all, in case of the event (5.) the legacy BC must know about the new BC. Tom On 30-9-2014 12:54, QUALITEC - Óscar Bou [email protected] [domaindrivendesign] wrote: > > A complementary approach is the one taken by the Apache Isis platform [1]. > > They have: > - a contribution mechanism (similar to the DCI concept [2]) that allows to "extend" a Domain Entity from another BC [3]. > - the concept of "view models", that allow to group and render information from different BCs [4]. > > The contribution mechanism is particularly useful as it extends the Isis Metadata model, isolating the other layers from the "source" of a property - simple or collection - or action (i.e., the UI interface, the REST API, ...). > > > HTH, > > Oscar > > [1] http://isis.apache.org/ > > [2] http://en.wikipedia.org/wiki/Data,_context_and_interaction > > [3] http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html > > [4] http://isis.apache.org/more-advanced-topics/ViewModel.html > >