Loading ...
Sorry, an error occurred while loading the content.

Re: [eiffel_software] Re: Hiding implementation from heirs

Expand Messages
  • Thomas Beale
    ... if that is true, then you don t even want the current class to be able to do it, so it is not a question of inheritance semantics, but simply some kind of
    Message 1 of 48 , Jan 1, 2009
    • 0 Attachment
      Geir Ove Skjaervik wrote:
      >
      > Hello,
      > Thanks, but I am afraid I do not understand what you mean. Attribute
      > item_name_ is indeed accessible in all heirs (I tried it, and it
      > compiles).
      >
      > I do not want heirs to assign directly to it as long as there is a
      > set_item_name() for this purpose.
      >

      if that is true, then you don't even want the current class to be able
      to do it, so it is not a question of inheritance semantics, but simply
      some kind of protected status of a private attribute to be only settable
      by a single 'set' routine (which probably ensures some other work is
      done properly, not just the assignment). This capability doesn't exist
      in Eiffel, but I have often thought it would be useful.

      - thomas beale

      --
      Thomas Beale
      Chief Technology Officer, Ocean Informatics

      Chair Architectural Review Board, openEHR Foundation
      Honorary Research Fellow, University College London
    • Geir Ove Skjaervik
      Hello, Thanks a lot for the helpful pointers! I will take a look at this as soon as I get the time! Geir Ove ... presentations ... slide= ) ... with ... slide=
      Message 48 of 48 , Jan 4, 2009
      • 0 Attachment
        Hello,
        Thanks a lot for the helpful pointers! I will take a look at this as
        soon as I get the time!

        Geir Ove

        --- In eiffel_software@yahoogroups.com, "halwebre" <halwebre@...>
        wrote:
        >
        >
        > Hello Geir Ove,
        >
        > You may also be interested in two sections of the online
        presentations
        > on the eiffel.com website.
        >
        > First, slides 16 and 17 of "C# and Eiffel the Language" (at:
        > http://eiffel.com/developers/presentations/csharp/player.html?
        slide= )
        > attempt to contrast the C#/Java style of access to instance data
        with
        > Eiffel's style.
        >
        > Second, slides 13 - 17 of "Design by Contract -- Part 2" (at:
        > http://eiffel.com/developers/presentations/dbc/parttwo/player.html?
        slide=
        > ) address reuse through the two relationships (client/supplier and
        > inheritance) and try to explain the justification for allowing
        > descendants to access inherited features and the use of design by
        > contract to keep this safe.
        >
        > I hope these will be helpful.
        >
        > Best regards,
        >
        > Hal
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.