i have following onion architecture framework.
domainentities- domain entitiesinterfaces- domain interfacesservices- domain services
infrastructuredata-fluent nhibernatepersistenceinterfaces- infrastructure interfaceslogging- interface logging in case want switch out logging library else.dependency resolution- ofiocregistrations goes in here.
servicesinterfaces- application service interfaces goes in here, implemented inuiproject.
testsinfrastructure tests- testing infrastructure services etc.domain tests- testing domain models , services
webui- user interface project implement application services, user interface, etc ...
with domain driven development 1 identify bounded contexts. of literature on internet states each bounded context needs abstracted own project or namespace.
- is approach incorrect having
domain modelsin 1 project ,domain servicesin project? matter not having different bounded context's in different namespaces or projects? - if have
model ausedbounded context a,bounded context b,bounded context c, etc needs use exact samemodel a, allow them use exact same model, or create new model eachbounded context?
i new ddd sorry if question dumb question. find myself understanding better if ask question , explanation answer.
any appreciated.
is approach incorrect having domain models in 1 project , domain services in project? matter not having different bounded context's in different namespaces or projects?
different namespaces conceptual and practical solution, since otherwise have entity name collision when 2 neighboring concepts go same name in different subdomains.
different projects/solutions more of organizational choice on top of that. makes things bit easier if separate teams work on bc's, , separate binaries mean bc's more independently deployable.
if have model used bounded context a, bounded context b, bounded context c, etc needs use exact same model a, allow them use exact same model, or create new model each bounded context?
it require more domain analysis tell, whole point of bounded context being able view things totally different angle. in rare cases when
- the exact same entity used in 3 different bc's
- you don't see them evolving own way in future
- the entity doesn't seem naturally belong in given bc
then might want use shared kernel pattern. otherwise, copy entity in each bc , let live own lives, or find entity's true bc , link id other bc's.