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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:47:37+00:00 2026-05-15T22:47:37+00:00

I only very recently began developing professionally. I studied OOP while at University, but

  • 0

I only very recently began developing professionally. I studied OOP while at University, but don’t feel as if I ever really used it in a “real world” scenario.

Basically, in trying to create/manipulate a specific type of document within the organization, I created a class for it, with the thinking that anytime we wanted to create/manipulate that specific type of document, we could just create an instance of it and give it certain information and have it take care of itself.

I know we’re planning on working with other types of documents (I guess I should note, when I say types of documents, I mean something like “expense report” or “inventory list”, as in I’m referring to the content.) I assumed all of these kinds of documents would share certain kinds of functionality (for example, working with shared strings or defined names in Excel), so I then created an abstract Document class, and thought each type of document we wanted to create could extend this class.

Of course, I’m still only working with one type of document, so while I sort of have an idea of methods that might be common to all documents, I still at this point only have one abstract class and one that extends it, so it seems sort of unneccesary.

I guess my questions are:
1) Should I even be using an abstract class here. Like does this seem like the appropriate use of one or have I completely missed the point?
2) If I should be using one, should I not be using it this early? I mean, should I wait until I actually have several documents in front of me so I can actually determine what kind of functionality is shared between all of them rather than sort of assume I know for now even though I only have one class implementing it?

Thanks.

  • 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-15T22:47:38+00:00Added an answer on May 15, 2026 at 10:47 pm

    Abstract class sounds about right from your description: there are certain properties and behaviours that are common to all the derived types (some of these may be ‘default’ behaviours that derived classes may change). However, some of the derived classes may have additional/alternative behaviour from the others.
    If there were no ‘default’ behaviours and only a method specification, then an interface would have been more appropriate.

    As to whether it’s too early:
    How certain are you that you will definitely need more than one derived class. I wouldn’t bother with setting up abstract base classes until there was no possible doubt that it would be needed. This is known as YAGNI (You Aren’t Going To Need It); don’t create code until the last possible minute, otherwise you might never need it and you’ve saddled yourself with extra potential maintenance.

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

Sidebar

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.