none
what is the difference between a 'Provided Interface' and a 'Required Interface'? RRS feed

  • Question

  • What is the difference between a 'Provided Interface' and a 'Required Interface'?

    The book 'Learning UML 2.0' by Russ Miles describes the 'provided interface' as what the component implements and the 'required interface' as what the component needs to function.  To me, this seems like one and the same.

    Thanks,

    Ian

    Wednesday, May 1, 2013 5:29 PM

Answers

  • I think I finally understand the differences.   A 'required interface' is an interface used by a component but which the component does not actually implement.  Instead, a 'required interface' is implemented by a different component.  For example, ComponentA uses InterfaceB which is implemented by ComponentB.  In this case, ComponentA requires InterfaceB in order for ComponentA to perform it's work.   So a component implements it's 'provided interfaces' while a components 'required interfaces might, for example, be injected (i.e. dependency injection) into the component.
    • Marked as answer by IB00 Wednesday, May 1, 2013 8:37 PM
    Wednesday, May 1, 2013 8:37 PM

All replies

  • Occasionally, a type may implement an interface that's not required for it to function in a given API, but provides extra benefits, and allows it to be usable in more scenarios.


    These "extras" would be the provided interfaces, as opposed to the "required interfaces" that are needed for it to just work at all.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, May 1, 2013 5:33 PM
  • So if I understand you correctly, in UML version 1, the 'lollipop' symbol was used to denote a 'required' interface but this was changed in UML version 2 to a 'ball-and-socket' symbol?

    Thanks,

    Wednesday, May 1, 2013 5:45 PM
  • I think I finally understand the differences.   A 'required interface' is an interface used by a component but which the component does not actually implement.  Instead, a 'required interface' is implemented by a different component.  For example, ComponentA uses InterfaceB which is implemented by ComponentB.  In this case, ComponentA requires InterfaceB in order for ComponentA to perform it's work.   So a component implements it's 'provided interfaces' while a components 'required interfaces might, for example, be injected (i.e. dependency injection) into the component.
    • Marked as answer by IB00 Wednesday, May 1, 2013 8:37 PM
    Wednesday, May 1, 2013 8:37 PM