Book a Demo

Author Topic: How to expose method interfaces on components?  (Read 15702 times)

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
How to expose method interfaces on components?
« on: February 05, 2010, 12:46:54 am »
Hi!

Maybe the thread title is not very clear so I try to explain what I want:

1.) I have the system architecture (component diagram) on which I put a lot of components and sub-components. Now I want to create the dependencies between them. If one component implements an interface like a ComponentAListener e.g., I use exposed interfaces labeled "ComponentAListener" on both components and a dependency link between them.
But I am currently thinking about how to express a kind of method invocation. E.g. Component A uses a static getter method of the exposed Class of Component B. Should I create an interface called "getValue"? How can I do this?

2.) Another question regarding the component diagram is how can I express component A uses the component B as in creating an instance of its exposed class. Theoretically, an association should be used, shouldn't it? But this doesn't visualize that actually the one component "knows" about the other because an UML association is bidirectional.

Thanks!

-Jan

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: How to expose method interfaces on components?
« Reply #1 on: February 05, 2010, 08:35:07 am »
Hi Jan,

I dont think component diagrams were intended to support this kind of stuff.

1) I'm not sure if you're confusing structure and behaviour here?  IMO the dependency between a required interface and a provided interface is for the whole interface, not a specific method exposed.  The definition of the interface may specify particular methods and constraints, but again it is talking about the whole interface, not a part of it.  If you have a need to have an interface that exposes your "getValue" method and nothing else, then by all means create it, but I don't think that's what you are after.
2) Again behaviour vs structure.  The instantiation of the exposed class is a matter for the behavioural model of (part of) component A.  Component B knows nothing of its "Creator", thus allowing the component to be plugged into any structure it is capable of being created in.

A metaphor might help.  Imagine component B as a "leggo" box with a little hole in it.  You can plug it into any leggo model and the leggoites can stick messages into the hole and receive some kind of response.  Whether the box is full of electronics or tiny monkeys is anyone's guess, all the "component" model knows is that it has one of these bits and where and what shape the hole is.

hth
bruce

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: How to expose method interfaces on components?
« Reply #2 on: February 05, 2010, 09:19:22 pm »
Hi, thanks for your reply.

This is quite complicated to express what I want. I am aware of the differences between structure and behavior.

I don't want to show that component A "calls the exact getValue mehod". I want to show that comp A accesses the interface of component B.

If component B really implements an interface like e.g. an "EventListener" interface, I can show this using exposed interfaces, no problem. But what if e.g. component "Scheduler" or respectively its internals call a methods of e.g. a component called RealTimeClock. There is not "exposed" interface which I can use in the Component diagram. So how can I express that? I don't want to show the behavior but simply the one component uses and knows about the other. If'd use exposed interfaces, how should I call them?

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: How to expose method interfaces on components?
« Reply #3 on: February 06, 2010, 06:44:05 am »
Quote
There is not "exposed" interface which I can use in the Component diagram. So how can I express that? I don't want to show the behavior but simply the one component uses and knows about the other. If'd use exposed interfaces, how should I call them?

Ah, I think I've got your idea now Jan,  how about just using an assembly connector? ie the ---(0---,  directly between the two components. doesn't that convey the usage?

b

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to expose method interfaces on components?
« Reply #4 on: February 09, 2010, 12:27:19 am »
Jan,

I've always used to "required interface" for that.
AFAIK that is the correct usage of that element.
So if whithin your component "Scheduler" you use RealTimeClock from another component then this RealTimeClock should be an exposed interface of the other component.
"Scheduler" now has to use the "RealTimeClock" as a required interface.

The idea is that for you scheduling component it doesn't matter who implements this "RealTimeClock" interface, as long as it is implemented somewhere.

Geert

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: How to expose method interfaces on components?
« Reply #5 on: February 09, 2010, 11:28:38 pm »
Quote
Ah, I think I've got your idea now Jan,  how about just using an assembly connector? ie the ---(0---,  directly between the two components. doesn't that convey the usage?

Yeah, I think you got it :)

I think this is perfect. I can use it to show source and destination of this dependency, I can show that it is an interface but I don't have to name.

Thanks!