Search code examples
androidumlcomponent-diagram

Is component always interface implementation?


I want to show architectural representation of my software. My college lecture recommend me to use component diagram. But what i should draw as my component if my software doesn't use interface at all?

Because AFAIK, component in component diagram consist of interface and their implementation. Unfortunately, my software (an Android application) doesn't use interface at all (only use interface as retrofit API). I read some of the post in stack overflow, but that doesn't give me a sense. I ended up drawing the component diagram below per directory. Please give me some suggestion to draw component diagram.

enter image description here


Solution

  • According to the UML specification it is allowed to have a component without an interface in a component diagram, at least I am not aware of anything in the specification that would forbid that. If one component X uses another component Y, you should draw a dependency relationship (a dashed arrow with an open arrowhead) from X to Y, optionally adorned with stereotype ≪use≫.

    Here are my comments on your component diagram:

    • Replace the solid arrows between packages by dashed arrows between components.
    • Do not use the ball-and-socket notation, but use dependencies on interfaces instead (see my answer on this topic).