Re: Some questions about inheritance



Kallol Borah a écrit :
Tony
My take on your query is this :
a) Abstract classes do have method signatures that defines the
semantics of the actual implementation of the method by a sub-class.
They therefore specify a behavioral pattern, although, of course, that
pattern can be over ridden by the sub-class method implementation.
b) Different semantics - your second part of the question probably
refers to method overriding - the sub-class methods may override the
superclass semantics and implement those methods in a different way.

Delegation and Composition are two ways of extending behavior.
Delegation is most commonly seen in class inheritance where a subclass
extends a superclass or an abstract class
Composition refers to a class aggregating behavior, lets say, defined
by several interfaces or an interface composing/aggregating behavior
defined by other interfaces.

Hope this helps.

It doesn't. Either you are joking - and it's not fun - or you don't know zilch about OO. In both cases, please stop posting such non-sense.


.



Relevant Pages

  • Re: Some questions about inheritance
    ... Abstract classes do have method signatures that defines the ... semantics of the actual implementation of the method by a sub-class. ... Delegation and Composition are two ways of extending behavior. ... by several interfaces or an interface composing/aggregating behavior ...
    (comp.object)
  • Re: Some questions about inheritance
    ... Abstract classes do have method signatures that defines the ... semantics of the actual implementation of the method by a sub-class. ... Delegation and Composition are two ways of extending behavior. ... by several interfaces or an interface composing/aggregating behavior ...
    (comp.object)
  • Re: No Equals on interfaces
    ... >> The OP's sample IMO didn't make sense. ... for interfaces which is definitely not true and thus misleading. ... semantics put on them in general .NET terminology. ... There is nothing implicit for events in VB. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Generics Question
    ... I think I understand what you've misunderstood. ... interfaces to do the same semantic thing ("maintain a list of stuff" so ... The thing is, the feature that generics brings to the table, isn't this ... it's rather that it enables such semantics *in* ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Not enough parallelism in programming
    ... has well-defined parallel semantics iff obj1 and obj2 do not overlap in some invisible way. ... If the only constructs you have to work with are the input-output behavior of each object, then you are severely restricted in the useful contracts you can express regarding their composition, e.g. given initial state I, and interpreting aand bas mappings from one state to another, you get to define final state F for acomposed with bas: ... While it's true that the module should not expose unnecessary implementation details, it should be able to expose or declare contracts other than Input to Output, and formal specification languages have been based on such contracts for a long time. ...
    (comp.arch)