[squeak-dev] The Inbox: MonticelloConfigurations-cmm.116.mcz

Frank Shearar frank.shearar at gmail.com
Wed Oct 9 06:37:57 UTC 2013


On 8 October 2013 18:35, David T. Lewis <lewis at mail.msen.com> wrote:
> On Tue, Oct 08, 2013 at 06:20:48PM +0100, Frank Shearar wrote:
>> On 8 October 2013 17:17,  <commits at source.squeak.org> wrote:
>> > A new version of MonticelloConfigurations was added to project The Inbox:
>> > http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz
>> >
>> > ==================== Summary ====================
>> >
>> > Name: MonticelloConfigurations-cmm.116
>> > Author: cmm
>> > Time: 8 October 2013, 11:17:41.275 am
>> > UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd
>> > Ancestors: MonticelloConfigurations-bf.115
>> >
>> > Persist MCConfiguration's 'name'.
>> >
>> > =============== Diff against MonticelloConfigurations-bf.115 ===============
>> >
>> > Item was changed:
>> >   ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') -----
>> >   fromArray: anArray
>> >         | configuration |
>> >         configuration := self new.
>> >         anArray pairsDo: [:key :value |
>> >                 key = #repository
>> >                         ifTrue: [configuration repositories add: (self repositoryFromArray: value)].
>> >                 key = #dependency
>> >                         ifTrue: [configuration dependencies add: (self dependencyFromArray: value)].
>> > +               key = #name
>> > +                       ifTrue: [configuration name: value].
>>
>> This looks like a good candidate for a #caseOf:.
>>
>
> Woohoo! It's the official start of our annual "caseOf is not object-oriented"
> flame war! Let the festivities begin :-)

It was just a spark! Of course, I've been tainted by pattern matching,
so #caseOf: seems perfectly sensible to me... in situations like this.
You're switching off some chunk of data rather than a class. I guess
the Enterprise Ready OO Army  would say that these concepts like
#names and #dependency should be made Proper Objects. And maybe
they're right. But sometimes the effort involved is just not worth it.

See? _That's_ how you start the flames :) Blow, blow!

frank

> Dave


More information about the Squeak-dev mailing list