Oh, then ComponentClassEnhancementWorker is almost certainly the way to go.

What if the Cal methods were on an interface that had no implementation.

And instance of the interface could be injected into a field of the
component.

The component would have access to the Cal methods via the field.

The worker could provide the bridge to Cal in the form of an implementation
of that interface, using either JDK dynamic proxies or Javassist (to create
a class implementing the interface at runtime).

The trick, of course, is for the worker to adapt to whatever interface you
provide (including the annotations on the interface).

Separation of concerns, and easy to test (because you can mock up the Cal
interface using EasyMock).

On 9/13/07, Tom Davies <[EMAIL PROTECTED]> wrote:
>
>
> On 13/09/2007, at 9:09 AM, Howard Lewis Ship wrote:
>
> > I don't know much about CAL ... could this kind of thing be
> > accomplished by
> > extending the ComponentClassEnhancementWorker chain of command? Or
> > is CAL
> > based on the raw Javassist APIs?
> >
>
> Hi Howard,
>
> I hadn't seen that class. It *almost* allows me to do what I want --
> ideally I'd like to be able to use abstract methods, to avoid the
> need for a dummy body, but I can't get to CtClass.setModifiers() to
> make the class concrete...
>
> (OT: CAL doesn't use Javassist -- it's just my way of hooking Java
> functions to CAL ones)
>
> Thanks,
>    Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind

Reply via email to