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

Designing with interfaces

$
0
0

One of the fundamental activities of any software system design is defining the interfaces between the components of the system. Because Java's interface construct allows you to define an abstract interface without specifying any implementation, a major activity of any Java program design is "figuring out what the interfaces are." This article looks at the motivation behind the Java interface and gives guidelines on how to make the most of this important part of Java.

Deciphering the interface

Almost two years ago, I wrote a chapter on the Java interface and asked a few friends who know C++ to review it. In this chapter, which is now part of my Java course reader Inner Java (see Resources), I presented interfaces primarily as a special kind of multiple inheritance: multiple inheritance of interface (the object-oriented concept) without multiple inheritance of implementation. One reviewer told me that, although she understood the mechanics of the Java interface after reading my chapter, she didn't really "get the point" of them. Exactly how, she asked me, were Java's interfaces an improvement over C++'s multiple inheritance mechanism? At the time I wasn't able to answer her question to her satisfaction, primarily because in those days I hadn't quite gotten the point of interfaces myself.

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