views:

30

answers:

1

Hi All,

I have an application that uses WPF Composite, and I have an issue. I've got a big database that is attached to the application and I need it exposed to different modules as part of the application.

What is the best way to expose my Entity Framework model to all my different modules and views inside them? Do I have one EF model or a separate one for each module and then only the tables that each module needs. The only problem being that some tables have a relationship and will have different views and those views will be in different modules.

Any ideas how to resolve this?

+1  A: 

It sounds as though defining your Entity Framework model in another assembly that could be referenced by all your modules is likely the correct way to go. Think of this assembly as an old-school Data Access Layer, shared amongst multiple business and presentation layers. The fact that the presentation layers are all knitted together by Prism is pretty much immaterial.

You could certainly define multiple models, but I suspect that would be more maintenance than is necessary, assuming your different modules are hitting overlapping parts of the database. Given your statement about the views and relationships, I suspect having one big model is the least unwieldy solution for you.

Ben Von Handorf