Why do we need to add colors to the UML model? In the book Java Modeling in color with UML (jmcu), color encapsulates the information layer method for us. This shows that adding colors increases the amount of information we express. More importantly, you can use colors to add a new information layer to the model. Therefore, we can use colors to add more information to the model.
The meaning of adding colors to a model is:
- Information layer added by the flag (for example, similar features are used for layers of the same category)
- Display the progress of time (for example, display the progress in different colors)
- Describe the key category information of a model (for example, this model belongs to a certain category)
- Add image effects to models
How many colors do we need? What colors are there? Jmcu defines four colors: pink, pastel yellow, pastel green, and pastel blue ). These four colors represent the four prototypes (archetype): Role, instant-interval (moment-interval, because it is difficult to translate mi ), people, places, and things (party, place, thing, PPT for short), category (description ).
Mi connects a component model to display the core content of a component. In a model, mi often encapsulates the most concerned methods. So mi is represented in compelling pink.
Roles are played by people, places, and things, and are an important part of the model. Therefore, it is expressed in pink yellow.
People, places, and things often assume a role, expressed in pink green. Category is the last one, expressed in pink blue.
After adding colors to the model, the model has more information. The four colors here represent four prototypes, allowing us to distinguish different prototypes more intuitively. Compared with the above two images, the first image is much richer than the second one, making it easier and faster to distinguish the four prototypes. In fact, there are many examples of how to use colors to display information in our lives. For example, the traffic lights, red, and Green indicate that the traffic is stopped. The progress bar of a project. The green section indicates that the project has been completed, and the red section indicates that the project has not been completed. JUnit/nunit test results. Red indicates that the assertion fails, and Green indicates that the assertion is successful. Maybe we can also use colors to indicate the development priority of the UML case and the different States of the state chart.