Hi Stephan,
the answer to your question is that port variables are not allowed. If
this is not clearly stated in the standard, we should add a clarification.
Concerning your other point, I am not sure that value of port variables
will be higher than the problems we will introduce into the language
(e.g., dynamic change of default behaviour by using port variables).
For your concrete problem it might be a solution to put the entire
behaviour of the component into functions/altsteps with port parameters
and to pass in the concrete port names depending on the role.
You can even re-assign port roles by calling behaviour functions with
different parameterizations.
Best regards
Jens
Stephan Tobies wrote:
> ext Jens Grabowski wrote:
>
>> Stephan,
>>
>> what do you want to do with port variables?
>>
>> I do not know any benefits of such an extension.
>>
> One of our users has come up with this question, and his intended usage
> is the following:
>
> One component type is used for PTCs in different roles. This component
> type has a number of different ports of the same type for different
> purposes. Depending on the role in which the PTC is being used,
> different ports shall be used for different purposes. By using component
> port _variables_ (instead of component _ports_), re-usable code can be
> written that works independent of the current role of the PTC because it
> refers to the ports via the variables (which can be dynamically
> re-assigned) and not via the (static) port names.
>
> Ok, this is a bit of a hack, I agree, and I am not sure if it would not
> be possible to achieve that same functionality via dynamic connections,
> etc.
>
> I do not have a particularly strong case for the introduction of port
> variables, I am more looking for clarification if they are currently
> allowed or not.
>
> BR
>
> Stephan
>
> --
> Stephan Tobies Sr. Research Engineer, Nokia Research Center
> ~ Mobile Networks Lab, Protocol Engineering Group
> E-Mail:
This email address is being protected from spambots. You need JavaScript enabled to view it.
> Work Phone: +49-234-9842262
> Mobile: +49-163-9842405
> Fax: +49-234-9843491
> Address: NRC Bochum, Meesmannstr. 103, 44807 Bochum, Germany
--
======================================================================
Prof. Dr. Jens Grabowski
Institute for Informatics phone: +49 551 39 14690
University of Goettingen fax: +49 551 39 14415
Lotzestrasse 16-18
DE-37083 Göttingen
This email address is being protected from spambots. You need JavaScript enabled to view it.
(Germany)
www.swe.informatik.uni-goettingen.de
======================================================================