Is it "allowed" to access a database in a BC from the outside?
"atle03" <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Hi all, Anyone out there having experience on integrating a modern, DDD-style app with a legacy system? We are planning to slowly start to replace our legacy system with a set of smaller bounded contexts written DDD style. (This also means switching from legacy development technology to more modern tools - .NET in this case). The legacy system is very DB-centric, and will (because of the business value of its code base) be with us for a long time yet. This gradual replacement can be seen as a way of using Martin Fowler's strangler application pattern (http://martinfowler.com/bliki/StranglerApplication.html). An important note is that the legacy DB contains (almost) no stored procedures, just plain data. The strategy we have chosen is to let the new bounded contexts use (subsets of) the same database as the legacy system. This means that the repositories in each "new" BC will work towards a subset of the db tables used by the legacy system (they store their data in the same tables). Technically this seems to work well, but I am a bit concerned if there are more long-term aspects of this that we haven't thought about. Speaking in DDD terms, I guess we should see the common database as an shared kernel upstream to the new bounded contexts, and treat all db changes correspondingly. The repositories in the new bounded contexts will in addition to being a repository also act as an anti-corruption layer towards this shared kernel. But even with an ACL, we still have to pay special attention to database changes, since we cannot just compensate for everything in the ACL. Over time, more and more logic will be moved into the new bounded contexts, but for all foreseeable future the legacy will exist and some business processes will be implemented there. Anyone out there with any experience they want to share? Regards, Atle ------------------------------------