Java MultiMethod Framework | ||||||||||||||||
Goal | Informations | |||||||||||||||
In Java, method resolution is performed at runtime, by late binding, with
respect to the dynamic type of the target object.
Some object-oriented langages such as CLOS propose, in addition,
late-binding according to dynamic types of all arguments.
This feature is know as multi-polymorphism and usally achived by
multi-methods.
|
|
|||||||||||||||
Architecture | ||||||||||||||||
The Java MultiMethod Framework is based on three sub-packages :
|
||||||||||||||||
Examples | ||||||||||||||||
The example below explicit a simple use of the class MultiMethod. import fr.umlv.jmmf.reflect.*; public class Example { static public String toString(Integer i) { return Integer.toHexString(i.intValue()); } static public String toString(Object o) { return o.toString(); } public static void main(String[] args) throws Throwable { MultiMethod mm=MultiMethod.create(Example.class,"toString",1); Object o1="hello multi-method"; Object o2=new Integer(3); System.out.println(mm.invoke(null,new Object[]{o1})); System.out.println(mm.invoke(null,new Object[]{o2})); } } Others examples can be found here !. |
||||||||||||||||
Documentation | ||||||||||||||||
The documentation of the latest version in available online. |
||||||||||||||||
Download | ||||||||||||||||
The latest JMMF version is v0.8.10, documentation and jar file are available separately :
PS: a vicious bug in netscape 4.7 can't permit to download '.jar' file. To workaround this bug the jar file (jmmf.jar) that contains all classes is renamed to jmmf.zip. Sources are availables at : http://sourceforge.net/projects/jmmf |
||||||||||||||||
Papers & Slides | ||||||||||||||||
Because the JMMF package is a part of my PhD Thesis, The following entries are some research papers and slides.
|
||||||||||||||||
Rémi Forax 2001 Université de Marne la Vallée |