[Newbies] Design best practice : put state-independent methods on class side?

2008-03-25 Thread itsme213
I have some methods that currently refer to iVars, called from other methods of the same class. I need similar functionality in other classes, not related by inheritance, and want to keep it DRY. If I move the iVar references into explicit method args they can be easily re-located and shared.

Re: [Newbies] Design best practice : put state-independent methods on class side?

2008-03-25 Thread Marcin Tustin
What's wrong with keeping them instance-side? On Tue, Mar 25, 2008 at 5:41 PM, itsme213 [EMAIL PROTECTED] wrote: I have some methods that currently refer to iVars, called from other methods of the same class. I need similar functionality in other classes, not related by inheritance, and want

Re: [Newbies] Design best practice : put state-independent methods on class side?

2008-03-25 Thread David Mitchell
I'm guessing you like that the class methods can be invoked easily from the class name. What you want is a well known object. I try to do all my work on the instance side. That's where most of the objects are. I wouldn't use a class object just to create a well known object. I'd probably start