We now have a Borrower class design, which shows the methods defined by the LibraryPatron class. We can now perform some more reverse engineering and retrieve a protocol from the class design. This can be valuable when modeling an existing system; it makes it possible to formally type the parameters and return values of a class and identify which common interfaces it supports. This can help you find methods that do not accept or return the correct types. For a given class, only some of its methods make up its public API, and these might be grouped into one or more protocols to which the class conforms. You can designate one protocol as its main protocol--the one defining the methods making up the primary function of the class.
You can retrieve protocols from any class, even one that is not attached to a class design. When you retrieve a protocol from a class, you can select which method categories are included. In the retrieved protocol, UML Designer will create a message specification for each method in the selected categories.
To retrieve a protocol from the methods of the LibraryPatron class, follow these steps:
In the Borrower class, the methods are not categorized, so select Not categorized.
When UML Designer retrieves a protocol from an existing class design, it
automatically creates a "conforms" link between the class design and the
retrieved protocol. However, this link does not automatically appear in
a class diagram. If you go back to the Class Diagrammer, you can use
Hide/Show Relationships to make this conformance link
visible.