[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-dev
Subject:    Re: [groovy-dev] Metaclasses
From:       "Graeme Rocher" <graeme () g2one ! com>
Date:       2008-05-29 9:56:22
Message-ID: 3f2c19a70805290256yb4ae6lf144bed808d355d4 () mail ! gmail ! com
[Download RAW message or body]

On Thu, May 29, 2008 at 10:51 AM, Russel Winder
<russel.winder@concertant.com> wrote:
> On Thu, 2008-05-29 at 10:30 +0100, Graeme Rocher wrote:
>> If you need to modify the behaviour of objects use ExpandoMetaClass it
>> is the only one not to break when internal refactorings occur. In
>> Grails we use it exclusively
>
> I think that was one of the reasons John gave for using
> DelegatingMetaClass -- it's the only one guaranteed not to break in the
> face of refactoring.  Hummm... :-)
>
> I don't actually need to add methods I just need to intercept in order
> to redirect certain methods, so it is very static behaviour I need.

If you need to intercept you can use methodMissing with EMC see

http://groovy.codehaus.org/Using+methodMissing+and+propertyMissing

Cheers

>
> My real problem is that I have no idea why a change of metaclass is
> causing SaxParser exceptions.
>
> --
> Russel.
> ====================================================
> Dr Russel Winder                 Partner
>
> Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
> 41 Buckmaster Road,              f: +44 8700 516 084
> London SW11 1EN, UK.             m: +44 7770 465 077
>



-- 
Graeme Rocher
Grails Project Lead
G2One, Inc. Chief Technology Officer
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic