C
Calum MacLean
Quite often, Java APIs are defined in terms of interfaces rather than
classes.
For example, the Java Debug Interface (JDI),
(http://java.sun.com/j2se/1.4.1/docs/guide/jpda/jdi/index.html) or
parts of the Eclipse API (e.g.
http://dev.eclipse.org:8080/help/co...g/eclipse/core/resources/package-summary.html).
In general, it can be useful to use interfaces instead of classes, so
you can hide the implementation and change it more easily.
So, my question is, if you're designing an API and are wanting to use
UML, how do you indicate associations etc. between interfaces?
As these are (Java) interfaces, there are no "real" associations etc.
between the interfaces. However, there is still might be a conceptual
association between interfaces.
Using JDI as an example, the VirtualMachineManager interface has an
allConnectors() method, which returns a List of Connectors. So there
is the concept of some sort of association between the
VirtualMachineManager interface and the Connector interface, but how
can you show this in UML?
So would a class diagram which contained (mainly) interfaces end up as
a collection of interface with possibly generalisation and dependency
links between them, but no associations etc. (which could presumably
carry more information)?
In general, how do you usefully use UML to model an API consisting of
(mainly) interfaces?
Thanks for your help,
Calum
classes.
For example, the Java Debug Interface (JDI),
(http://java.sun.com/j2se/1.4.1/docs/guide/jpda/jdi/index.html) or
parts of the Eclipse API (e.g.
http://dev.eclipse.org:8080/help/co...g/eclipse/core/resources/package-summary.html).
In general, it can be useful to use interfaces instead of classes, so
you can hide the implementation and change it more easily.
So, my question is, if you're designing an API and are wanting to use
UML, how do you indicate associations etc. between interfaces?
As these are (Java) interfaces, there are no "real" associations etc.
between the interfaces. However, there is still might be a conceptual
association between interfaces.
Using JDI as an example, the VirtualMachineManager interface has an
allConnectors() method, which returns a List of Connectors. So there
is the concept of some sort of association between the
VirtualMachineManager interface and the Connector interface, but how
can you show this in UML?
So would a class diagram which contained (mainly) interfaces end up as
a collection of interface with possibly generalisation and dependency
links between them, but no associations etc. (which could presumably
carry more information)?
In general, how do you usefully use UML to model an API consisting of
(mainly) interfaces?
Thanks for your help,
Calum