문제

I hear that bounded context concepts work closely with DDD and I see examples of it working with applications that follow the Code-first approach. Would bounded context work with DB first approach as well? I think it would but have not seen many examples. So, pls guide me.

THanks

도움이 되었습니까?

해결책

Here's the link I think you're looking for that explains the challenges involved. I'm thinking going for a code-first approach would be best, and you can still see the visual model by installing the Entity Power Framework Tools in a new project. First, here's the link:

http://microsoftnlayerapp.codeplex.com/discussions/263324

Then if you choose to abandon the database first based on the potential challenges outlined in the link above, you still get the visual benefits of the designer by installing the Power Tools:

http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d

In a new project, (first make sure Entity Framework 5.0 is installed, otherwise the power tools will install the beta 6 version) and right-click on your new project in Solution Explorer, select Entity Framework -> Reverse Engineer Code First. This will generate your classes (hah! whoever said it was 100% pure code-first), and then you can use that as a template to begin moving over the classes to your real project. You could use the generated classes as-is, but I think it's good to move over just what you need (i.e., in your case, moving over and organizing the new dbcontexts and corresponding dbSets in each to create your bounded contexts. I know it's not database-first, but it's pretty darn close with that reverse engineering tool :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top