I'm starting with DDD philosophy and I'd like to implement an integration with a legacy system that we have here. In my researches in the internet, I found some articles and samples but I must to admit: is pretty hard to understand how to do that integration correctly.
Before to ask this question, I did a search here but the results were not useful for me, so I'd like to know if is possible to send or show me a implementation sample of an ACL.
Here I have this items:
The initial idea is to access that database throughout NHibernate, creating just some the needed mapping classes, the domain entities and implement the business rules. According to Eric Evans, this strategy is called [Bubble Context][1]. I think this strategy will solve my problem, but I need some sample to do that in a right way.
Can someone help me?
The anti-corruption layer contains all of the logic necessary to translate between the two systems. The layer can be implemented as a component within the application or as an independent service.
An Anti-Corruption Layer (ACL) is a set of patterns placed between the domain model and other bounded contexts or third party dependencies. The intent of this layer is to prevent the intrusion of foreign concepts and models into the domain model.
DDD defines an anti-corruption layer is an adapter pattern that isolates one part of a system, known in DDD as a bounded context, from another bounded context. Its job is to ensure that the semantics in one bounded concept do not “corrupt” the other bounded concept's semantics.
Where to draw the boundaries is the key task when designing and defining a microservice. DDD patterns help you understand the complexity in the domain. For the domain model for each Bounded Context, you identify and define the entities, value objects, and aggregates that model your domain.
The ACL is a pattern and not just the piece of code. In what you described you didn't say do you have strong dependencies upon legacy system or you just want to have some independent piece of code built into current system? With this you could decide will be your ACL just a service to database or will it incorporate some wrapping upon legacy system logic?
The actual pieces that you'd put into the ALC are highly depend on your implementation. There is a generic schema of what you're asking for:
You could find more info in Eric Evan's talk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With