|
Re: Re: Design best practice : put state-independent methodsonclass side?: msg#00170lang.smalltalk.squeak.beginners
On Tue, Mar 25, 2008 at 5:51 PM, itsme213 <itsme213@xxxxxxxxxxx> wrote: > Is my specific usage style OK -- many instance methods from many classes > calling shared state-less methods from a common class? Or does it have some > kind of code smell? Any thought on whether traits (simply mixing them in on > the instance side) would be a preferred approach to this? > > Foo>>m1 > Library doX: iVar1 with: iVar2 > > Foo>>m2 > Library doZ: iVar2 > > Bar>>m3 > Library doX: iVar7 with: ivar8 > > Library class>>doX: anX with: aY > > Library class>>doZ: aZ My gut reaction is that you are missing an abstraction. I can't tell for sure, because you don't give enough details. Why don't you put this code in the class of the ivars? Maybe the ivars are integers or strings, and they should be a value object. Unless you explain more about the problem domain, there is no way for me to tell. -Ralph
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Design best practice : put state-independent methodsonclass side?, David Mitchell |
|---|---|
| Next by Date: | Re: Traits (Was Design best practice : put state-independentmethodsonclass side?), itsme213 |
| Previous by Thread: | Re: Design best practice : put state-independent methodsonclass side?, itsme213 |
| Next by Thread: | Traits (Was Design best practice : put state-independent methodsonclass side?), Rob Rothwell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |