Reputation: 89
I'm currently working on a project that consists of an ASP.NET MVC web application with a back-end wrapped in WCF services. I've used MVC and WCF on past projects but I've never been responsible for designing the architecture from scratch. I'm hoping for some feedback on my current design to make sure that I'm employing good design practices from a high level architectural view.
Here is the dependency diagram to give an idea of how things are structured:
Does any of this stand out as bad practice?
Upvotes: 0
Views: 638
Reputation: 3757
The architecture that you proposed above is pretty similar that I've used in my projects. Some comments:
It works great and I don't see any issues in your archtecture.
Upvotes: 1
Reputation: 15175
• Service contracts and data contracts are in a common project which is shared between both layers.
I would avoid this. It may seem like extra work but I would break these out into separate namespaces and classes, even if it leads to duplication. I normally shy away from planning for the unforeseen, however, I have never had a project in which all my data contracts aligned with all my service contracts. The hacks to accommodate the differences tend to lead to confusing anti-patterns.
The majority of these classes will have identical properties and they can easily be mapped using an auto mapper.
Upvotes: 1