I’m developing a fairly large application.
It’s basically an eCommerce app- with other “features” like Forums etc…
The “back office” app will be called “Wokingham”
What I currently have is something like this:
(we have a naming convention bases on names of trees)
MyCompany.Honeysuckle
Project that contains the Model and Data Access (IRepository etc..) for forums
MyCompany.Willow
Models and data access for Products, product search etc…
MyCompany.Poplar
Models / data access / services etc.. for Orders
MyCompany.Juniper
Customers
All the above are class libraries, that compile into a common /bin/ dir
Wokingham (the admin backend system, mentioned above) will share some functionality with the “public” web app-
For example- in Forums (MyCompany.Honeysuckle) – the public app will have the ability to add a new Question.
This functionality is also available in Wokingham.
My question is when it comes to Controllers of the MVC applications.
There will be (at least) 2 ASP.NET MVC Applications-
A separate one for “Wokingham”
Should I have a MyCompany.Honeysuckle.Controllers project? That both the public UI project and Wokingham share.?
Or-
Should there be the MyCompany.Honeysuckle.Controllers mentioned above, but then the .Wokingham project extends the controllers to perform additional required functionality?
I would separate the two controllers, one for front-end operations and one for admin side. The tricky question is where to put the shared operations.
The short way: can you just redirect/open new window if an admin user wants to create a new forum post? This would save you lot of time, and is common practice.
The long way: if having two pages doing the same thing is necessary, then I would go with separate controller operations and views, but shared CRUD services (model layer). The work is mainly to create the different view.
Generally speaking, you want to keep controller operations as simple as possible, as they are just end-point to web requests. And going through the trouble to abstract similarities between two slightly different controller operations is overkill.
Edit: removed irrelevant suggestions.