Good practice is what works on your project.
To model Python properties, you can add stereotypical operations with getters and setters that indicate their use. The relationship between an attribute and an operation is usually done using a naming convention. Some tools offer internal communication for creating attribute properties using getters and setters.
If you do not use code generation, you can also stereotype an attribute to indicate their use as properties (thus, using @property
talking encoder) and to get away from operations. If you use your own code generator, this will work in a similar way. Instrumental embedded code generators may require additional operations, as described above.
source share