0

We are currently designing an ERP solution which will be built on ASP.NET MVC4. The system has modules (Say HR, Sales & Production) which will need to work independent of each other.

I am trying to figure out the most logical and efficient Architecture & structure of my Visual Studio Solution so my development team can work together on the project and the code can be managed easily in source control (GIT). The team should be able to work on separate modules of the system and debug/test them independently.

To build the n-tier application we are adapting parts from the Prodinner & Magazine Website sample projects based on MVC. So we plan on having the following structure:-

  • Core – Models, Security
  • Data – Repository, Unit of Work, DbContext
  • Infra – Interfaces
  • Service – Business Logic, Model/View Model Mapping
  • Web – MVC 4 Application
  • Tests – Unit / Integration Tests

Any suggestions on improving this structure? I have looked at so many example n-tier application / blogs / tutorials but cannot find a definitive structure for an n-tier application.

Also in the above structure how do I include the separate modules of the system? Some modules will share certain data entities.

This will be a cloud based solution used by multiple clients, what is the best way of creating client extranets and enabling/disabling modules for them?

2 Answers 2

1

I'm not sure this question will be opened for long because it is too broad, but I will drop my 2 cents anyway.

Instead of trying to have all projects under the same solution and ending up with 6 projects (from your sample) for each module I would advise you to build the application based on web services (regular web services, WCF, web api, etc). Doing that you have advantages such as:

  • Develop and deploy each service and front end application separately
  • Scale each service and module according to separated needs (sales can use much more resources than let~s say HR)
  • Build smaller and more concise projects

If you try to put all modules under the same code base you will end up with generic classes (customer for example) that try to fit all customer scenarios and end up being very complex. You should also take a look at Bounded Contexts for more about this subject.

3
  • As additional, ASP.NET mvc's controller is already a web service. Except expanding into WCF for non-IIS hosting, developing another webservice is a redundancy.
    – Fendy
    Aug 5, 2013 at 20:07
  • @Fendy You could probably use ASP.NET MVC as an API, but since a better ideia is to separate the actual front end project from the services you would probably be in a better shape using Asp.NET Web Api
    – tucaz
    Aug 5, 2013 at 20:10
  • Ah right, I'm under impression of designing a secure single page with client programming and webservice. I forgot that ASP.NET MVC controller is also returning view and action.
    – Fendy
    Aug 5, 2013 at 20:14
0

After evaluating various possible technologies and frameworks, we decided to go with OrchardCMS (an opensource cms built with asp.Net MVC) as a framework for our application. Though it is a CMS, it has been designed well and can be used as a core to any application.

You can make use of its ContentItem as a base for all your entities and hence get a lot of features out of the box - ACL, Dynamic Navigation, Logging, Caching, Indexing (Lucene), Localization, Scheduling, Workflows, Event Handlers, etc.

Also if you want to use it only as a framework then you can choose to write standard MVC models, controllers and views and use their nHibernate repositories to consume data. You dont have to worry about testing the core layers of your application as it is already tested for you.

The advantage of building on top of Orchard is that your application becomes very modular. You can build parts of your entire application as separate orchard modules. So even if orchard upgrades, upgrading your modules will be pretty straight forward. It isnt a very good idea to modify the core code of orchard as in the case with any open source project.

The version (1.x branch) has been ported to MVC5 and WepAPI2 and uses nHibernate as the ORM.

For more info on orchard and to get started visit http://www.orchardproject.net

UPDATE Dec 2018:

Would like to point out that ASP.NET Boilerplate is a fantastic framework to use for any such projects today!

1
  • This is a very old post. Would like to point out that ASP.NET Boilerplate is a fantastic framework to use for any such projects today!
    – Yashvit
    Dec 24, 2018 at 5:33

Your Answer

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

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