I have used Enterprise Architect to create a simple class diagram. What I can't figure out how to do is make it show the relationships such as 1 to 1, etc...
Seems like a simple thing to show, but this program is not user friendly at all.
It is fairly simple actually - for both Class and Object diagrams you can use "Associate" from the toolbox. Then if you double click the association, you will be able to enter multiplicity under "Source Role" and "Target Role" tabs.
When you draw two classes and put association connector between them, you should right click the association, you will see multiplicity, but you should do this work in near of any class on the line of association.
In the association properties dialog go to target and source role sections.
There you'll find the multiplicity fields to fill in.
You can also right click near the ends of the association on a diagram and select "multiplicity" from the context menu.
Related
A case diagram has use case "Manage shopping cart". I need to add "View purchase" which used use case "Manage shopping cart" and add "Delete item" which may be used by use case "Manage shopping cart".
My attempt is here: Link
But I am not sure with my implementation of: "which may be used by use case" and orientation direction.
Is that correct?
Obviously, the sentence should be: "which may be used BY use case...". I have edited the question. That can be realized by extend arrow, as you have drawn it.
As for your diagram, it lacks arrows from customer to view content and to delete item. The customer can use these operations, can't he?
Is it possible to reuse an operation call of a class as transition in an UML diagram of Sparx Enterprise Architect (I've got version 9)? If yes, how do I do that?
It's possible to use it as action in an activity diagram and as message in an object diagram, but I can't figure it out for the state machine. I wish there was more integration for software developers...
Furthermore, I wish I could set a state in the diagram as special state of a class instance (class instance == object).
Is it possible to reuse an operation call of a class as transition in an UML diagram ...?
Yes. In the state machine diagram:
Open the transition properties, enable "Effect is Behavior" and
select the operation from the browser.
It's possible to use it as action in an activity diagram ...
Yes. Add a 'Call Operation' action to the activity diagram.
Goto, "action properties" -> "Call" and select the operation from the
"Behavior:" menu.
... and as message in an object diagram ...
Yes. Draw a link between the objects on the object diagram,
right-click the link and select "Add message from ... " (where "..." is the desired direction). Double-click the message and select the operation from the
"Message:" drop-down list.
I just started using Dia. I'm trying to build a sequence diagram. I would like to represent self-calls. How does one do that in Dia? I can't figure it out.
Thanks.
First place a UML Message object with it's base attached to your lifeline.
Then, double-click the arrow (or right-click, Properties), and change the Message Type drop-down field to Recursive, and you'll get something like this:
Now you can drag the green anchor point around to make the Message arrow look as you'd like. (A note of caution: it seems that with a Recursive Message object, you can ONLY select the object by clicking on it exactly where the green anchor point WOULD BE. I say "would be" because of course you can't actually see that green anchor point when the object isn't selected.)
If you like, you can create another UML Lifeline object, and place it overlapping the existing lifeline, like this:
This isn't ideal, though, because there isn't actually anything attached to this second lifeline. The Recursive Message object doesn't let you choose where to attach it's arrowhead, because it's automatically attached to the lifeline from which it originated. And because the second lifeline isn't attached to anything, if you go moving objects around it will get left behind. But, it does look pretty, if that's what you're after. :)
A self call(or any other association) in UML is better expressed using the standard association notation instead of the message one. In DIA, insert an association notation from the toolbox on the left and add it to your canvas. Then in order to have it connect a class recursively(to itself) double click it and click select "Autoroute" as no. This will enable you to shape the route yourself and wont constrain you to the automatic straight line that gets drawn when linking a class to itself.
You would end up with something like this(in this example its a representation of a Node in a linked list):
Evenings chaps,
I'm using XCode4 to model my entities, but I cannot figure out how to change the cardinality of the relationships so by default they are all 1 to 1 relationships. Someone give me a hint on how to change it please :)
Are you seeing a straight line with one arrowhead? That's 1:1 already and is the default.
To set 1:many, one way is to select the relationship and in the right view pane (you may need to turn it on by clicking the right hand button in the view section in the toolbar) select the rightmost of the three icons at the top. You should see some options under "Relationship", including "Plural" (Maybe "Cardinality" was too long).
How to set extension pint for an "extend" relationship between 2 usecases in Enterprise Architect?
Oh,
I found it.
By right-clicking on a usecase in usecase diagram, then selecting advanced, there is an item called "Edit Extension points"