1

I'm having trouble associating multiple classes with an interface where if I change methods in an interface, all implementing classes update automatically.

That is what is desired, where the interface is in the 'lolipop' format. Currently, I need to copy-paste the interface on to each class that implements it, and should I need to alter the interface, I need to alter each one which is quite a pain. Not to mention this screws up code generation should I elect to use it.

How does one create instance-references (if that's the proper term) of the interface such that rather than having multiple copies, they all point to the same interface. Where an alteration any one of which reflects immediately on the classes they are attached to (methods and such).

2 Answers 2

3

Open Model Explorer toolbar (if it isn't already open) and you'll see your interface there. Drag it again to the page and connect to the new class.

1
  • Good gosh, why didn't Microsoft's documentation show this. Thank you.
    – KenL
    Feb 20, 2011 at 2:56
1

There is a Visio documantation page explaining a solution for this. I'm not completely sure if it's the same solution Dejan posted so I add it to this thread.

Using this solution, implementing classes are updating, when the interface is changed. Also Visio uses the correct connector.

You have to drag your interface somewhere in your diagram before using this solution too, though.

http://office.microsoft.com/en-ca/visio-help/create-a-realizes-relationship-between-two-elements-HP001208865.aspx

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .