0

I'll will make ERP software for managing data for business activities. The solution must have two big parts: a WPF application for all the clients and an ASP MVC Web API application for all the client.

The API application manage all the public data that is equal for all the clients and store it into a SQL server database on the Azure cloud. The clients could access this data by an API to the web service.

The WPF application manage all the private data and store it also on a SQL server database on the server of the client. But here is there a problem. Not all clients has an own server. In this situation the database must also run on a cloud service like Azure.

99% of the users use only the WPF application and not the web service. The desktop app access API's from the web service. For both databases (on client and server) I'll use Entity framework 6 with code first migrations.

Scheme

The question is what code design pattern (like MVVM or MVC) can I use for my ERP software that hasn't duplicate code and with a service layer for manage the direction of the data, to the web service or to the client's server farm or if the last case is not possible to the client's server farm on Azure.

asked Mar 30, 2016 at 10:22
1
  • 1
    You can use either one of the ones you mentioned: MVVM or MVC. It will have a Service Layer because you're going to put in a Service Layer. Commented Mar 30, 2016 at 15:07

1 Answer 1

1

Create a Repository Layer contains and manage all your repositories and business logic, create unit of work class to act as single point to manage your repositories.

Create Data Access Layer that will contains your database Layer (EF code first).

Create contracts Layer will contains all interfaces of your repositories which you can easily inject it using IoC

Create Services Layer which will contains any 3rd party services and custom services, your ERP will connect to. use factory design pattern to define your services configurations to be easily to upgrade or downgrade your service API.

You can also create Helper Layer contains all Helper classes, log and exception handling.

Use IoC to inject your repositories and services.

You can return to Mr. Martin Fowler reference (design patterns of enterprise applications) very useful book.

answered Mar 31, 2016 at 18:28
2
  • if this answer your question, Mark it as answer so, can help other. Commented Apr 1, 2016 at 5:01
  • Sorry that I'm a bit to late to accept your answer, but I'm not every day online on Stack Exchange. Commented Apr 1, 2016 at 11:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.