Monday, May 14, 2012

Way to simulate class categorization in Java

Some programming languages have the feature of adding "Categories" to classes (for example Objective-C), this means, adding new functionality to a class without subclassing.

I really find it useful, but I can't imagine a way of simulating this feature in Java.

So the question is:

How would look an elegant pattern to simulate class categories in Java? What I'm really looking for is achieving the same effect rather of making it the same way.

No comments:

Post a Comment