-1

Sometimes the UML component diagram contains a database component. Does this database component represent a class that programmers create (which includes host, username, password, port... DB connection with PDO, SQLI... etc.) or does it represent the real, entire database?

2 Answers 2

2

It depends on the level of abstraction on the diagram.

A component on a component diagram usually represents more than just a single class, but that doesn't mean that it can't represent a class. A component identified as a "database component" could be the class or classes used to represent a connection to a database. It could also be the database itself and the interfaces provided by a database client library or even the database server itself.

Ideally, it would be able to tell based on the diagram itself. The component could be annotated with information about what the component represents or a note element can be used to provide more information. If it's not clear based on context clues, you'd have to ask the author and hopefully have them update the diagram or provide explanatory text around the diagram to make it clear to future readers.

-2

UML is an object oriented modeling language so components do represent classes but they will be course level descriptions lacking detail. The point is to outline the big chunks and communication routes between them, to show what entity talks to what other entities and to get a high level overview of the entire system.

So it does represent the entire database but it is more a service identifier then a description of the thing.

1
  • 2
    Classes are not represented on all UML diagrams. Deployment diagrams, Component diagrams, and Object diagrams don't necessarily represent classes.
    – Thomas Owens
    Sep 24, 2021 at 11:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.