Interface Design
<< Introduction
Page 2: Function Oriented Classes
As a reminder, Function Oriented classes are those that expose functions such as actions or operations on their arguments. A lot of these classes are effectively utility classes - they expose HEAVY interfaces.
Utility classes are quite out of fashion in the design patterns community. These kind of interfaces are often viewed as facades for encapsulating large monolithic bundles of code.
Here is an example Function Oriented file handler implementation, called FileUtil:
public class FileUtil
{
public String getContent(File file) {...}
public void setContent(File file, String content) {}
}
Note : Static methods could have been used.
>> Next Page: Object Oriented Classes
<< Back to Design
<< Back to Software Reality
|