0

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

Community
  • 1
  • 1
  • API = interface, isn't it? – qwerty_so Aug 23 '19 at 09:30
  • but not every functionality in the software need API, how should i draw the architecture? – ferrari_nato Aug 23 '19 at 09:32
  • If your component does not have an interface you can't interact with it. So it's pointless. – qwerty_so Aug 23 '19 at 10:18
  • @qwerty_so: A component may have public operations to interact with it. You can call this an interface, but I think ferrari_nato refers to the UML definition of 'interface', which is a separate classifier (see section 10.4 of the UML spec). – www.admiraalit.nl Aug 28 '19 at 14:37
  • @www.admiraalit.nl Exactly that `<>` is what you use to gather these operations and you would show a realize relation from the component to that interface. – qwerty_so Aug 28 '19 at 15:11
  • @qwerty_so, that's true, but this guy is modeling existing software (reverse engineering) and then IMHO you shouldn't model an interface where there actually isn't any interface (other than the public operations of the component). – www.admiraalit.nl Aug 28 '19 at 19:24
  • @www.admiraalit.nl I don't know which track you are on (but you're usually having some idea ;-). But if I RE any software I'll re-construct interfaces exactly that way by putting findings inside any IF so I get a picture of what's going on. – qwerty_so Aug 28 '19 at 22:19
  • Ferrari, please accept one of the answers or explain why you are not satisfied with them. – www.admiraalit.nl Sep 09 '19 at 20:15

2 Answers2

1

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).
www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
0

The answer is in your diagram. You have four components, in four different packages. You have explicitly identified an API (Application Programming Interface) between your Android app and your server, that much is obvious. However you have also identified at least 5 other interfaces here:

  1. Your Android App is stereotyped as "UI" (which I presume to mean User Interface). This is an interface between your user and your system.
  2. Android App connects to (references?) Database. That's another interface -- assume some sort of OLTP if its an RDBMS?
  3. UI to application model. This could be interfaced internally within your runtime assuming your model is compiled-in to the app.
  4. Server to application model. Again internal to the server assuming its compiled-in.
  5. Application model to Database (I assume you have the reference arrow the wrong way around here?).
muszeo
  • 2,312
  • 9
  • 13
  • I don't think you answer the question. The question is about reverse engineering existing software. The question is how a component diagram should look like if at least some of the components do not use separately defined interfaces. Is it allowed to leave out the interfaces from the diagram or should the diagram show non-existent interfaces? – www.admiraalit.nl Aug 28 '19 at 19:34
  • It depends on what you're wanting to show. If there is an association, there is most likely an interface of some kind, if you are talking component models. I think whether you choose to isolate a User Interface as an interface is up to you, if you choose to place actors on the diagram that represent human users then it may be worthwhile. – muszeo Sep 01 '19 at 06:55