Method Properties in Java

Dirk Riehle · 2000

As Java developers, we talk a lot about methods of classes and interfaces. We talk about types of methods like getters and setters, command methods, and factory methods. Next to classifying methods by purpose, we also talk about properties of methods like being a primitive or composed method, a hook or template method, a class or instance method, or a convenience method. Obviously, we have a large vocabulary for talking about method types and method properties. We use this vocabulary to communicate and document different aspects of a method, for example, what it is good for, who may use it, and how it is implemented. Understanding this vocabulary is a key to fast and effective communication among developers. This article presents seven key method properties that we use in our daily design and programming work. It illustrates them using a running example and catalogs them for use as part of a shared vocabulary. Some of the method properties have their own naming convention. Mastering this vocabulary helps us better implement our methods, better document our classes and interfaces, and communicate more effectively. 1 Method types and method properties We first need to distinguish between method types and method properties. A method type captures the primary

Read the paper · More papers on PaperTik