"is the relationship" VS "like" A ", what does each of them mean and how do they differ?

First, consider an example:

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 relationship "there is A" and "like A", and how they differ.

( -, ) , " " , , , "" , , ExactDuplicate, ExtraMethods ExtraAttributes " A" Foo. " A" , , ExactDuplicate "" ExtraMethods ExtraAttributes, .

, "" , , "A" Foo ExactDuplicate. " A" , , " A" Foo ExtraMethods ExtraAttributes.

, "is A", , , , . . , a Car " " Vehicle, " A" Vehicle, Van " A" Car, .

, ?, .

, , " A" , , " A" ? ( ) .

, .

:)

+5
1

, , .

Is-A . , .., . , (Edit: , , , , , , LSP, ).

Is-like-A - - ( ), . , . , , ( ), - (, ).

+3

All Articles