domain driven design - DDD Entity Framework with multiple bounded contexts Integration Issue -


we use ddd practices in our current project. our issue have lot of bounded contexts , each context layered architecture contains persistence layer. problem example in bounded context need reference data other bounded context example identityaccess context context responsible managing user so, contains usermodel need reference user in bounded context so, create subscriberusermodel contains subset info user model in bounded context. have migration project contains of models of our bounded contexts used manage migrations , our database face issue. can't have more 1 entity refer same table question how handle issue in smart way ef exception when try generate new migration

enter image description here

the answer don't!

from ddd perspective you're doing wrong. bounded contexts shouldn't bound relations in case, independent tables have nothing table in context.

what should create user in context has neccessary properties exist inside context a. information user context should transferred context b, via event, queue, web service, trigger of sort etc., shouldn't bounded relation.

that way may copying unnecessary data context b have nothing entity , business process in context a. although bare same name (user), role , logic in contexts different. don't let fool you!

a video on subject julie lerman on pluralsight (not ad :)).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -