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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:44:31+00:00 2026-05-13T10:44:31+00:00

In a base class object, I have an overridable subroutine that I would like

  • 0

In a base class object, I have an overridable subroutine that I would like all derived objects to have the ability to include. However, they don’t have to, and if it’s not necessary for them to use it, I don’t want them to be forced to declare it. To enforce this, I’ve left the default behavior empty. For example, here’s my whole sub:

Protected Overridable Sub MySubroutine(ByVal someObject As Object)
End Sub

Is this bad practice? I don’t want to declare it as MustOverride, but I don’t want default behavior. Is there a “better” way of doing this, or is this perfectly acceptable? I don’t want to be that hack programmer… just trying to learn 🙂

  • 1 1 Answer
  • 1 View
  • 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-13T10:44:31+00:00Added an answer on May 13, 2026 at 10:44 am

    Yes, this is perfectly acceptable. A MustOverride member can often be too strict of a requirement for an inheriting class so if you want a virtual member without default implementation this is the proper thing to do.

    Anyone who is inheriting from this class will appreciate the fact that you have defined a virtual member as a “hook” into your class like this. Also the fact that you have declared this method as Protected is also a good idea as public virtual members can be problematic from a maintenance standpoint.

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

Sidebar

Related Questions

Assume some domain and view objects (that have no common base class) public class
Say I have a couple of basic objects like so: [Serializable] public class Base
when accessing foo() of base using derived class's object. #include <iostream> class base {
I have a base class pointer pointing to a derived class object. I am
I have a bunch of objects in a class hierarchy and would like to
I have an Object base class, and I have several derived classes called Item,
Suppose that I have the following python base class: class BaseClass(object): def a(): This
I have an object derived from an abstract base class and I want to
As I have read in certain forums,when derived class object is created base class
I want to have a base class which dictates the alignment of the objects

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.