Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alaa Adel 3 posts 23 karma points
    Oct 03, 2022 @ 12:09
    Alaa Adel
    0

    Using umbraco 10 in a domain driven design architecture

    Dears,

    I am going to use umbraco 10 in a domain driven design solution. So the solution will include the following projects

    • Application
    • Domain
    • Persistence
    • Infrastructure
    • Presentation

    I am still thinking where should I locate generated models and services that will retrieve or add content.

    Solution # 1

    Create a domain model with the same properties as back-office but will generate models in persistence layer. Create interfaces like repositories in application layer but implementations will be in persistence layer also

    • Pros:

    Application and Domain layers will be fully independent "I mean will not depend on Umbraco"

    Persistence layer will be the only layer that depend on Umbraco and i think this is meet the clean architecture

    • Cons:

    Implementation will be more complex and needs lots of mapping operations to map between domain entities, DTOs and generated models

    Solution # 2

    Generate back-office models in domain layer Create interfaces like repositories in application layer but implementations will be in persistence layer also

    • Pros:

    Easy to implement

    • Cons:

    Domain layer will depend on Umbraco and i think this is will violate clean architecture as domain layer shouldn't depend on any other layer, frameworks, libraries or a 3rd party.

    So can u help me to decide which is the best solution or can you suggest a new solution?

    Thanks in advance...

Please Sign in or register to post replies

Write your reply to:

Draft