« Return to Thread: a standard way to enhance the GDK using Java code using META-INF/services/groovy/groovyMethods files...

Re: a standard way to enhance the GDK using Java code using META-INF/services/groovy/groovyMethods files...

by Jochen Theodorou :: Rate this Message:

Reply to Author | View in Thread

Hi James,

long time no see ;)

James Strachan schrieb:
[...]
> I know I can do this with categories; but I really wanted to hard-bake
> in these extra methods with the actual library so its not really
> possible to not have these methods around. i.e. I'd like
> camel-groovy.jar being on the classpath to auto-register some groovy
> methods for working with Camel in a groovy way.

The problem we haven't solved with this yet, is the scope of this
ability. If you use multiple DSL extensions then it might happen, that
you get them mixed up. Even with categories you get this problem, just
it is limited to one thread.

What I would like to have is to have an extension just in the scope of
the class, and I have plans for that in the next generation of
MetaClasses.. but that way would lack the automatic approach you would
like to have.

I would like to have at last a collision detection or error handling of
some kind.

> I took a quick peek at the grails stuff for adding extensions and
> didn't quite grok it but it looked like it was doing clever stuff
> doing pattern matching and whatnot - I guess for the find by methods
> for ORM etc. The methods I need to add are pretty simple and need to
> be typed (need multiple methods with same name but different
> parameters). I wondered what the current approach was in Groovy?

the same as when you left ;) Well.. unless you want to use
ExpandoMetaclass for this. Or MetaclassCreationHandle

bye blackdrag


--
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

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

    http://xircles.codehaus.org/manage_email

 « Return to Thread: a standard way to enhance the GDK using Java code using META-INF/services/groovy/groovyMethods files...