Architectural design for a project with several clients with an underdeveloped database structure (for each client)

I support the application that was copied for each new client (... yes, I know). If a new client wanted to get new features that others do not need, only part of the code has changed. The solution also includes a kind of "common.dll", where all the code is set the same for all clients.

The base MSSQL database for each client is slightly different. All of them have more or less identical tables, but some clients have, for example, additional columns or new tables for special special functions.

As "typed datasets" (ADO.NET C # 2.0) are used in the Visual Studio solution for each client, there is always a specific solution (file), and it contains a specific typed dataset (for example, "XyDataSet.xsd"), In solutions I have helper classes, for example. to process orders. One of the methods in this class can be "GetOrder (string orderId)", which uses a client-specific DataSet to retrieve the order (as indicated by DataRow).

As you can see, I have GetOrder methods in each solution for each client, as there may be slight differences in the order table, for example, additional columns. Therefore, if changes are necessary for the general GetOrder function, I must change it in all projects, which, of course, are a maintenance nightmare.

Do any of you see a way in which this “architecture” could be improved? Or, perhaps, with the various DB schemes currently existing, there is not much to improve the level of a higher level?

+3
source share
4 answers

It is very difficult to answer this question completely, but I would start to think like this:

Database Level:

  • Find what is common and have it as a database schema.
  • Find what the appendix is ​​and add it to separate tables, indicating in this table that (from the general schema) is the owner of the row and its corresponding value. eg.

    {OrderID, CustomerID ..} ( )
    OrderExtensions {ExtensionID, ExtensionName, ExtensionValue} ( )
    OrderExtensionsToCustomers {CustomerID, ExtensionID} ( , )

:

  • .

:

  • ( ) .

:

  • - , . , , (), , .
  • , "", . , . , - , , , .

:

  • , .
  • , (, ..).
  • .
  • (, ).
  • , , , , "" , , , .
  • , () , () ().

, , , : -)

+3

( ), ? , , , . , .

+1

-, . .

, , - , . " " .

, . , getOrder . http://www.dofactory.com/Patterns/PatternTemplate.aspx

Ole, , , - , .

, .

+1

, , . xsd addd a

  <xs:anyAttribute />

datatable, xsd.

, .

I'm not sure if the vs2008 / vs2010 dataset-editor can handle this or even destroy the information anyAttribute. But the dotnet xsd.exe code generator does support anyAttribute, since dotnet 1.0, including the current dotnet 4.0

+1
source

All Articles