Question

I wonder if I can use few dependencies from 1 required interface of my system to few provided interfaces of another element.

Example: https://i.stack.imgur.com/lfoSr.png

Example of what I mean: My systems need access to few channels of distribution(all I can get) and Execution channel provides two interfaces: 1("phone call") and 2("sms").

Can I connect this like I did on diagram?

Était-ce utile?

La solution

Required and provided interface should be of the compatible types when connected through dependency, that's the oly way they can communicate.

This means that your situation is possible only is IChannel1 and IChannel2 are derived from the IChannelAccess.

UPDATE (after comment)

Interface is a kind of classifier and can therefore be inherited from another one. You can show this situation on a separate diagram.

enter image description here

As your component System expects IChannelAccess, it can safely access any interface derived from it. In this case he cannot call op11(), op12() or op2(), but only op().

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top