[rspec-users] WDYT, simple, anonymous story listeners?
Joseph Wilk
lists at ruby-forum.com
Wed Aug 13 05:26:09 EDT 2008
It looks like a nice shortcut for those times when you are registering
simple one-off listeners.
While it does provide a nice shortcut I can see reasons why that
shortcut might be bad(in some cases).
Separating registering and implementation can be a good thing.
*Split the logic.
*Organise files/classes nicely
*Enable inheritance from the listeners
If it was anything that I had to maintain or touch regularly I would be
happier with a class.
Can/Could you support mixins inside FunctionalStruct? That would help
overcome some of those points.
I can think of a couple of places that I would be happy using
FunctionalStruct. Is the source for 'FunctionalStruct'
written/available?
--
Joseph Wilk
http://www.joesniff.co.uk
Mark Wilden wrote:
> On Tue, Aug 12, 2008 at 9:54 PM, Zach Dennis <zach.dennis at gmail.com>
> wrote:
>
>
>> There is nothing wrong with this, but there are times when it feels
>> dirty and unnecessary to create yet another class with some methods
>
>
> The proposed solution looks very nice, but I've never been convinced by
> the
> "yet another class" argument. It's not like you're only allowed a
> certain
> number.
>
> That hasn't always been the case, however. When I worked at Sierra
> On-Line
> in the early '90s, I broke the compiler of our proprietary OOP language
> because I exceeded its maximum class count. Those were the days...:)
>
> ///ark
--
Posted via http://www.ruby-forum.com/.
More information about the rspec-users
mailing list