[Borges-users] refactoring
Слепнев Владимир
slepnev_v at rambler.ru
Sun May 2 11:56:02 EDT 2004
>You seem to get bugged by the 'class << self' thing all over the place.
>Do you know about this http://www.rubygarden.org/ruby?ClassMethods discussion ?
Why not just create regular class methods (def self.foo...end) when we
need them? Why use those singleton hacks? This may sometimes be needed
if we want subclasses to behave in a certain way - but it doesn't
really apply to Borges, and to me this kind of thing is a "code smell"
anyway.
>About confirm and inform:
>I think they should remain, they are a clever shortcut that sometimes
>really is useful. And with the proper kind of framing, they are even
>useful in production, given the possibilities of css.
I sort of agree here... but the nasty thing is that a "core" Borges
class (Controller) is dependent on a "library" class that gets called
on inform or confirm. This is bad: the core should be as compact as
possible. I don't really know what to do about this, yet.
>About properties:
>It is correct that changes to the good stuff (start class, session
>class, debug toolbar) won't get applied right now and are thus of no
>use. I can see why you want to get rid of this code.
>
>I think however that it would be tremendously useful to look into
>dynamic code loading and be able to load something like tomcat's WAR
>archives at run time. And then unload them again. And reload them.
>I have some ideas there and will be looking into properties at the
>same time. But we'll probably end up with another properties system.
I think preferences are more about tuning a live application: a sort
of limited shortcut if the app developer doesn't want to write his own
configuring controller. The bad thing here is that the app developer
is forced to use preferences (e.g. to wrap up session expiry time),
even when he doesn't need the live-tuning. ListPreference is
especially ugly; but I dislike wrapper classes in general, and I'm
sure we can do without them in Ruby - if we think hard enough.
Vladimir Slepnev
More information about the Borges-users
mailing list