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

  • Home
  • SEARCH
  • 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 8913167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:23:30+00:00 2026-06-15T04:23:30+00:00

Need a bit of OOP help. I have a base payment consisting of SendPayment()

  • 0

Need a bit of OOP help.

I have a base payment consisting of SendPayment() UpdateRecord() then child classes implementing different payment formats e.g. PayPal, SagePay.

While all have SendPayment() method they are all implemented differently. So I override the base class to apply my own implementation in each child class. The base classes do not hold any implementation just empty methods. Is this a good way of OOP to have empty methods then implement override code in each child class or remove the empty methods in the base and have these methods in the child classes?

thanks…

Sorry a quick edit. I do use the base class for certain scenarios for example calculation. This covers all payment types such as counting how many products by the cost and removing records from the table.

  • 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-15T04:23:31+00:00Added an answer on June 15, 2026 at 4:23 am

    I would suggest to make your base class as abstract class and make the unimplemented method as abstract method.

        public abstract class BasePayment {
    
            //abstract method: unimplemented        
            public abstract void sendPayment();
    
            //implemented method    
            public void UpdateRecord(){
                .....
            }
    
        }
    

    Abstract class is meant for this kind of scenarios where you want to have mix of implemented and unimplemented method. One added advantage here is: Every extending class will be forced to implement its own sendPayment method.

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

Sidebar

Related Questions

I need a bit of help with some Ruby array jujitsu. I have the
I need a bit of help again... I have this code: <div id=lyrics> <div
I am a bit new to PHP OOP so I need you guys help
Need a bit of help with a form. I have created a form which
I need little bit help related to android tabhost. I have 3 tabs and
Need a bit help. Still a beginner at jQuery... I have a product package
i need a bit of help with some maths. I have a range 0
I need a bit of help. I have (reference?) table with columns: id ,
I need a bit of help with this javascript code. I have this code:
I'm relatively new to QML and need a bit of help. I have to

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.