Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)



On 2006-05-31 08:10:16 -0500, frebe73@xxxxxxxxx said:

But there are many (enterprise) applications there OOAD is not
suitable. Some OO languages (such as java) has disadvantages because
they don't allow first-order functions and function pointers.

If by "First order functions" you mean "blocks" or "Closures" then I'll happily agree with you. Anonymous inner classes are a poor substitute. If, on the other hand, you are just referring to regular global functions, then you are incorrect. One can very simple create them in Java by making them a static method of a class named Global.

As for function pointers, that's what OO is really all about. OO is a formalism that gives you function pointer capability without the "danger". Anything you can do with a function pointer in C, I can do with polymorphism in Java.

--
Robert C. Martin (Uncle Bob)  | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |



.



Relevant Pages

  • Re: Function pointers (callbacks) in Java
    ... >> I have legacy code in C that I am porting to java. ... >> this - but I do not know how to store function pointers in a hashtable). ... the Method class to simulate Delegates. ...
    (comp.lang.java.programmer)
  • Re: JNI Invocation interface
    ... There are only three ways to call from Java to C++ via JNI. ... indexes into that array to Java instead of casting function pointers to ints. ...
    (comp.lang.java.programmer)
  • Re: Function pointers (callbacks) in Java
    ... the closest you can 'functionally' get to C-like function pointers in ... Java is using an array of indexed command objects that all implement from an ... function pointers, but in reallity Java was deviced by design, among may ...
    (comp.lang.java.programmer)
  • Re: Function pointers (callbacks) in Java
    ... >> I have legacy code in C that I am porting to java. ... >> this - but I do not know how to store function pointers in a hashtable). ... Yes - but that violates the principle of not using Java's reflection, ...
    (comp.lang.java.programmer)