How should I correctly reference protocols on a UML class diagram?
For example my ListViewController
conforms to the UITableViewDataSource
and UITableViewDelegate
protocols... where do I put the cellForRowAtIndexPath
or numberOfRowsInSection
methods? ... in ListViewController
where they are implemented or in something like this:
<<Protocol>>
UITableViewDataSource
---------------------
---------------------
-numberOfRowsInSection
If I did the latter what would be the association between the ListViewController
class and the protocol box be? All I have to show is how I hook into Cocoa Touch some how.
Thanks.
A common convention is to prefix the name of the interface with a forward slash to indicate that a model element is an interface. As the following figures illustrate, the diagram editor displays an interface in the following ways: Class rectangle symbol that contains the keyword «interface».
It's best to avoid creating large diagrams and breaking them down into smaller ones that you can link to each other later. You can very easily do this with Creately. It helps you improve the readability of your diagrams.
In domain modeling class diagrams, an implements relationship represents a class that implements the operations in a Java™ interface. As the following figure illustrates, an implements relationship is displayed as a dashed line with an unfilled arrowhead.
This can be represented with the following class diagram. The fields and methods are annotated to indicate their access level: plus (+) for public, minus (-) for private, and hash (#) for protected.
Protocols are sort of equivalent to interfaces in java, so you can find a java UML diagram and work off that.
Also, from http://en.wikipedia.org/wiki/Class_diagram:
In UML modeling, a realization relationship is a relationship between two model elements, in which one model element (the client) realizes the behavior that the other model element (the supplier) specifies. A realization is indicated by a dashed line with an unfilled arrowhead towards the supplier.
...
A realization relationship between classes and interfaces and between components and interfaces shows that the class realizes the operations offered by the interface.
So if I'm reading that correctly, ListViewController
would have a dashed line with an unfilled arrowhead pointing to UITableViewDataSource
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With