Page 1 of 1

difference between Provided and Required Interface

PostPosted: Sat May 31, 2008 11:21 pm
by Jayesh Nazre
Hi

in the context of class diagram I would like to know the difference between
Provided and Required Interface (with say Java as the OOP language).

When I use a lollipop and a half circle notation, I was expecting the class
with the half circle to have a member variable of type interface e.g.

Lets say I have a Department class and a ClassInfo class which is
implementing (providing) the interface implementation, for interface
IClassInfo

so Class ClassInfo implements IClassInfo...

And say I have a half circle draw from Department class to the
lollipop(IClassInfo) interface...when I try to generate code using ctrl+G, I
was expecting the Department class to have a member variable IClassInfo
m_classinfo; defined in it to hold the instance of "ClassInfo" - the
"IClassInfo" interface implementer, but I did not see that member variable.
Is my understanding of provided vs required interface wrong?







Re: difference between Provided and Required Interface

PostPosted: Tue Jun 03, 2008 11:46 pm
by Mindaugas Genutis
Hello,

I agree with you that some kind of reference from Department class
should exist to the IClassInfo instance. It could be implemented as a
member field, a parameter passed to an operation or some other way.
Unfortunately, our code generation doesn't take this into account yet.
It is still in our future improvements list. Your feedback has increased
its priority.

Best regards,

--
Mindaugas Genutis
Programmer
No Magic Europe
Savanoriu 363, LT-49425 Kaunas, Lithuania
Phone +370 37 324032 , fax +370 37 320670
E-mail: mindaugas.genutis
http://www.nomagic.com
http://www.magicdraw.com --
MagicDraw - Architecture made simple!


Re: difference between Provided and Required Interface

PostPosted: Thu Aug 07, 2008 3:45 am
by Dr Darren
Hi Jayesh,

The following tutorial on _reverse_ engineering of Java, including
interpretations of Java fields as Ports and how to use UML2 notation,
might be be of interest to you:

http://school.nomagicasia.com/node/690
Port-based reverse-engineering and Java

It is part of a larger tutorial on reverse engineering Java in MD UML:

http://school.nomagicasia.com/java_reverse

I am developing forward engineering of port-based systems from MD UML
and MD SysML against particular simulation and synthesis frameworks.
Examples will be made available on the MagicDraw online eSchool.

There is also a tutorial on port-based engineering in UML here:

http://school.nomagicasia.com/port_based_engineering

regards,

Darren


Jayesh Nazre wrote:
> Hi
>
> in the context of class diagram I would like to know the difference between
> Provided and Required Interface (with say Java as the OOP language).
>
> When I use a lollipop and a half circle notation, I was expecting the class
> with the half circle to have a member variable of type interface e.g.
>
> Lets say I have a Department class and a ClassInfo class which is
> implementing (providing) the interface implementation, for interface
> IClassInfo
>
> so Class ClassInfo implements IClassInfo...
>
> And say I have a half circle draw from Department class to the
> lollipop(IClassInfo) interface...when I try to generate code using ctrl+G, I
> was expecting the Department class to have a member variable IClassInfo
> m_classinfo; defined in it to hold the instance of "ClassInfo" - the
> "IClassInfo" interface implementer, but I did not see that member variable.
> Is my understanding of provided vs required interface wrong?


--
Dr Darren R C Kelly, BSc, PhD
No Magic Inc.,
Expert Advisor,
Science, Engineering, and Education
Phone: +61 (2) 9386 0090
Mobile: +61 (2) 405 029 008
Post: PO Box 1816, Bondi Junction, NSW 1355, Australia

Magicdraw UML: Architecture made simple !

Re: difference between Provided and Required Interface

PostPosted: Thu Aug 07, 2008 3:46 am
by Dr Darren
Hi Jayesh,

The following tutorial on _reverse_ engineering of Java, including
interpretations of Java fields as Ports and how to use UML2 notation,
might be be of interest to you:

http://school.nomagicasia.com/node/690
Port-based reverse-engineering and Java

It is part of a larger tutorial on reverse engineering Java in MD UML:

http://school.nomagicasia.com/java_reverse

I am developing forward engineering of port-based systems from MD UML
and MD SysML against particular simulation and synthesis frameworks.
Examples will be made available on the MagicDraw online eSchool.

There is also a tutorial on port-based engineering in UML here:

http://school.nomagicasia.com/port_based_engineering

regards,

Darren


Jayesh Nazre wrote:
> Hi
>
> in the context of class diagram I would like to know the difference between
> Provided and Required Interface (with say Java as the OOP language).
>
> When I use a lollipop and a half circle notation, I was expecting the class
> with the half circle to have a member variable of type interface e.g.
>
> Lets say I have a Department class and a ClassInfo class which is
> implementing (providing) the interface implementation, for interface
> IClassInfo
>
> so Class ClassInfo implements IClassInfo...
>
> And say I have a half circle draw from Department class to the
> lollipop(IClassInfo) interface...when I try to generate code using ctrl+G, I
> was expecting the Department class to have a member variable IClassInfo
> m_classinfo; defined in it to hold the instance of "ClassInfo" - the
> "IClassInfo" interface implementer, but I did not see that member variable.
> Is my understanding of provided vs required interface wrong?


--
Dr Darren R C Kelly, BSc, PhD
No Magic Inc.,
Expert Advisor,
Science, Engineering, and Education
Phone: +61 (2) 9386 0090
Mobile: +61 (2) 405 029 008
Post: PO Box 1816, Bondi Junction, NSW 1355, Australia

Magicdraw UML: Architecture made simple !

Re: difference between Provided and Required Interface

PostPosted: Wed May 20, 2015 5:04 am
by rosey.jenn.au@gmail.com
I particularly appreciate the examples involving component instances and their assembly.
This feature is very rarely presented, most presentations seem to focus on using these diagrams for classes (Car contains Wheels, duh !), where the point of the diagram is not so clear.
Obviously using them to specify assembli(es) of components in a given topology is much more useful and natural.

However, shouldn't the delegate connectors be oriented ?
I usually see them as arrows from the external port to the instance (offered interface) or from instance to port (required interface).
Although suppose this info can already be derived from the context.
Rosey Jenn
Elan Linen Australia
Contact: +61390149494

Re: difference between Provided and Required Interface

PostPosted: Thu May 21, 2015 5:14 am
by mindaugas.genutis
Hello,

UML spec does not define arrows for delegation connectors. As you've already mentioned, their direction is implied.

Yours Sincerely,

-- Mindaugas Genutis