views:

30

answers:

2

I am using Visual Paradigm for UML to model our class hierarchy. I often have the case where one of our interfaces has a method requires an implementation of another of our interfaces as parameter to a method. Example (C++, interface = abstract class):

class IFoo {
public:
    virtual void bla() = 0;
};

class IBar {
public:
    virtual void meep(IFoo &) = 0;
};

I have no problem modeling both interfaces, but I am wondering which type of association to use for visually representing the relation of these two interfaces. Currently I am using the Usage-relation provided by Visual Paradigm, but I am not sure if this is indeed intended for this scenario. Is this the correct relation to use? If not, how can I model this relationship?

A: 

At least in a class diagram there is no visual representation of what's going on.

The Usage that you suggested would make it some kind of "meta" information, I guess. An alternative would be to specify it in a Usecase diagram. But that'd also be what I'd call "out-of-band" or on the meta-level, as Usecases are usually only used to communicate a warm, fluffy feeling of having documented something...

ShiDoiSi
The visual representation is just an extra. It helps us to immediately see the dependencies among out interfaces.
Space_C0wb0y
A: 

You can use a dependency arrow pointing from the interface with the dependent operation to the interface used as a parameter in the operation. You can then model the specifics of the dependency by providing the full signature of the dependent operations in your interface model element.

If you wanted to provide even more detail describing the nature of the dependency, you could attach a note to the dependency arrow.

Using your example:

alt text

Brandon E Taylor