difference between Provided and Required Interface

General discussions about code engineering

Moderator: Moderators

difference between Provided and Required Interface

Postby Jayesh Nazre » Sat May 31, 2008 11:21 pm

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?






Jayesh Nazre
 
Posts Rating:

Re: difference between Provided and Required Interface

Postby Mindaugas Genutis » Tue Jun 03, 2008 11:46 pm

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!

Mindaugas Genutis
 
Posts Rating:

Re: difference between Provided and Required Interface

Postby Dr Darren » Thu Aug 07, 2008 3:45 am

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 !
Dr Darren
 
Posts Rating:

Re: difference between Provided and Required Interface

Postby Dr Darren » Thu Aug 07, 2008 3:46 am

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 !
Dr Darren
 
Posts Rating:

Re: difference between Provided and Required Interface

Postby rosey.jenn.au@gmail.com » Wed May 20, 2015 5:04 am

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
Last edited by rosey.jenn.au@gmail.com on Sat Nov 21, 2015 12:52 am, edited 2 times in total.
rosey.jenn.au@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Wed May 20, 2015 5:00 am

Re: difference between Provided and Required Interface

Postby mindaugas.genutis » Thu May 21, 2015 5:14 am

Hello,

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

Yours Sincerely,

-- Mindaugas Genutis
User avatar
mindaugas.genutis
Customer Support
Customer Support
 
Posts: 510
Posts Rating:36
Joined: Thu Feb 04, 2010 1:57 am
Location: Kaunas


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests