Reputation: 21
I was given an assignment to design a UML class diagram for the database of a courier service. But I am bit confused about operations that are added to the class diagram as getters and setters.
Upvotes: 2
Views: 165
Reputation: 73406
In an UML diagram, you don't have to show everything: you may focus on elements that you want to highlight.
The getters and setters are not specific to uML, but are often added to provide controlled read/write access to properties that are private.
The fact that getters and setters are missing may be because:
You could of course think that from a database perspective you just have to know about the properties. This would be a valid use of a class-diagram. However it would not be helpful for building applications that use that database. On modern architectures, the persistance in a database is more a question behind the scene in the design.
Upvotes: 1