J
John Carter
Avoid inheriting from concrete classes, to add behaviour add non-member
functions, to add state use composition.
In ruby I would change this to..
To add behaviour, don't be shy, in Ruby you can always extend a concrete
class when you need to.
eg.
class String
def my_nifty_func
end
end
To add state, I agree with them, use composition. Why? Unless you cover
every use of String, you may have an operation somewhere that
accidentally loses that extra state.
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : (e-mail address removed)
New Zealand
Carter's Clarification of Murphy's Law.
"Things only ever go right so that they may go more spectacularly wrong later."
From this principle, all of life and physics may be deduced.
functions, to add state use composition.
In ruby I would change this to..
To add behaviour, don't be shy, in Ruby you can always extend a concrete
class when you need to.
eg.
class String
def my_nifty_func
end
end
To add state, I agree with them, use composition. Why? Unless you cover
every use of String, you may have an operation somewhere that
accidentally loses that extra state.
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : (e-mail address removed)
New Zealand
Carter's Clarification of Murphy's Law.
"Things only ever go right so that they may go more spectacularly wrong later."
From this principle, all of life and physics may be deduced.