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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:22:20+00:00 2026-06-18T01:22:20+00:00

I have this abstract class named as RenderableEntity . I have a public method

  • 0

I have this abstract class named as RenderableEntity .

I have a public method render() that has some logic wrapped around abstract protected render() method. How should I name this abstract render() method. Is there some kind of convention eg. doRender(), makeRender() for protected method render()?

public abstract class RenderableEntity extends Entity {

    private boolean visible;

    public void render(){
        if(visible){
            render();
        }
    }
    protected abstract void render();
}

Edit: I know this snippet does not compile. I was just wondering how to name this abstract method since I can’t have methods with same name and same parameters.

  • 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-06-18T01:22:22+00:00Added an answer on June 18, 2026 at 1:22 am

    First: Only consider special naming for methods like these if they are for exclusive use by the template method. In addition, you should comment these methods stating that they are used by the template method and any modifications should be made with that usage in mind.

    The methods that make up replaceable steps in a template method are often called “hook” methods. You’ll sometimes see them named with “Hook” at the end.

    In your example, you may want to call it renderHook(), though if you can get more specific on the task that it is performing within the template method render() that would be more descriptive.

    I have seen doXXX() used, though it’s primarily when there is a one-to-one template-to-hook relationship.

    A possible suggestion. For a template method stuff():

    • If stuff() is primarily simple control logic around a single hook, name the hook doStuff() (This seems to be the case in your example above)

    • If stuff() orchestrates several hooks, name them independently with Hook suffixes, and do not name any of them the same as the template (in this case, there should be no stuffHook() method.

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

Sidebar

Related Questions

I have a model that looks something like this: public abstract class Parent {
I have an abstract class with some methods,including an abstract method(Execute()).This method is overridden
If I have a parent-child that defines some method .foo() like this: class Parent
I have classes which are inherited from abstract Packet( this class has abstract method
Let's say I have some classes like this: abstract class View(val writer: XMLStreamWriter) {
If I have an abstract class in java named Foo and it has an
Say I have an abstract class named AbstractItem that is used as a field
Ok this one is puzzling me. I have an abstract base class named Testbase
I have a class named MANAGER public abstract class MANAGER { } Nothing complex
I have one abstract class named contact and another class called client that inherits

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.