logo       

Re: Sibling rivalry and class variables: msg#01193

lang.ruby.general

Subject: Re: Sibling rivalry and class variables


On Tue, 13 Aug 2002, Kent Dahl wrote:

> I take it you mean that the overriding change should only propagate
> downwards, as if you had defined the class variable at that particual
> subclass?
> - Use instance methods. Instance methods are made for overriding, class
> variables not so.
> - Use real class instance variables instead of class variables. (Might
> be hard to do if you still want to propagate the variables downwards,
> since a subclass is a totally different object.)
>
> But it really depends alot on what you want to be able to do with the
> variable.
>
> --
> (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~
> ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year )
> ( \__\_õ|õ_/__/ ) _)Industrial economics and technological management(
> \____/_ö_\____/ (____engineering.discipline_=_Computer::Technology___)
>

-- Nikodemus
------------------------------------------------------------
I refuse to have a battle of wits with an unarmed person.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise