Reputation: 8442
I'm accustomed to structuring my CMS and client sites in two different areas
of a single MVC project. This MVC project references an application layer (class library) that services both areas within that MVC project. The application layer references a domain layer which then references a data layer (both in their own separate class libraries). The MVC application only knows of the application layer.
I'm starting to desire the benefits of seperating the CMS into it's own application, some of which are:
In order to do this, from my initial research I've found that I would need to create a WCF application that would reference the application layer. Then from here, the CMS MVC application and the Client MVC application would only communicate with the WCF layer.
Downfalls of this approach:
Is this easiest approach to achieve what I want? Can anybody throw me some examples or easy to understand case studies of similar situations?
Upvotes: 1
Views: 371
Reputation: 8442
I've seperated the CMS out into it's own project but following the same namespace. Now I can just reference the cms dll from my client MVC application, set up the route and copy over the file assets (views, content).
As for the WCF layer, I've decided to hang out for the Web API in MVC 4 and make do with that until I stretch the limits of it and have to move to WCF.
Upvotes: 1
Reputation: 5614
Basically it's your choice, how you want to keep the application. If you want your Business Logic to be exposed later on as Web Service then you must use WCF, so that business logic of your CMS become independent of any client interface so if later down the line if you plan a mobile version of your website then in broadly terms you have to change only client and that can be developed by third party for you if you have kept your BL in WCF.
If i was in your place i would have definitely gone for WCF approach.
And if you talk of easiest approach then have BL as a part of your project. But again you have to chose between scalability and easy development.
Upvotes: 1