Print Page | Close Window

Multiple Models across Multiple Assemblies

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1984
Printed Date: 14-Apr-2026 at 10:17pm


Topic: Multiple Models across Multiple Assemblies
Posted By: jozza
Subject: Multiple Models across Multiple Assemblies
Date Posted: 20-Jul-2010 at 5:40pm
Hi
We are thinking of architecting a modularized solution for the new version of our product. What we would like to do is implement a "Core" data model that contains the data required to run the core of our product. Clients can then purchase additional modules, and each module has it's own specific data model and should be able to interact with the data model in the core. How would one go about this using devforce? Is it even possible?
 
So in short we have two assemblies:
 
Data.Core >> Contains for example the personnel records.
Data.Attendance >> Contains a bunch of other entities some of which need a reference to personnel.
 
 
I've tried creating a linked file to get the Core Model into the "Attendance" assembly and then trying to set the Entity Manager name to the same in both edmx files, but it still generates constructors in both assemblies for the Entity Manager and the one in core only has the core tables (which you would expect) but the enity manager in the attendance assembly only has the tables for attendance and not the ones that are in the core.
 
Any advice is greatly appreciated. Thanks.
 
Jacob



Replies:
Posted By: ting
Date Posted: 20-Jul-2010 at 7:52pm
We did design DevForce to work with multiple entity models, but a single EntityManager cannot work with multiple models that are in different assemblies.  Using multiple EntityManagers is not uncommon, but I'm not sure that would be a great solution since conceptually all your entities are sourced from the same database.
 
If each module is independent, then you could include the core model in all the assemblies and that would promote both code reuse and good integration between the entities.  If the modules overlap, there will be a little redundancy and you will have to make sure to import the correct entities when passing information between modules.

 



Print Page | Close Window