Giter VIP home page Giter VIP logo

Comments (2)

thombergs avatar thombergs commented on July 20, 2024 4

Hi @jaylensoeur

good question.

Yes, the AccountMapper has to change when either the Account entity or the ActivityWindow entity changes.

But, I decided that I don't care much about that :).

That's because I don't mind changing code in the persistence adapter if the domain model changes. I would mind very much if I had to change code in the domain model if the persistence adapter changes, however!

So, I decided that the direction of the dependency is more important to me than having a very narrow responsibility in a mapper class.

Saying it with Uncle Bob's words: the persistence adapter is "just a detail". The important stuff happens in the use case implementations and the domain model. This is where the business rules are implemented. The database "just" stores and retrieves data (and maps it into the domain model). So I don't care if I have to change the database if the business rules change.

Having said that, I would not put all mapping methods into a single mapper, but instead, group them into mappers by entities if there are more than a handful or so. But that's just standard code hygiene :).

from buckpal.

jaylensoeur avatar jaylensoeur commented on July 20, 2024

Thanks for the response

from buckpal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.