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

The canonical object idiom

$
0
0

In last month's installment of Design Techniques, I proposed the "event generator" as a Java idiom. This month I will propose another idiom, which I am calling the "canonical object."

I call this object idiom "canonical" because it represents the simplest form an object should take. The idea behind this idiom is to suggest a baseline functionality that you give by default to any object you design. You may adopt this idiom in your own programming practice, or, if you are developing a set of style guidelines for a team or organization, you may want to make the idiom part of those guidelines. The intent of the idiom is not to force programmers to endow every object with this baseline functionality, but simply to define a default functionality for every object. In other words, programmers would be encouraged to make a new object canonical unless they have specific reasons to depart from the idiom in a given, specific case.

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