It is currently Wed Feb 08, 2012 4:41 pm

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 6 posts ] 
Author Message
 Post subject: RiC and Ports
PostPosted: Tue Aug 18, 2009 7:53 am 

Joined: Tue Jul 07, 2009 9:14 am
Posts: 8
Location: Germany
Hallo everyone,

Yes I am still using RiC. Farquad asked in another post why anyone is using RiC. With RiCpp everything looks a little bit smoother. But my Prof. demands it for embedded systems and I wasn't able to convince him otherways. But enough of complaining.

I started working with ports. I've got some generall questions and some more practical. The Rhapsody user guide says 'A contract of a port is like a class for an object.' and 'a contract, which by itself is a provided interface'. That means that for Rhapsody a port is the realization of an interface? Is this also from the UML view correct? I allways understood it in that way, that contract ist the hardware realizing the connection, e.g. a cable connectio. And the interface is the method how and which methods are transmitted.

A more practical question: I at the moment concentrate on event communication via explicit ports. Rapid Ports where I use RiCGEN_PORT() macro or the send action macro are working quite fine. But I also want to use Non-Rapid Ports. For that I fond the macro RICGEN_PORT_I() on site 906 in the user guide. here is the passage.

Sending an event via a C non-rapid port
RiCGEN_PORT_I([class], [port], [interface], [event([argList])])
Example: To send event RiCGEN_PORT_I(object realizing the port, event), do:
RiCGEN_PORT_I(A, p, x, evt());

But the codegeneration alway fails when I want to use this. How have I to fill the macro if the class is called 'client', the port 'clientPort', the interface 'IF' and the event 'evGo'?

And am I using the right macro?


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Aug 19, 2009 5:51 am 

Joined: Tue Jul 14, 2009 9:21 am
Posts: 22
Location: Germany
Hi Lukas,

the term port is misleading. In UML (and Rhapsody) it has nothing to do with hardware. It is just an enhancement that makes working with interfaces in UML more convenient and intuitive.

A port has two aspects: First, it can provide some (abstract) functionality; second, it can require some (abstract) functionality. This provided and required functionality can be described using interfaces. A port can provide and require 0 or more interfaces. The combination of both is called the contract of a port.

When a class provides an interface via a port, it is just another way of saying that the class realizes this interface. This can be done in one of two ways (I think): First, the class can implement the interface itself. You then consider this port a behavioural port. Second, when the class is a composite class, it can delegate the implementation to one of its parts.

When you require an interface via a port, you say that you need an object whose class itself provides that interface (via port).

Hope this helps a bit.

Also have a look at the ports example (CppSamples\HomeAlarmWithPorts).

Regards,
Christian


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Aug 19, 2009 7:46 am 

Joined: Tue Jul 07, 2009 9:14 am
Posts: 8
Location: Germany
Yes you're absolutely right Christian. Thanks. I've seen once a picture in a book describing ports and interfaces. I can still remember the examples where given. A port can be a twowire-cable for example. I have to chek this at home which book it was. Now at work I checked the literature I've got here, and yes your completly right. But you know, sometimes you see 10 correct pictures and one faulty picture and you keep the one that is not correct in mind.

And I know the Example HomeAlarmWithPorts but it is c++ and I'm using c. And the commands and macros are in c slightly diffrent to c++.

But my second question has still to be answered. Has someone experiance with the macro RiCGEN_PORT_I()?

And another question to ports. When I'm using RiCGEN_PORT() every event is send by the port, even if their are not defined as dependences in the interface. Is this normal? I thought the sence of ports is to encapsule the interior methods of the class. Or is it because RiCGEN is the macro for rapid ports?


Offline
 Profile  
 
 Post subject: Bruce
PostPosted: Wed Aug 19, 2009 11:39 am 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
I remember printing out a Telelogic whitepaper by Bruce Powel Douglass which described what ports are in great detail.

It's available on the yahoo groups site RT-UML and is called "Any Port in a Storm.pdf".

http://tech.groups.yahoo.com/group/RT-UML/files/


Offline
 Profile  
 
 Post subject:
PostPosted: Thu Aug 20, 2009 11:45 am 

Joined: Tue Jul 07, 2009 9:14 am
Posts: 8
Location: Germany
Thanks a lot shanz. I have to admit that the whitepaper helped realy a lot in my understanding of ports.

But on question is still unanswered. Is it normal that I can use events via ports, althoug the interface doesn't now them as dependencies. Or is it because of RiC or because of the RiCGEN_PORT() Makro??


Offline
 Profile  
 
 Post subject:
PostPosted: Sat Aug 22, 2009 12:29 am 

Joined: Thu Aug 30, 2007 4:31 pm
Posts: 152
Location: Germany
this is intended .. this mechanism in Rhapsody is called Rapid ports... and allows you to send events though unspecified interfaces for rapid prototyping and early model validation...


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:


suspicion-preferred