lundi 27 avril 2015

DDD Bounded Contexts with Onion Architecture

I have the following Onion Architecture framework.

  • Domain
    • Entities - For my domain entities
    • Interfaces - For my domain interfaces
    • Services - For my domain services
  • Infrastructure
    • Data - For Fluent NHibernate persistence
    • Interfaces - For infrastructure interfaces
    • Logging - Just an interface for logging in case I want to switch out my logging library to something else.
    • Dependency Resolution - Most of my IoC registrations goes in here.
  • Services
    • Interfaces - Application service interfaces goes in here, they will get implemented in the UI project.
  • Tests
    • Infrastructure Tests - For testing infrastructure services etc.
    • Domain Tests - For testing domain models and services
  • Web
    • UI - User interface project where I implement application services, user interface, etc ...

With Domain Driven Development one would identify the Bounded Contexts. Most of the literature on the internet states that each Bounded Context needs to be abstracted into their own project or namespace.

  1. Is my approach then incorrect for having all my Domain Models in one project and all my Domain Services in another project? Does it really matter not having different bounded context's in different namespaces or projects?
  2. If you have a Model A which is used my Bounded Context A, but Bounded Context B, Bounded Context C, etc also needs to use the exact same Model A, Do you allow them to use that exact same model, or do you create a new model for each Bounded Context?

I am new to DDD so sorry if this question is a dumb question. I find myself understanding something better if I ask a question and get a good explanation as an answer.

Any Help will be much appreciated.

Aucun commentaire:

Enregistrer un commentaire