Re: [Zope-dev] Why is it _setObject(), and why is it undocumented
by Dieter Maurer other posts by this author
Feb 1 2003 8:28PM messages near this date
Re: [Zope-dev] Why is it _setObject(), and why is it undocumented
|
Re: [Zope-dev] Why is it _setObject(), and why is it undocumented
Lennart Regebro wrote at 2003-2-1 15:48 +0100:
> From: "Max M" <maxm@[...].dk>
> > Sorry but I don't see that. How on earth are you suposed to add an
> > object to an objectmanager, if you don't use _setObject() ??
>
> You use another method that in turn calls _setObject.
>
> Now you may argue that there should be a public method that does the same,
> but that is strictly another question.
>
> > Every time you make an object that subclasses ObjectManager, wich is
> > often, you need to use that function. That can hardly be called private.
>
> It depends on what you define as "private". I have never seen the use of
> shielding a method from future subclasses of a class. It only causes
> problems and unessecary restrictions. For me, private means that you shield
> it from use outside of the object, not from your subclasses.
Some more notes about "private".
"private" as used in Zope is not the "private used in C++ (or Java)".
In Python, "C++'s private" is emulated by names starting with "__"
(and not ending in "__"). Such attributes can not be
(easily) accessed by subclasses.
Zope's private means "cannot be used by TTW code".
Dieter
_______________________________________________
Zope-Dev maillist - Zope-Dev@[...].org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )
Thread:
maxm
Florent Guillaume
Florent Guillaume
Lennart Regebro
Dieter Maurer
Lennart Regebro
Max M
Leonardo Rochael Almeida
Dieter Maurer
maxm
Dieter Maurer
|