[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3501
  • Last Modified:

UML diagram in Visio

Hi,

A quick question.
How do I draw this in Visio -             Object[]
I want show a method returning an array of Object.
How I do that in Visio?

Thax.
_Esam
0
_Esam
Asked:
_Esam
  • 8
  • 7
1 Solution
 
fffej78Commented:
You could either:

a) In Visio make the return method an array.
b) Represent an array of objects with another object (like a list) and show an association relationship between the class with the method that returns the object array.

In general you want to make your model nice and abstract, so I'd prefer option b.  If you are using Visio to design an actual implementation and to generate the necessary classes, then perhaps option a is more suitable.
0
 
_EsamAuthor Commented:
Well,
I tried to draw the diagram...but I couldn't find (don't know:) the symbol of [] for a returned method??
How I do that?
And,
In terms of showing association --- the returned type is just being used in a method with a local variable declaration.

Like this:

Class Super{

public ReturnedClass getData(bool){

ReturnedClass rt = new ReturnedClass();

}

}

What is the correct way of showing the relationship?

Thanks
_Esam
0
 
fffej78Commented:
Not sure exactly how you specifiy that it returns an array in Visio (from memory I think you can do it).  

In terms of an association, you'd draw a line between the two.  Call it the "data association" and specify

            (data)
Super -------> ReturnedClass
           (1)   (1)

So there is a relationship between the two called "data" (or getData if you prefer).  You specify the role name (data) at the end of the association with the arrow) and the "arity" with the number at either end.

So there is a one to one relationship between Super and the associated class ReturnedClass.  And you get to a ReturnClass from Super by means of the "data" association (or whatever name you give it).
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
_EsamAuthor Commented:
This is what I need to know---

What are the differences between associations ---------- of types----

When having an instance variable of another class within a class  vs. having the other class being declared locally within a method and returning its type?
How do I distinguish these two??? in the relationship diagram?

Like so:

Class MyClass{
private AnotherClass ac = new AnotherClass();

DoSomething(ac);

}

VS

Class MyClass{

public AnotherClass getData(){
 AnotherClass ac = new AnotherClass();
 ac.DoSomeOtherThing();
 return ac;
}

}

There should be some difference between showing these both types of associations?

_Esam
0
 
fffej78Commented:
I'd represent an instance variable (as in your first example, with the private AnotherClass, using an association link (a solid line with an open arrow).

See http://www.larrykagan.com/media/References/umlReference.html and look for the section on "Association" (perhaps consider the aggregation relationship too)

In the second example, this is a transient (temporary) use of the AnotherClass.  This would be captured using a dotted line with an open arrow, meaning a dependncy relation.  Again see http://www.larrykagan.com/media/References/umlReference.html for more details.

0
 
_EsamAuthor Commented:
I am really trying to clarify myself....:)

So, ________> (pardon bad formatting:) is for an association of the first kind?
      -----------> association for weak type ....?

What about extends/implements ?

Please mention extends/implements relationship (diagram notation) between types class/interface...
When to use what???

Thanks.
_Esam.
0
 
_EsamAuthor Commented:
If Class A implements Interface B then

A __________> B


If Interface A extends Interface B then

A __________|> B


If Class A extends Class B then ??????????

If Class A has strong association with Class/Interface B

then, A __________> B

If Class A has weak association with Class/Interface B

then, A ----------------> B


Let me know if I am right???
Let me know the answer to ????

Thanks.
_Esam
0
 
fffej78Commented:
Implements and extends are both represented by the same symbol which is a solid line with a closed arrow at the end (e.g. the associated between A and B in the first examples would be represented by the same line).

Strong association would be a solid line with a open arrow.  You mark the arity at either end and give it a name too (names are important!).  Arity just means how many are associated for example you might annotate the line if A contains three lots of B's.

"Weak" association is just a dependency, so I think you are right (dashed line, open arrow).
0
 
_EsamAuthor Commented:
>Implements and extends are both represented by the same symbol ???

So Class A implementing Interface B
    Interface A extending Interface B
    Class A extending Class B

Are all: A _____________|> B

?

I thought there are some differences!!
_Esam...
0
 
fffej78Commented:
Both extending an interface and extending a class are examples of generalisation, which is represented by the solid line with the closed arrow.  

This might be useful in explaining http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/class.htm
0
 
_EsamAuthor Commented:
>Both extending an interface and extending a class are examples of generalisation, which is represented by the solid line with the closed arrow.

So, How do I represent:

Class A implements Interface B ?


_Esam.
0
 
_EsamAuthor Commented:
Going back to the Original Question:

>How do I draw this in Visio -             Object[]

I figured it out...
There are options on using prefix, suffix for the operations; that's where I can include it.

Thanks...
_Esam
0
 
fffej78Commented:
With a solid line with a closed arrow.  The end of the arrow should be at B

It should look like A ----|> B
0
 
_EsamAuthor Commented:
Ok..then...

An interface IA extending another interface IA,
a class CA extending another class CB, and
a class CB implementing an interface IB ----

all are represented...in diagram.......

IA ___|>IB
CA___|>CB
CB___|>IB ........

Right?

Thanks..a  lot..

_Esam.
0
 
fffej78Commented:
Yes
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now