2009/11/1 Igor Stasenko <[email protected]>:
> 2009/11/1 Lukas Renggli <[email protected]>:
>>> But if it so stripped to bare-bones, then where the benefits to use
>>> exactly Announcements?
>>
>> I would rather like to hear what this "more wide functionality" is all about?
>>
>
> i don't know. I just not buying 'use this' because its good. I need to
> know why its so good :)
> As far as i can see, it is as good as any other observer pattern 
> implementation.
> But alone, this pattern is nothing, so we should analyze, how well it
> fits for use in different scenarios.
> And so, what if such implementation doesn't play well with all
> scenarios, would you still insist
> to use Announcements instead of making own, given that cost of
> implementation is quite small (10 or even less methods)?
>
>> So far you only argued that big is better. I don't buy that.
>>
> In contrary. An annoucements implies to use separate (sub)classes for
> different event kinds.
> While i can simply use field in the event to identify its kind.
> Lets say you having 50 event kinds. So what is bigger - single class + 1 
> field,
> or 50 classes? Or we not counting classes as a code?
>
> So, as you can see, announcements, in some cases could lead to
> 'bigger' code bloat.
> And i would like to know, why it is still good to use them, despite
> the costs of such potential bloat.
>

Just a bit more arguing. :)
Suppose i bought the idea, and created a 50 subclasses. They form some
kind of tree (such as AbstractEvent subclasses).

So far so good. But now i want some of those event kinds to be logged,
while some of them are not.
What annoucements framework could propose for this scenario?
Okay, i can create a new announcement subclass:

Announcement subclass: #LoggedAnnouncement
...

so then any , who would like to subcscibe to logged announcement could
simply do something like:

annoucer on: LoggedAnnouncement do: [:ann | Transcript show: ann message ].

But how i suppose to wire it up with the tree above?
Obviously i can't. Because if i make all of the tree to be a subclass
of LoggedAnnouncement, then all of them
will be logged, while i want only some of them.

>> This is old, but "Small is the new big" ;-)
>>
>> A smaller infrastructure also means:
>>
>> - easier to learn
>> - less code that rots
>> - less code to maintain
>> - less code duplication
>> - less code to test
>> - loose coupling
>> - smaller image
>>
> yes, good software is one where nothing left to remove, instead
> nothing left to add.
>
>
>> Cheers,
>> Lukas
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to