How to distinguish the two delete options

(Translated by Satomi Joba – read the original article in Japanese.)


Hi, this is Lily from Astah Dev. team.

Have you read this blog post “Two ways to delete models in Astah” which briefly explains the difference between two deleting features in Astah.
Today, I’m going to expand it a little bit more explaining the concept of each delete option behind and gives you a conclusion of – how you should choose which option to delete depending on what situation.


Model Element & Diagram Element

Probably you wouldn’t think about it when you are saving files, but .asta files contain two types of information, Model Element information, and Diagram Element information.image
Model Element information is what appears in a top-left pane called “the project view” (1) and also in the bottom-left pane called “the Property View” – (2). In the sample figure above, when you click “Class0”, the detailed information appears in the (2) with multiple tabs such as Attributes and Operations…etc.

Diagram Element information is all about the visual presentations such as its location, size, color and the text font…etc. in the diagram editor – (3).

So the Class0 in the diagram is presented based on both Model Element information and Diagram Element information.


Number of Models and Diagram Elements

Every diagram element needs a corresponding model. But not the other way around – models don’t always require diagram elements. For instance, a Class can exist without being presented in a diagram.

model-without-diagram-elements.png

A Class Model without diagram element.

In this case, you can delete the model directly from the tree.
delete.png

However, exceptionally certain diagram types like Activity Diagrams require the existence of models and diagram elements as 1:1. In this case, there is only one delete option “Delete from Model” available. And when you delete, it’ll delete both diagram elements and its corresponding model altogether.

delete-model.png

 
On the other hand, Classes are the type of models that can be presented among several diagrams in one file, so model and diagram elements exist as 1:n and two delete options become available.

delete-from-diagram.png

Two delete choices for a Class.

When you choose [Delete from Model], it’ll delete the model itself completely from a file. So if the model is presented in several diagrams, deleting the model affects all the diagrams that the model is drawn and there is a possibility that you could be deleting it from a diagram that you don’t even notice. Therefore, Astah gives you a warning shown below when you try to delete model which is used in more than one place.
warning-at-delete.png
If you don’t like this warning come up every single time you delete models, you can disable it by unchecking the option from [Tools] – [System Properties] – [Other].
warning.png


Demo (1) – Delete from Diagram

delete_from_diagram

A Class0 is presented double in this diagram. Let’s choose [Delete from Diagram] for the below Class.
It will disappear but another Class0 remains, so does the model itself in the tree.


Demo(2) – Delete from Model

delete_from_model

This time, choose [Delete from Model].
Both Class0 presentations will disappear and the Class0 will be gone from the tree also.


Conclusion

So here’s a difference between these two delete options:

  • [Delete from Model] deletes the target model completely from the project
  • [Delete from Diagram] deletes only the model presentation from the diagram and keeps its model in the project.

So I recommend using

  • [Delete from Model] when you want to delete the model completely and
  • [Delete from Diagram] when you may want to reuse the model later or you just want it off the diagram.

Hope I was able to clear it out.
Happy modeling with Astah, everybody.

– Lily

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s