Hello,
I've found a brief
UML class diagram for a Java Servlet API. And I wonder wether this diagram is correct. Specifically I would like to clarify association relationships.
Firstly, the know and unknown classes in an association. For instance, look at the association between classes "ServletOutputStream" and interface "ServletResponse". It is uni-directional association. According to
this article, a "uni-directional association is drawn as a solid line with an open arrowhead (not the closed arrowhead, or triangle, used to indicate inheritance) pointing to the known class". Therefore, the known type in our case is "ServletOutputStream". Lots of books (particularly, UML Distilled by Martin Fauler) say that association relationships are realized as fields in source code. And thats why, following the logic, class "ServletOutputStream" should contain the reference to a "ServletResponse" instance. But, on the contrary, "ServletResponse" has a getter for a "ServletOutputStream" (getOutputStream()).