In Implementing #DDDesign why use Anticorruption Layer rather than a Repository to integrate with another Bounded Context?

Typically the Repository pattern is used as an Adapter in front of a database. In general you could think of a Repository as an AcL over a database. 1/6
But then again, an AcL is at least both of these: (1) an Adapter, and (2) a Translator. Typically a Repository doesn't translate from database data into a model's data. Usually database data is at most reshaped when hydrating 2/6
models. In other words, you think of an AcL more as a translator between two different model languages, where one language might not be carefully defined. A Repository isn't translating between languages, just adapting database data shapes to/from domain model data shapes. 3/6
With AcL, make sure you have very good reason to duplicate data across context boundaries. In general replicating/duplicating data across boundaries is a bad thing.

Every chapter of Implementing #DDDesign, and Chapter 13 in this case, demonstrates different ways of 4/6
handling similar challenges. The Agile PM Context has a very high autonomy quality attribute. The Collaboration Context is designed earlier before SaaSOvation had a lot of experience with DDD. Decisions are never static and certainly imperfect. Continuous improvement matters. 5/6
If you are going to deliver software that is useful and provides valuable customer outcomes, you must make decisions now and later.

As with all software decisions, pattern choice depends. This thread should help make choices clearer. 6/6

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Vaughn Vernon

Vaughn Vernon Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @VaughnVernon

Mar 21
Q: In the book "Implementing DDD" you say to do code reviews with domain experts. Really? How?

A: First, I didn't say that.

The point is that business experts can understand tests if the tests follow the language that the experts helped develop and if the tests present 1/5
realistic scenarios with realistic data/information.

I don't know how many times I have seen tests with completely bogus scenarios and data. For example, George Washington and Abraham Lincoln have no value-add as personas in most modern contexts. 2/5
Instead such example data disrupts experts' ability to think through scenarios because the examples are ridiculously unbelievable.

I have written test data generators that randomly produce a range of realistic valid data associated with subjects that, eg, work around HIPAA 3/5
Read 5 tweets
Jan 28, 2019
Are you designing software with names like these?

Task<IGameGrain> GetCurrentGame();
Mono<Employee> getEmployeeById(String id);
Flux<Employee> getAllEmployees();

Really? Is that your final answer?
Poor choices:

1. Technical component name in protocol.
2. Task doesn't describe the eventual completion of an async value.
3. Mono " " " " " " " ...
4. Flux " " " " " " " ...
5. The word Get/get/GeT/gEt/geT/etc.
Many such names become glyphs. They only represent something that you intend, they don't describe what you intend. Your brain will ultimately filter this noise out of your way, because they have no meaning.

Names matter. Stop being a programmer *only*.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(