What&#39;s wrong with keeping them instance-side?<br><br><div class="gmail_quote">On Tue, Mar 25, 2008 at 5:41 PM, itsme213 &lt;<a href="mailto:itsme213@hotmail.com">itsme213@hotmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have some methods that currently refer to iVars, called from other methods<br>
of the same class. I need similar functionality in other classes, not<br>
related by inheritance, and want to keep it DRY.<br>
<br>
If I move the iVar references into explicit method args they can be easily<br>
re-located and shared.<br>
<br>
Is it then good or bad practice to take a such collection of related<br>
state-independent methods (they don&#39;t depend on any iVar) and put them on<br>
the class-side of some suitable class?<br>
<br>
My options and concerns:<br>
- I could move them up the hierarchy on the instance side but sometimes hit<br>
single inheritance limits<br>
- I could use traits for these but am unclear about the future of traits in<br>
Squeak<br>
- I can put on the class side and call easily from instance-side methods,<br>
but is this OK practice?<br>
<br>
Thanks,<br>
<br>
Sophie<br>
<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>