Java Reference
In-Depth Information
9.1.2. API version 2
After your library has been in use for a few months, you receive many requests to update your
implementations of Resizable: Square, Rectangle, and so on to support the setRelativeSize
method. So you come up with version 2 of your API, as shown here and illustrated in figure 9.2 :
Figure 9.2. Evolving an API by adding a method to Resizable .
Recompiling the application produces errors because it depends on
the Resizable interface.
Problems for your users
This update of Resizable creates a few problems. First, the interface now requires an
implementation of setRelativeSize. But the Ellipse implementation your user created doesn't
 
Search WWH ::




Custom Search