There’s one question about Visual Paradigm which constantly keeps popping up from time to time: “Why do I suddenly see an M (or a) indicator?”, and: “How do I get rid of them?”. I’ll be honest: a recent question made me decide to write this guide, but this question has seriously been asked a lot over the years. I even recall seeing it frequently mentioned on the previous forum.
But I think we could also use a tutorial here on the forums, so here goes
Model elements and their optional meta data
A Visual Paradigm diagram usually contains a selection of so called model elements which make up for the actual diagram. One thing which all model elements have in common is that you can open their specification where you can add a lot of extra information about the model element or the things which are related to it.
This can be extremely useful if you’re going to use VP to generate one or more report(s) about your project because then it can also provide additional information about all the involved aspects.
However, the down side to this is that the model element will require more storage space (used memory). So if you were to copy such a model element a few times it would mean that both the element and all of its meta data get copied which is basically a waste of resources.
But there’s more to this of course…
If you have a model element which you use within several diagrams then what would happen if you suddenly had to make changes to that element? For example by changing its name or, as hinted at above, some of its assigned meta data? If you were working with individual copies then you would need to find every existence of the model and change each and every copy. Easy for smaller projects but can easily become an daytime job once your project becomes bigger.
Which is why VP uses so called views. These allow you to use a model element in multiple places while the actual element itself will only physically exist once within your project.
Turning off the indicators
First it is important to realize that these indicators only appear when working within Visual Paradigm. So if you’re going to export your diagram to an image or generating a report then you don’t have to worry about these things showing up. Just keep this in mind, because sometimes it can be useful to know if you’re working with an actual element or merely one of its virtual copies.
The first way to turn the indicators off is by using the “Model Indicator” option in the view tab, highlighted above. This will turn off any distracting indicators. So the ‘M’ and ‘a’ but also the icons which indicate the existence of references and sub-diagrams. Note however that whenever you select a model element by clicking on it then all relevant model indicators will be displayed no matter what.
You can also right click within the diagram and use the menu option:
So what are these ‘views’ and how are they created?
There are 2 main indicators involved, the M and a, and both have a different meaning:
- M - Master view: this indicator tells you that you’re working with the original model element.
- a - Auxiliary view: this indicator means that you’re working with a virtual copy of a model element. So the real element exists somewhere else within your project.
Note that there will always be only 1 master view while there can be one or more auxiliary views.
So as hinted at above these indicators tell you that you’re working with a different view of the model element. And a view is basically nothing more but another representation of that particular model element. In other words: a virtual copy. If you delete it then that’s that, you’d have deleted the copy while the original still remains.
Creating a new view
The easiest way to create a new view is to simply copy and paste a model element. You can do this by using the commonly used keystrokes: control-c and control-v. This will automatically create the new view:
Here I simply selected all the elements and used control-c followed by control-v to create the effect shown above. You can clearly see that the original elements are now the Master view whereas the copies are known as the auxiliary view.
Re-using model elements
The concept of views is also used when you re-use an existing model element. This feature can be very useful if you’re modelling several stages of one specific aspect of your project. For example: in the above Use Case diagram I made a rough analysis which generally described the steps involved in writing the opening section of this guide. So now that I’m actually in the process of writing (or “implementing” if you will) I’m ready to create a diagram which isn’t based on theoretical analysis data but real experiences from the actual implementation process.
And because I’ve already created several model elements I can simply re-use those:
There are 2 ways to do this and I’m showing both at the same time here, so don’t get confused
1 - Using the resource catalogue
This is what I normally use myself because it’s so easy: I double click somewhere within the diagram to bring up the resource catalogue then I select the model element I wish to add, in this case an actor. But instead of giving it a name I press control-space and that will bring up a list as shown in the screenshot above. Now I simply select the name (or element) I want to re-use and I’m all set.
2 - Using the model explorer
If you want to get a more detailed overview or if you prefer dragging in any items you wish to add to your diagram then you can also use the model explorer pane.
To add the pane to your environment you’ll have to select it from the panes option in the view tab, highlighted above. If you’re using models like I do then simply expand the model by clicking on the plus icon in front of it, and then simply drag the element(s) you wish you add to your diagram. If you wish to drag in multiple elements then keep the control key pressed while you click to select them.
The result could be something like this:
If you look closely at the model explorer you’ll notice that the auxiliary views (the actor and ‘write guide’ use case) do not exist as model elements within the Implementation model.
Creating an actual copy
But what if you need an actual copy? Sometimes it’s not very useful to create a new view. For example: let’s say you need to add a few elements which all share 2 specific custom attributes (tagged values) and one which is unique to the individual model elements.
So the easiest approach here is to add 1 model element with all custom values assigned to it, and then use it as a template. So you simply copy this model element a few times, and then only change the value which is unique for every model element.
Now, we can’t use views here because those all share the same meta data. So if you would change the master or auxiliary view then that change gets propagated through all other existing views.
Therefore we need copies.
If you’re working within the same diagram then the easiest way is to use the control-e keystroke. Just select the element(s) you want to copy, press control-e and you got yourself a physical, individual, copy.
You can also use the copy and paste options, but instead of pasting a view (which is the default behaviour) you need to paste a model element:
The option can be found on the diagram tab as shown above, but you can also find this in the context menu (shown if you right click with your mouse within an empty area of the diagram).
Using views, as shown above, can have many advantages. One of which being easy management: rename (or change) one element and this change will be applied throughout your entire project.
But there’s also a risk attached, because what if your change would invalidate other specific aspects of your project?
For example: I’ve used the ‘Write guide’ use case a few times within my project. Let’s say for the sake of argument that I need to rename this into ‘Write draft’. This has some nasty consequences because I wouldn’t be writing a draft within a diagram which showcases the actual implementation process. But how to find out about this?
Showing other views
The first option is available in all VP editions: show other views. Select a model element and then right click, open the section “Related Elements” and you’ll find this option:
Selecting this will open up a new dialog which will show you an overview of all the other diagrams in which the model element is being (re)used:
Creating an analysis
Another option, only available in the Standard edition and up, is to create a so called Visual Map, this is an analysis diagram which will showcase all the relationships which a specific model element has. So it doesn’t only show the different views (but you can do that if you want to) but everything involved: references, views, sub-diagrams, and so on.
You’re basically performing a so called impact analysis. Not directly related to views, but still a very powerful method to know about.
Follow the same steps as shown above, but instead of clicking ‘Show other views’ you now need to click “Analysis…”.
You can create the analysis in a new diagram (default, and also recommended) or within an existing (analysis) diagram. And the result could be this:
As you can see the actor model has 2 different views (shown on top; the two green elements), it has several references (I added links to my VPository, forum profile and personal website within the model specification) and it has several relationships (as also shown in the Use Case diagram screenshots above).
So not only does this option allow you to see which other views you’re using, it also provides you with a full overview of how the element is being used throughout your project.
As said this feature is insanely powerful, because it doesn’t just stop here… Notice the “Write guide” model at the bottom? That was the model element I started with in my example. Now that I know in which way a rename could directly affect my actor lets now take a closer look at the relationship of the “write guide” model element.
This time I’m not going to check for a full overview of every relationship, but instead I’ll concentrate on the different views and the general relationships.
Generating a new diagram you say? Naah, I’ll simply update what I already have here:
Notice the two view relationships at the bottom? And how VP added relationships to other elements within the same diagram?
That’s the way you perform an impact analysis
And there you have it…
What those weird indicators are, how to turn them off, why and how to use them, how to make physical copies and finally how to keep control over your project(s) whenever you’re using a multitude of auxiliary views.
I hope this was useful for some of you.