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 6717713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:53:04+00:00 2026-05-26T08:53:04+00:00

I have a class: class BasePage { protected abstract Company ReferencedCompany { get; }

  • 0

I have a class:

class BasePage
{
   protected abstract Company ReferencedCompany
   {
      get;
   }
}

And an asp.net page that inherits from it. However i do not want/need to implement this property in the inheriting class. And I dont really want to leave it blank. Is there a design pattern I can use to avoid this clear violation of the Interface Segregation Principle (ISP)?

Also I cant re-factor the entire code base so I was looking for something I could throw in the way. The adapter pattern perhaps?

  • 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-26T08:53:05+00:00Added an answer on May 26, 2026 at 8:53 am

    You should have more types. If some page doesn’t have a ReferencedCompany then that page is not a BasePage. See an example below:

    class BasePage
    {
       //something common to ALL pages   
    }
    
    class CompanyPage : BasePage
    {
       protected abstract Company ReferencedCompany
       {
          get;
       }
    }
    
    class EmployeePage : BasePage
    {
       protected abstract IEnumerable<Employee> AllEmployees
       {
          get;
       }
    }
    

    If you use this with ASP.NET WebForms consider using MVP pattern, it cleanly separates view model and presenter.

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

Sidebar

Related Questions

I have created a BasePage class that inherits from System.Web.Ui.Page. In that base class
I have a web form page Default.aspx, which inherits from a BasePage class that
In my ASP.NET page, I have a generic class that is defined as below:
I'm building a asp.net web site i build a class localiziedpage that inherit from
I have created a class called BasePage which inherits System.Web.UI.Page. On this page I've
Here are the basics of my setup: I have a BasePage class that inherits
I have this on a base page class in asp.net 4. How do I
I have a BasePage class which all other pages derive from: public class BasePage
I have a base page class where i set client target with protected override
I'm am creating an ASP.NET 2.0 web application that uses a BasePage.aspx that is

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.