On 10/22/07, MenTaLguY <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
> Last night I took a stab at implementing BasicObject; rewiring the
> class bootstrap to include BasicObject took me about five minutes,
> but I got stuck on how the method definitions themselves should be
> handled.  As far as I can tell, there are two options:
>
> 1. separate RubyObject into RubyBasicObject and RubyObject


I think this would be cleaner, but see note below.

2. use RubyObject for both Object and BasicObject, but use
>     separate metaclasses to get different method subsets on
>     each
>
> The first has the potential to be extremely intrusive, and I'm not
> entirely sure I can do it cleanly.  I think the second option is a
> much better approach, but it's not evident to me how to do it with
> annotations (which I don't think we want to abandon).


Right now, RubyModule#defineAnnotatedMethods(Class clazz) will add all
annotated methods for clazz to the metaclass.  I suppose JRubyMethod could
be tweaked to take a metaclass parameter, but I think that gets kind of
ugly.

But I would say do whatever takes the least effort right now, as this code
will be refactored post-1.1 (2.0?) anyway, with one goal (IMO) being
decoupling metaclass definition from data representation, especially around
RubyObject.

My two cents...

-Bill

Reply via email to