H
Hung Jung Lu
Hi,
It's well-known that C++ has template classes, Java does not.
A few years ago there was a movement to incorporate Generic
Programming to Java. What happened?
What approaches are people using for Generic Programming? By Generic
Programming I mean the design of code that is applicable to any class.
For instance, at some point I'd like to do
y = x.a + x.b
without caring a priori what class x belongs to. In C++, you use
templates. In Java, I can think of using three ways of do generic
programming: (a) interfaces, (b) reflection, and (c) some indirect way
via usage of collection. But is there any other well-known approach in
Java for Generic Programming?
regards,
Hung Jung
It's well-known that C++ has template classes, Java does not.
A few years ago there was a movement to incorporate Generic
Programming to Java. What happened?
What approaches are people using for Generic Programming? By Generic
Programming I mean the design of code that is applicable to any class.
For instance, at some point I'd like to do
y = x.a + x.b
without caring a priori what class x belongs to. In C++, you use
templates. In Java, I can think of using three ways of do generic
programming: (a) interfaces, (b) reflection, and (c) some indirect way
via usage of collection. But is there any other well-known approach in
Java for Generic Programming?
regards,
Hung Jung