Origin: |
Grand 98 |
Reason: |
A class needs to be independent of services provided by another class. |
Synopsis: |
Abstract a class C by writing an interface IF.
Clients access class C through interface IF.
|
Example: |
A business application uses an Address class in a variety
of objects, e.g., Vendors, Clients,
Freight companies, etc.
To make these objects less dependent of the details
of the Address class, the objects should rather use
an interface, AddressIF.
|
Solution: |
Service |
A class that provides data and/or methods to the Client. |
Address |
Client |
A class that uses the services of class Service. |
Vendor, Client, etc. |
ServiceIF |
Interface of class Service. |
AddressIF |
|
See also: |
|