Skip to content.

Manageability

Sections
Personal tools
You are here: Home » blog » archive » Higher Language Features in Java

Higher Language Features in Java

20030213070510

My last blog "Better Design Patterns Through Reflection", showed that many design patterns can be replaced by higher level programming contructs like reflection, closures, multi-dispatch and predicate types.  Knowing this fact, and knowing how these constructs are implemented in Java are an important skill to have in one's toolbox.  When you understand the motivation for a language construct, its much easier to know when to use a particular design pattern.  The Visitor pattern for example is just a subset of multiple dispatch, that is double dispatch.  Once you know this you don't get confused by the minutiae of the Visitor pattern, you begin to see the forest instead of the trees. (Speaking about the Visitor pattern, there are several different implementations in Java, each having their own pros and cons.  I'll possibly talk about that in a future blog.)

There are plenty of good examples of how to implement higher language features in Java.  For example, here's an excellent piece on how to implement Blocks in Java.  For multiple dispatch you can find some good ideas looking at MultiJava and Nice. For predicate types you can look at Pizza for some inspiration.

Created by admin
Last modified 2003-07-30 04:14 PM
 

Powered by Plone

This site conforms to the following standards: