I'm in the situation that I have to design and implement a system from the scratch. I have some questions about the architecture that I would like your comments and thoughts on.
Quick Info about the project: It's a data centric web application.
The application will be built on Microsoft .NET Framework 4.0 with MS SQL SERVER 2008 database.
Requirement:
- Rich UI and robust
- Multi-device support (every browser and on every device)
- Loosely coupled
Below is the architectural diagram I have built:
Briefing of the architecture
- Presentation layer : HTML5/ASP.NET MVC + JQuery (Web application for multi-device support in first version)
- Distributed Services : WCF (XML/JSON/JSONP)
- Domain Layer(Business Layer) : All business logic
- Data persistence (DAL Layer) : Entity Framework 4.0 with database first approach. POCO entities are generated and separated out using T4 template
- Infrastructural Layer: Contains common libraries like POCO entities, Exception Handling, logging etc
My Concerns :
- As application is to be built loosely coupled so in future if business requirement grows new modules can be easily plugged in without affecting the architecture. So I thought of using the Repository pattern along with IoC and DI (can be Unity/Ninject/Sprint.NET or any other)
- WCF with both XML and JSON support
- Distributed Service Layer to place IoC & DI
- Exception Handling & Logging using Enterprise Library 5.0
Looking for valuable comments and suggestions. If I am doing anything wrong please put me in right direction.
It makes sense that the WPF, WinForm etc UIs should call the WCF layer. I'm assuming that it's a business requirement to have multiple UIs, otherwise if you can only have one UI a responsive web UI is the most flexible choice.
However, I don't think your MVC UI needs to use the WCF layer. It could call the domain layer directly. That would be faster and remove a pointless layer.
Obviously, that would only work so long as you don't put any logic in your WCF layer. And the WCF layer really shouldn't have any logic in it.
You also state that you want to place IoC & DI in the Distributed Service Layer. That doesn't make much sense in terms of your MVC UI. You'll need to use DI in the MVC project so you can unit test the controllers.