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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:02:46+00:00 2026-05-26T02:02:46+00:00

First an example to discuss: class Foo { // Attributes: int attribute1, attribute2; //

  • 0

First an example to discuss:

class Foo
{
    // Attributes:
    int attribute1, attribute2;

    // Methods:
    virtual void Foo1()
    {   /* With or without Implementation   */  }
    virtual void Foo2()
    {   /* Also with or without Implementation */ }
};

class ExactDuplicate: Foo   // No New Attributes or Methods
{   
    virtual void Foo1()
    {   /* A new Implementation */  }

    // Also there might be new Implementations to other methods
};

class ExtraMethods: Foo     // Having New Methods
{
    virtual void Foo3()
    {   /* Implementation   */  }
};

class ExtraAttributes: Foo  // Having New Attributes
{
    int attribute3;
};

I had a discussion -with my teacher- about the “is A” and the “is Like A” relationships and how do they differ.

My Opinion (which I read somewhere I can’t remember) is that the “is A” relationship is between a Parent Class and a Child Class which is inherited form it, and it’s not affected by adding new methods or attributes, so any instance from the child class “is A” Parent class, in the above exmple, every ExactDuplicate, ExtraMethods, or ExtraAttributes “is A” Foo. While the “is Like A” relationship is between two Child classes inherited from the same Parent class, in the above exmple, every ExactDuplicate “is Like” every ExtraMethods or ExtraAttributes, and the reverse.

My Teacher’s Opinion was that the “is A” relationship is between a Parent Class and only the Child classes which do not add any extra methods or attributes, so in the above example there is only one “is A” relationship between Foo and ExactDuplicate. While the “is Like A” relationship is between a Parent Class and the Child Classes which add extra methods or attributes, so in the above example, there is an “is Like A” relationship between Foo and each of ExtraMethods and ExtraAttributes.

I think that, the “is A” relationship as defined by my teacher is not really useful because in most cases there is no reason to change the implementation if nothing is added. This is a point. Another, a Car “is NOT Like a” Vehicle, it actually “is A” Vehicle, while a Van “is Like A” Car, since both associate some characteristics.

So which is correct and why?, I would highly appreciate explaining.

Also if my teacher’s opinion is the true one, does adding only Attributes make the relationship an “is Like A” relationship, or it needs adding new methods to become an “is Like A” relationship? and what (if exists) is the relationship between the Child Classes.

Hope my questoin is clear and understandable.

Any Help would be Greatly Appreciated 🙂

  • 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-26T02:02:47+00:00Added an answer on May 26, 2026 at 2:02 am

    As the terms are typically used, you’re right and your teacher’s wrong.

    Is-A does allow extension. The child can have attributes, operations, etc., not allowed by the parent. From an OOP point of view, the crucial point is that an instance of the child can be used in place of an instance of the parent under any circumstance (Edit: which, yes, I should probably mention is called the Liskov Substitution Principle, often abbreviated to LSP, named after its originator Barbara Liskov).

    Is-like-A is used mostly to describe mistakes — when somebody tries to have square inherit from rectangle (or vice versa), for an obvious example. Neither is really an extension of the other, because neither has all the characteristics of the other. Neither should inherit from the other because there may be a circumstance in which substituting one for the other either doesn’t work (the proposed child doesn’t meet the requirements of being a parent) or could break something (a change allowed by the parent would break an invariant of the child).

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

Sidebar

Related Questions

First example which works: public class Test { public int ID; public string Name;
I have a simple marker annotation for methods (similar to the first example in
The following small example shows my problem: template<class T> struct X { static void
When attempting to run the first example in the boost::mpi tutorial , I was
I need to set/get the cookies stored at first.example while browsing second.example , I
Could someone explain this (strange) behavior? Why is the length in the first example
For example: First, say I have a Silverlight app with Windowless=true so that I
I have a simple question related to one-line programming. First an example: function test(a)
Is there any Java library that supports hierarchical column? For example (the first three
For example, will the first piece of code perform a full search twice, or

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.