Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Thomas on November 28, 2002, 11:48:35 pm
-
My problem is: in diagrams, you can create two classes with the same name...It could be a problem when you work in a teamwork: for instance one person can create a class with attributes and operations, while another person creates an other class with the same name but with different properties. This problem could make a project fail. There is for instance an other problem: a first class can inheritate of a second class, while this second class can also inheritate of the first one.
In fact the real problem is that I don't know if there is a means of controling errors of modelisation in EA.
Thank you for your answer
-
Hi Thomas,
I suggest you search the forum for "relationship matrix". We had quite a good discussion on this some months ago (July? August...?) But in case you have trouble searching for the appropriate thread, the main idea is to use the matrix (Project -> Relationship Matrix) to check the integrity of your model.
A repetition of classes (or, in general, objects) with the same name will be very visible in your matrix.
Hope this helps.
Jaime Gonzalez
-
My problem is: in diagrams, you can create two classes with the same name...
In the UML "uniqueness" is not provided by diagrams. UML elements have a path name that is provided by the hierarchy of package names. This means that two classes in different packages may quite leagally have the same name.
If you want to see the full path name (default behaviour in EA) right-click on the diagram canvas (not an element) and select "Diagram Properties...". If "Highlight Foreign Obejcts" is checked, the full path name will be displayed.
This means that you only really need to be concerned about classes with the same name in a single package. Not hard to do if you follow Jaime's suggestion.
I'm not acutally sure what the UML says about uniqueness within a package. Anyone know?
Phil
-
Hi Phil,
The UML metamodel is quite specific on the concept of "namespace": two elements of the same type cannot have the same name in the same namespace. The "namespace" metaclass is, as a matter of fact, one of the central components of the metamodel's "backbone".
In our case (working with EA), the namespace is the "root" package in our project tree. (I'm probably wrong in calling it "root", because in EA you can have several namespaces in the same project.)
Of course, you are right in considering the full path as the element's name.
Jaime