Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6037839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:07:56+00:00 2026-05-23T06:07:56+00:00

I am current working on a semi large MVC 2 project and the number

  • 0

I am current working on a semi large MVC 2 project and the number of controllers we have with associated views and viewmodels is becoming quite large. In order to try and provide a bit of separation I have been looking into using the areas feature of MVC 2 and refactoring the project accordingly.

One of the issues I face is we have an inheritance hierachy for our controllers in order to share functionality and properties that we use in concrete controllers that then expose the necessary actions we wish to deal with.

Essentially we currently have a setup like so in our main controllers folder:

Controller (MVC)
+-- BaseController (Abstract)
      +-- BaseWorkController (Abstract)
          +-- BaseWorkAController (Abstract)
              +-- ... a number of controllers exposing actions
          +-- BaseWorkBControllers (Abstract)
              +-- ... a number of controllers exposing actions

I am thinking of creating Areas for each work controller i.e.

  • Area/WorkA
  • Area/WorkB

Each area would have their associated views and viewmodels and even models.

However the problem I seem to face is where do I place the BaseWorkController. Is it ok to leave that in the main Controllers folder and the area controllers just include a reference to that controller. Also code in the different areas might need access to different models and even some attributes that we create for certain functionality.

Does this setup seem like an acceptable use of areas. From what I have read areas seem to help with seperating concerns and functionality which is what I’m looking for. However I don’t want to invest in doing this if it is a complete wrong use of the functionality?

Is it acceptable that controller code use functionality from other areas or the main core controller/model/view folders.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:07:57+00:00Added an answer on May 23, 2026 at 6:07 am

    The amount of Inheritance in you application is a warning to me. If you have that much shared behavior, I think you should consider pulling it out of the controller itself and create some classes that encapsulate the shared logic, and then you can extend the functionality of your controllers via composition, rather than inheritance.

    To answer your question, there are no issues with sharing logic from a base controller into controllers in other areas. If it makes sense to do so. But if you start getting several layers deep in your inheritance chain, I would strongly consider reviewing the code and seeing if the shared logic might make sense in a different shared class, than complicating things with multiple overrides.

    You might want to look into the strategy pattern if you are overriding behavior at different levels. You can use that pattern to swap behavior of components and use composition, rather than inheritance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am current working on a MVC C# application and have a HttpPost ActionResult
I'm working on quite complex project and time after time I have to narrow
I am current working on a project where, as different users add text to
As a beginner in Ocaml, I have this current working code: ... let ch_in
The current class library I am working on will have a base class (Field)
I have a semi-working example that you can look at. This appears to work
I have the .java file on the current working directory but javac reports: javac:
I'm working on a project myself. I have subversion setup and using tortoisesvn to
I am working on a project in which I need to know the current
How can I retrieve the current working directory of cmd.exe? This seems possible. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.