I have some doubts on how to proceed on my project. Two years ago, we started a small project for a industrial quality control (es: dimensional control). Originally the software must ran only in a PC with a printer but, now, it’s runing on six different PC with a DB server.

This six application are all different, in some case there’s small changes due to different hw to be control and in other, the software is complete different due to industrial reasons. Today, the basic problem is that the program design was not think for this scale. The DB code is not well separated from logic core and there are 6 different ADO.Net interface to the same DB.

Now, I’m looking to implement a design MVC because, to improve the maintainability and if it's possible add some test units.

Question: The DB schema don’t match with the data model.

Usually, to convert the DB data to the application data are neccessary some statistical funcions and they can be different. Now this info are store in the query inside the ADO.

My idea is to create a common library to share the DB schema with all the applications but it's a good idea?

if I want a common interface to the DB what the best design? It’s possible to take all the DB interface and store in a library and use a test suite?

I'm overengineering the project?


You might want to consider building a separate server process that will be used to get data from the database. You could write a RESTful web service for this, and your applications can then access data by querying a URL on the main server. The web service then gets the data from the database and sends it back. This simplifies the desktop applications since they no longer need to talk to the database directly. It also ensures that all applications will get data in a uniform way.

If you don't want to have a full web service for this, having a common library shared between all of the applications is a good way to go. With a common library, when you need to make code changes you only need to change the code in one place, and then update the applications to use the new compiled library (unless you change the interfaces within the library). Still more work than a web service though.

  • My problem it's not the access to the db but the maintainability and possibility to run test unit because if the software fail due to wrong update I stop the company production. – Linefinc May 24 '17 at 17:25
  • @Linefinc: A stand-alone library and a web service are both maintainable and testable solutions. – FrustratedWithFormsDesigner May 24 '17 at 17:40
  • I need an answer from the server in less of 150 ms, at the moment I use a separate thread with connection pooling on ms SQL server – Linefinc May 24 '17 at 17:45
  • Either of the approaches I described could maintain a response time of less than 150 ms (depending on many many many many various factors that you never discussed so I have to guess include but are not limited to: hardware configuration, result set size, server configuration, database indexing, etc...). Maybe you need to clarify your question a little bit. – FrustratedWithFormsDesigner May 24 '17 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.