Chapter 1. From Objects to Components

Well-written Java programs are both object-oriented and component-oriented. This chapter characterizes the differences between object and component perspectives, and then it demonstrates these differences by taking a program design that is object-oriented and modifying it to be component-oriented as well.

Consider an example problem domain of contact management systems. One important facet of this domain is the ability to find contacts based on a variety of different criteria. Listing 1-1 shows a partial listing for the Contact and FindContact interfaces.

Listing 1-1. Contact and FindContact Interfaces
 package contacts; public interface Contact { public String getLastName(); public void setLastName(String ...

Get Component Development for the Java™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.