Page 1 of 1

static method

Posted: Fri Aug 07, 2009 1:08 pm
by ConvertFromOldNGs
by Didier >> Tue, 31 Jul 2007 5:00:21 GMT

Hi:
As we know,
JAVA provide static method ,
so we can invoke the method by class and not by object( instance of class ).

This mechanism is very useful for polymorphism when create a new object of the class.

I want to know whether JADE has the same conception( static method ) as JAVA ?

If JADE has the "static method" , how to implement ?
If JADE does not have, it's possible to enhancement this concept in future ?

Didier
2007.7.31

Re: static method

Posted: Fri Aug 07, 2009 1:08 pm
by ConvertFromOldNGs
by dcooper@jade.co.nz >> Tue, 31 Jul 2007 9:45:40 GMT

No - JADE currently does not have static (aka class) methods. However, similar functionality can easily be achieved using patterns like Factory, Singleton and Prototype. JADE also gives you several natural singleton objects (eg: app, global, currentSession) through which you can easily access implementors of these patterns. That said, we do appreciate that static/class methods provide convenient syntax and they have been a candidate feature for recent JADE releases. But we've found that they're not a commonly-requested feature and ultimately other enhancements have taken priority. We're certainly not closed to the idea of static methods though.

Dean.