Original Post
Hello java wizards ;) I have a design question... As far as I know, hava does not have something like Function type, or equivalent of C++ pointer to (member) functions, which is kind of... ehmm pity. Well, what I need to do, is to have a java client receive some numbers through socket, let's say something like {2, 15, 4, ...}, where 2 indicate a class type (or interface), 15 means id of some conctrete object of that type, and 4 means some member function of that type or interface, ... are prameters to that member function. So that I can invoke a member function for some instance of class remotely, and the fastest way possible. Using Linj (Lisp In Java) I can have Linj translate this : (funcall (lambda (x y) (set-location x y)) 10 20) into something like this : new Procedure2() { public void funcall(Object x, Object y) { setLocation(((Number)x).doubleValue(), ((Number)y).doubleValue());}}. funcall(Bignum.valueOf(10), Bignum.valueOf(20)); which looks quite arcane, even without retyping to some specific class. Is there a better way to do it? How can I avoid hardwiring of retyping to specific class or interface in source? Thanks for some ideas !! skoco