David Shaffer wrote:
William E Harford wrote:
That was my first idea but the idea of changing the base Seaside classes
turned me off. I think changing the seaside code base for a custom site
specific purpose is bad practice.
Adding a method is usually as robust as subclassing but, as I mentioned,
if you don't like it you can always get around it by not using the
visitor pattern. Just write your own editor method inside your
attribute class.
Adding a method is indeed perfectly acceptable in many cases in
Smalltalk, William. Particularly if you are using Monticello (or more
specifically PackageInfo I suppose, but whatever) as you can include the
method within your package even though it's on another class. In many
cases, adding a method is the cleanest and simplest design decision.
Not that I'm saying you should necessarily do so in this case, but your
code snippet seemed a bit C-like, so I though perhaps you were new to
Smalltalk (forgive me if I'm wrong :) ).
Plus I also think it will be easier and clearer to do it by writing my
own configuration class and not modifying the Seaside code.
Agreed if you figure it out. It isn't clear to me that the
configuration framework supports changing the attribute list although I
don't see directly why you couldn't. I just didn't think about that
possibility so certainly that seems like a reasonable thing to try.
I think the config stuff should be fine with the attribute list changing
(I certainly can't think of any reason why it wouldn't work off the top
of my head). But, I also recall thinking that we should be able to
easily support custom editors for config options. As I keep saying,
none of this is fresh enough in my mind though... if it doesn't seem
easy, I suspect I never quite got to that part when I was implementing
it last year. Avi's been mumbling about simplifying the configuration
stuff a bit anyway, so how about I promise to dig back into this stuff
next week (I'm going hiking this weekend). That way I can hopefully
better answer your questions and I can properly debate the issue with
Avi. :)
Thanks for your suggestion.
No problem. Keep us posted on what you learn!
Indeed... the configuration stuff is not very broadly used yet so we're
keen for any feedback on how it needs improving.
Julian
--
Julian Fitzell -- Beta4 Productions
julian@xxxxxxxxx -- http://www.beta4.com
Seaside: http://seaside.st/
|