Support for a single model connecting to multiple DB types
Posted: Thu 28 Apr 2011 13:43
Hello,
I tried the latest beta of Entity Developer and i cannot seem to find a proper way to maintain a single model for multiple DB types (specifically an Oracle 11 and a MS SQL Server 2008). From what i've seen so far, it seems that you are very close to accomplish this, but for some reason, fail to do so. I will offer my thoughts on this and hope that you fix it during the beta.
What you support now is a model which can be synchronized to a DB through a SINGLE connection. Specific DB info (namely the Server Data Type) is maintained in the model and synchronized through this single connection. If someone wants to change the DB, she first needs to change the connection type, then re-synchronize so that the model gets the new server data types (not always the case. some bugs are present there...) and generate the code. In any case, it is impossible to keep the SAME model! The best one can do is to save the model with an other name and thus maintain 2 models for the different connections.
It is apparent, that a simple change in the architecture, can solve the problem. A single model is should be maintained with NO server info. User should be able to define one or more DB connections for this model. When the user needs to synchronize with a database (Update model from database, update database from model), he selects the connection he prefers and performs the synch. Apparently, the same DB-->model translation should be performed even if the DB type is different. The server data types are NOT required to be maintained in the model. When the user needs to generate Entities, again he selects the connection type and then the correct server data types are generated either in the entity attributes or in the xml mapping file. This is the only place where the server data types are required.
I tried the latest beta of Entity Developer and i cannot seem to find a proper way to maintain a single model for multiple DB types (specifically an Oracle 11 and a MS SQL Server 2008). From what i've seen so far, it seems that you are very close to accomplish this, but for some reason, fail to do so. I will offer my thoughts on this and hope that you fix it during the beta.
What you support now is a model which can be synchronized to a DB through a SINGLE connection. Specific DB info (namely the Server Data Type) is maintained in the model and synchronized through this single connection. If someone wants to change the DB, she first needs to change the connection type, then re-synchronize so that the model gets the new server data types (not always the case. some bugs are present there...) and generate the code. In any case, it is impossible to keep the SAME model! The best one can do is to save the model with an other name and thus maintain 2 models for the different connections.
It is apparent, that a simple change in the architecture, can solve the problem. A single model is should be maintained with NO server info. User should be able to define one or more DB connections for this model. When the user needs to synchronize with a database (Update model from database, update database from model), he selects the connection he prefers and performs the synch. Apparently, the same DB-->model translation should be performed even if the DB type is different. The server data types are NOT required to be maintained in the model. When the user needs to generate Entities, again he selects the connection type and then the correct server data types are generated either in the entity attributes or in the xml mapping file. This is the only place where the server data types are required.