wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes UML diagram ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "UML diagram ?" Watch "UML diagram ?" New topic
Author

UML diagram ?

kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
Hi

I have a main class



i want to draw UML diagram, could you just let me know just the relationships (associations/dependencies) in the above scenario.

1. realization between class abc and interface Ibcd (it is correct)
2. what is relation between class A and interface Iabc
3. whatis realtion between interface Iabc and Ibcd
4. what is relation between class A and Ibcd
5. what is relation between Iabc and class bcd.
6. what is relation between class abc and bcd

please let me know if there are any more relationships between these

thank you

[added code tags - Ilja]
[ January 27, 2005: Message edited by: Ilja Preuss ]
Eduardo M.R.
Greenhorn

Joined: Feb 01, 2005
Posts: 1
1. realization between class abc and interface Ibcd (it is correct)

There are two realizations: one between abc and Iabc and another between bcd and Ibcd

2. what is relation between class A and interface Iabc

There is an association between A and Iabc (A has an attribute of type Iabc). For the same reason there is an association between A and Ibcd

3. what is relation between interface Iabc and Ibcd

This is may be the most controversial part of the diagram. You can assume that there is a dependency between Iabc and Ibcd because Iabc uses Ibcd as a return of method get()

To know the dependencies of Ibcd we must know what type of objects are inside the Collection...

4. what is relation between class A and Ibcd

Association as I said before

5. what is relation between Iabc and class bcd.

None

6. what is relation between class abc and bcd

This classes are related but not directly, they are related trough interfaces Iabc and Ibcd so I think that the correct design is not to put any relation between abc and bcd and to put a dependency between interfaces.
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1006
    
    3
> 1. realization between class abc and interface Ibcd (it is correct)

>

>There are two realizations: one between abc and Iabc and another

>between bcd and Ibcd


Maybe it would be more in the spirit of the original question to say that the relationship between abc and Ibcd is indirect through Iabc.




> To know the dependencies of Ibcd we must know what type of objects

> are inside the Collection...


No. You only need to know what type of object are in the Collection to determine the dependencies for any class that implements (a.k.a. realizes) interface Ibcd. In fact, different concrete classes that implement Ibcd might stash objects of different types in the Collection. In fact the type of the objects in the Collection might be determinable only at run time.


...or is that kinda what you meant?

Ryan
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UML diagram ?
 
Similar Threads
sequence diagram and class diagram
Passed part 2/3 with 89%
Part II - Viable Action Plan ?
Separated interface Pattern and factory
Association in Cade's class diagram