Re: Java "interface" vs. OO interface
From: Joe \ (joe_at_bftsi0.UUCP)
Date: 11/22/03
- Next message: Phlip: "Re: XP Question about Metaphor"
- Previous message: Tsolak Petrosian: "Re: SproutMethod.pdf"
- In reply to: Dave Harris: "Re: Java "interface" vs. OO interface"
- Next in thread: Dave Harris: "Re: Java "interface" vs. OO interface"
- Reply: Dave Harris: "Re: Java "interface" vs. OO interface"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 22 Nov 2003 13:05:21 -0800
"Dave Harris" <brangdon@cix.co.uk> wrote in message <news:memo.20031122193107.1792A@brangdon.m>...
> tgm2tothe10thpower@hotmail.replaceTextWithNumber.com (Thomas G. Marshall)
> wrote (abridged):
> > > Indeed, to qualify access is arguably to break encapsulation;
> >
> > You have the cart utterly before the horse. Encapsulation is what
> > requires you to use qualified access. Not "to qualify access
> > is arguably to break encapsulation." That is simply false.
>
> Why?
>
> The encapsulation idea is that a derived class should be insulated from
> its ancestor classes; all except its immediate parent. Using qualified
> names is a way of reaching past its immediate parent to its parent's
> parent. If the class hierarchy is changed so that a constant is now taken
> from a different class, the derived class must change.
>
> I suspect your problem is as others have suggested: a lack of good tools
> to tell you which ancestor class a name comes from.
If a class has a parent(s) and/or implements interfaces, perhaps
inherited names should be qualified with the name of the parent
or interface. A name from (say) parent X could collide with one
from interface Y, and you'll need some way to disambiguate. No
reaching past the immediate parent(s) though, otherwise avoiding
the Fragile Base Class problem would become much more difficult.
-- Joe Foster <mailto:jlfoster%40znet.com> On the cans? <http://www.xenu.net/> WARNING: I cannot be held responsible for the above They're coming to because my cats have apparently learned to type. take me away, ha ha!
- Next message: Phlip: "Re: XP Question about Metaphor"
- Previous message: Tsolak Petrosian: "Re: SproutMethod.pdf"
- In reply to: Dave Harris: "Re: Java "interface" vs. OO interface"
- Next in thread: Dave Harris: "Re: Java "interface" vs. OO interface"
- Reply: Dave Harris: "Re: Java "interface" vs. OO interface"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|