A
A
Alisa Sokolova2022-01-15 23:03:29
Classification
Alisa Sokolova, 2022-01-15 23:03:29

How to define operations (methods) in UML class diagram?

Please tell me what questions you need to ask yourself in order to define operations (methods) in a UML class diagram? I'm learning UML, but I can't find the answer in the materials. Simple examples appear everywhere, for example below

01-uml-base-class-and-object-explained.png

. The picture shows that there is a class: a dog, it has methods: Sit, lie down, shake, approach. However, these methods are not associated with class attributes.

Also in the examples I see when methods are associated with class attributes. And sometimes even with another class or its attributes.

How to define operations? What logical questions can you ask yourself to determine the operations in a class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2022-01-15
@Alisa_Sokolova

There is no such "magic pill". Class development is a creative process, not a mechanical process. And if so, then you need to ask yourself the question - "what methods are needed so that the objects of my class can be used to solve my problems."
By the way, UML is a bit on the side here. It is only a means to display what you decide to use in your classes. Yes, a useful and handy tool, especially when you have many and complex interactions. But no more. The basis is classes and their properties, methods and interaction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question