aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Required and provided interfaces on Component Diagrams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Required and provided interfaces on Component Diagrams" Watch "Required and provided interfaces on Component Diagrams" New topic
Author

Required and provided interfaces on Component Diagrams

Diego Marques
Greenhorn

Joined: Jun 24, 2010
Posts: 9
Hi everyone,

I have passed on the first part of the SCEA and now I am going to start the second part.

But before, I want to clarify a doubt which I always had.

What exactly is a required and a provided interface on a component diagram?

I have always read the following:
  • A provided interface is like a connector where another components can connect to use some behaviors of the component who provides this interface.
  • A required interface is like a connector where another component needs to connect to provide some behavior to this component.


  • I don't know if I really got the meaning.

    Let's say, for example, in an EJB 3.0 environment. A SessionBean called "MySessionBean" implements a local interface called "MySessionLocal".

    And let's say that there is a Servlet called "MyServlet", which uses the MySessionBean through the "MySessionLocal" interface.

    In this scenario, if I say:
  • The "MySessionBean" is a component that has a provided interface called "MySessionLocal";
  • The "MyServlet" is a component that has a required interface called "MySessionLocal".


  • Are these statements right?

    Or, in case not, could someone give me an example using EJB's, for example?

    Thanks a lot!
    Ryan Fernandes
    Ranch Hand

    Joined: Dec 11, 2003
    Posts: 86
    this is how I look at it:

    If you session bean exposes a functionality to manage bank accounts and ...
    your servlet is a component that requires the above functionality to fulfill its contract with its client...

    In this scenario, you can then say:
    # The "MySessionBean" is a component that has a 'provided interface' called "manageBankAccount";
    # The "MyServlet" is a component that has a 'required interface' called "manageBankAccount".

    Note: dont confuse "java interface" with "functionality interface"


    Unthinking respect for authority is the greatest enemy of truth. -Albert Einstein, physicist, Nobel laureate (1879-1955)
    Diego Marques
    Greenhorn

    Joined: Jun 24, 2010
    Posts: 9
    So, all my servlets that require a reference to an EJB, have a required interface for those EJB's?

    And all these EJB's have a provided interface?

    Is it right?
    Ryan Fernandes
    Ranch Hand

    Joined: Dec 11, 2003
    Posts: 86
    So, all my servlets that require a reference to an EJB a provider , have a 'required interface' for those EJB's that functionality


    whether that functionality is provided by your EJB or a POJO or a Web service is secondary.
    Diego Marques
    Greenhorn

    Joined: Jun 24, 2010
    Posts: 9
    Ryan Fernandes wrote:
    So, all my servlets that require a reference to an EJB a provider , have a 'required interface' for those EJB's that functionality


    whether that functionality is provided by your EJB or a POJO or a Web service is secondary.


    Hi Ryan,

    What do you mean by "is secondary"?

    Thanks
    Ryan Fernandes
    Ranch Hand

    Joined: Dec 11, 2003
    Posts: 86
    what I meant is when you depict your servlet on the component diagram, you might draw it with a 'required interface' (half bubble).
    You can then draw a dependency arrow (from the above half bubble) to any component's 'provided interface' (full bubble). That component could be anything (pojo, web service, ejb etc).
    I hope I've clarified this for you.

    Good luck with your assignment.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Required and provided interfaces on Component Diagrams