Print Page | Close Window

Multiple Models

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=834
Printed Date: 25-Mar-2025 at 4:03am


Topic: Multiple Models
Posted By: DataMan
Subject: Multiple Models
Date Posted: 09-Jun-2008 at 7:00am

THe application that I am creating can be sold to companies using different ERP systems like Microsoft GP, Axapta, and Standalone.  I have built three seperate models in different visual studio projects and depending on which backend ERP system the user has I simply send them the install files that has the proper model.dll file for their backend.

I'm trying to limit the amount of work that it takes to modify those 3 model projects.  Currently any changes I make in one I have to make sure I make in all of them.
 
There are only 4 classes/tables that are different in each backend database type and the other 20 or so are the same.  I was thinking I would split the 20 tables into a single model file and the different tables would stay in three other model files.  Then I can change the 20 all I want and I wouldn't have to worry about syncing them up.
 
So I would have:
App_base_model  contains 20 tables A,B,C etc
App_GP_Model  contains 4 tables  w1,x1,y1,z1
App_StandAlone_Model contains 4 tables  w2,x2,y2,z2
App_AX_Model contains 4 tables  w3,x3,y3,z3
 
The first issue that I can see is relationships between the two models.  Can you programtically create a relationship between 2 different model files?  i.e. a relationship between A ->w1?  I know that you can create relationships in code but this would be a relationship between 2 different models.
 
Are there any other issues with the persistance manager that would need to be addressed?
 
Any thoughts would be appreciated.
 



Print Page | Close Window