Quantcast
Channel: InfoWorld Design Techniques
Viewing all articles
Browse latest Browse all 45

Design with runtime class information

$
0
0

One of the cool things about Java's object model is that Java objects are "conscious": given a reference to an object, you can get information about that object's class. This "runtime class information" makes possible all kinds of interesting designs and implementation techniques. But how are we to use this capability?

When I think about Java's support for runtime class information, two clichés come to my mind:

1. Information is power.

In our case, runtime class information gives power to the programmer because he or she has more information to work with. This is a good thing.

2. Power corrupts.

Alas, in our case, runtime class information can be abused in designs.

To read this article in full or to leave a comment, please click here


Viewing all articles
Browse latest Browse all 45

Latest Images

Trending Articles





Latest Images