Groovy and java inheritance

The meek may inherit the earth, but Java can inherit Groovy. Yes, Groovy can not only extend a base Java class, but once done, Java can do exactly the same with that derived groovy class. Thanks Bob for you input, and I see no point in doing anything but quoting you directly :-)

W.r.t your example: all the other ‘pretenders’ (JRuby, Jython, etc) can do
something similar, none of them can then further extend the GUsesJ class
with another Java class (ie J -> G -> J -> J -> G -> J, etc.)

yes, did I make this point before, it can all be compiled to bytecodes and so are equal within the JVM.

This leads me to the recent announcement by the Mono Project (cross platform .NET) about their Version 2.0 release. I used Mono a few years back to allow a new Java Windows server product to have a fast result on a fax delivery end point for scanned images (using faxcomlib). C# made accessing the operating system a doddle, plus the C#/.NET high level abstraction meant that a complex task was reduced to a days coding. It took as long to suggest the technology and get a Java shop to accept that results would be fast, and that this was far better than third party solution licences eroding profits. If you are a vendor, you want to sell your own product, not that of others (unless you have an advantageous deal of course). My thoughts – there is no need for a purists viewpoint like “Java only”. Products sell because they are good, not because of what they are implemented in!

A little research reveals that the IKVM.NET, an implementation of Java (VM) for Mono and the Microsoft .NET Framework, is now far more advanced. It would seem Groovy happily runs on .NET 2.0. Here’s a howto.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s