Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
Good gosh, why didn't Microsoft's documentation show this. Thank you. –  KenL Feb 20 '11 at 2:56
1  
Thanks, that's really unintuitive imo. –  Chris Oct 31 '12 at 15:00
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.