[Bese-devel] defcomponent

marco mb at bese.it
Fri Sep 24 08:03:20 UTC 2004


currently i have two issues with the defcomponent macro:

1) it defines a shared-initialize :after method which does Important
   Stuff (TM) so you (the developer) can't define your own.

2) it implements a convient render-on method for templates which you
   can't (bar cut 'n paste) re-use.

So i'd like to make defcomponent a bit less opaque. My solution to #1
would be to make that code into an initialize-component method which
would be called by call-component, goto-component and
replace-component. what's currently done in that shared-initialize
:after method really should only be done when the component is call'd,
and this change would allow you to create component objects outside of
the rerl (which you currently can't do due to the dependency on
*context* having a "real" value). #2 could be delt with by simply
maving the code generated by defcomponent into a method (or macro)
which developers could then call directly (and it would provide a
place to hang some documentation off of (which is always a Good Smell
(TM))).

the other option would be to do this via the MOP. which my be cool (at
least i thought it wolud be kind of cool at first) appears (after
trying to actually implement it) be to more complex and opaque than
what i'd like it to replace.

anybody have an opinion they want to share?

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
     -Leonard Cohen




More information about the bese-devel mailing list