Re: Definitions

From: rackri (rackri_at_yahoo.it)
Date: 10/22/03

  • Next message: Michael C. Ferguson: "Re: Naive, possibly silly question"
    Date: 22 Oct 2003 00:17:49 -0700
    
    

    Thanks a lot, Elliott.
    In many articles (e.g. those explaining the inheritance vs composition
    tradeoff) I found those concepts which were very difficult to
    grasp for a newbie like me. Thanks!
    -- Roberto

    "Universe" <universe@covad.net> wrote in message news:<9802$3f956719$3f47e403$23433@msgid.meganewsservers.com>...
    > "rackri" <rackri@yahoo.it> wrote in message
    > news:7a2f224b.0310190050.39f26b50@posting.google.com...
    > > Hi all,
    > >
    > > can you please help me to understand these concepts:
    > >
    > > - delegation
    >
    > Class A requests Class B to perform an operation that is integral to the
    > key use case responsibility of Class A.
    >
    > The request from Class A to Class B is not just any operation but an
    > operation that is essential to 'is-a' nature/character of Class A.
    >
    > The reason the operation is essential to Class A is because delegation
    > in OO is identified with being a mechanism used *in lieu* of
    > *inheritance*.
    >
    > Studies show that in general inheritance is more efficient regarding
    > space and time. However there are other pro and con contexts where many
    > find that delegation is preferable to inheritance.
    >
    > Finally, delegation implies a "part/whole" relationship between Class A
    > and Class B, where Class B is perceived to be a "part" of the whole
    > essential role responsibility of Class A. The particular form of
    > "part/whole" relationship between the 2 classes may vary.
    >
    > The relationship may be - "aggregate", "composition", "uses", simple
    > "association", or other. Context and design tradeoffs determine which
    > kind of "part/whole" relationship between Class A and Class B is optimal
    > in any given circumstance, or set of circumstances.
    >
    > [This is 1 reason it would be a travesty, or is a travesty, for UML
    > authors to "give up" on defining, including, and distinguishing amongst
    > "aggregation", "composition", and "uses" as significant notational
    > elements of UML.]
    >
    > > - forwarding
    >
    > Forwarding is the passing along of data or activation signal(s) from one
    > class to another.
    >
    > Forwarding is what Class A does when "sending", "invoking", "dispatching
    > to" Class B. However Forwarding is not limited to Delegation.
    > Forwarding may occur with Delegation or some other relationship between
    > the sending and receiving classes.
    >
    > > - indirection
    >
    > "Indirection" is when Class A invokes, dispatches to a method on Class B
    > by using the address of the method rather than directly by the name of
    > the method. "Indirection" is also what happens when Class A sends data
    > to Class B using the address of the data as opposed to directly
    > referring to the value of the data.
    >
    > In all of this Class A is operating by calling methods or passing data
    > by "reference" versus directly "by value". C/C++?Pascal/VB pointers are
    > frequently used and notable a mechanisms used by one code module to make
    > a method call, or send data "by reference", that is by "Indirection".
    >
    > > - redirection
    >
    > "Redirection" is possible with "Indirection". Class A may think it is
    > sending data to Class B or calling a method on Class B, but Class C, or
    > other process inserts the address of some other module. So that the
    > call or send by Class A has been "Redirected", via "Indirection".
    >
    > Elliott
    > --
    > *~* Theory Leads, Practice Verifies *~*
    > *~* Global Plans + IID (Iterative & Incremental Development) *~*


  • Next message: Michael C. Ferguson: "Re: Naive, possibly silly question"

    Relevant Pages

    • Re: Why is OO Popular?
      ... > GOF book that Composition should be preferred to Inheritance. ... effect *delegation* by containing the classes (instead of a class ... or act of using a related set of delegated classes is ... OO software rests upon class abstractions expressed in class method ...
      (comp.object)
    • Re: Why is OO Popular?
      ... > GOF book that Composition should be preferred to Inheritance. ... effect *delegation* by containing the classes (instead of a class ... or act of using a related set of delegated classes is ... OO software rests upon class abstractions expressed in class method ...
      (comp.object)
    • Delegation vs. Duck Typing (was Re: The Case for Multiple-Inheritance)
      ... Delegation does not mean duck typing. ... Delegation is a form of composition, like inheritance. ... We want to allow enqueueing and dequeuing items and peeking at the top item, but we don't want users accessing items in the middle of the Queue. ...
      (comp.lang.ruby)
    • Re: delegation vs. inheritance
      ... In a statically typed language, like C++, public inheritance does double ... IMHO, despite the inevitable delegation ... because of the double duty issue I mentioned above. ...
      (comp.object)
    • Re: delegation vs. inheritance
      ... most of the time multiple inheritance is no problem and different ... While inheritance and delegation are often used together, such as in most of the GoF Design patterns, they are quite different things. ... Inheritance is simply a set of rules for determining what properties a particular member of the root class actually has. ... OO subclassing and inheritance are defined in a manner that also allows polymorphic access of the /common/ properties. ...
      (comp.object)