<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="http://oldforge.etsi.org/mantis/css/default.css" />
	<script type="text/javascript"><!--
		if(document.layers) {document.write("<style>td{padding:0px;}<\/style>")}
	// --></script>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Pragma-directive" content="no-cache" />
	<meta http-equiv="Cache-Directive" content="no-cache" />
	<meta http-equiv="Expires" content="Tue, 17 Dec 2024 09:19:53 GMT" />
	<link rel="shortcut icon" href="/mantis/images/favicon.ico" type="image/x-icon" />
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Text Search" href="http://oldforge.etsi.org/mantis/browser_search_plugin.php?type=text" />	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Issue Id" href="http://oldforge.etsi.org/mantis/browser_search_plugin.php?type=id" />	<title>0003627: Bring &quot;inout all&quot; back with relaxed semantics - ETSI's Bug Tracker</title>
<script type="text/javascript" src="/mantis/javascript/min/common.js"></script>
<script type="text/javascript">var loading_lang = "Loading...";</script><script type="text/javascript" src="/mantis/javascript/min/ajax.js"></script>
</head>
<body>
<br /><table class="width100" cellspacing="1"><tr><td class="form-title" colspan="6"><div class="center">ETSI's Bug Tracker - Part 01: TTCN-3 Core Language</div></td></tr><tr><td class="form-title" colspan="6">View Issue Details</td></tr><tr><td class="print-spacer" colspan="6"><hr size="1" /></td></tr><tr class="print-category"><td class="print" width="16%">ID</td><td class="print" width="16%">Project</td><td class="print" width="16%">Category</td><td class="print" width="16%">View Status</td><td class="print" width="16%">Date Submitted</td><td class="print" width="16%">Last Update</td></tr><tr class="print"><td class="print">0003627</td><td class="print">Part 01: TTCN-3 Core Language</td><td class="print">New Feature</td><td class="print">public</td><td class="print">24-06-2008 12:55</td><td class="print">12-12-2008 11:43</td></tr><tr><td class="print-spacer" colspan="6"><hr size="1" /></td></tr><tr class="print"><td class="print-category">Reporter</td><td class="print">Pavel Yakovenko</td><td class="print" colspan="4">&#160;</td></tr><tr class="print"><td class="print-category">Assigned To</td><td class="print">Thomas DeiÃŸ</td><td class="print" colspan="4">&#160;</td></tr><tr class="print"><td class="print-category">Priority</td><td class="print">normal</td><td class="print-category">Severity</td><td class="print">minor</td><td class="print-category">Reproducibility</td><td class="print">always</td></tr><tr class="print"><td class="print-category">Status</td><td class="print">closed</td><td class="print-category">Resolution</td><td class="print">won't fix</td><td class="print" colspan="2">&#160;</td></tr><tr class="print"><td class="print-category">Platform</td><td class="print"></td><td class="print-category">OS</td><td class="print"></td><td class="print-category">OS Version</td><td class="print"></td></tr><tr class="print"><td class="print-category">Product Version</td><td class="print">v3.3.2  (published 2008-04)</td><td class="print" colspan="4">&#160;</td></tr><tr><td class="print-category">Target Version</td><td class="print">v4.1.1 (published 2009-06)</td><td class="print-category">Fixed in Version</td><td class="print"></td><td class="print" colspan="2">&#160;</td></tr><tr class="print"><td class="print-category">Clause Reference(s)</td><td class="print" colspan="4">6.2.9, F.3</td></tr><tr class="print"><td class="print-category">Source  (company  - Author)</td><td class="print" colspan="4">Pavel Yakovenko, ISPRAS</td></tr><tr><td class="print-spacer" colspan="6"><hr size="1" /></td></tr><tr class="print"><td class="print-category">Summary</td><td class="print" colspan="5">0003627: Bring &quot;inout all&quot; back with relaxed semantics</td></tr><tr class="print"><td class="print-category">Description</td><td class="print" colspan="5">Propose:<br />
<br />
1) Clear &quot;deprecated&quot; notice from port &quot;inout all&quot; statement (clause F.3).<br />
2) Declare that &quot;inout all&quot; covers any arbitrary type (clause 6.2.9).<br />
<br />
Problem description:<br />
<br />
One of the approaches to map classes (C++, UML, etc) to TTCN-3 is to put every class into separate module and represent every class instance as a separate parallel component. Public class methods are mapped to signatures. Accesses to public class data members are translated into get/set signatures. At the same time we may want to hide communication operations into proxy functions that are not tied to a component (i.e. do not have runs on clause). Proxy function must have two additional parameters: a reference to accessed component instance and a reference to a port which is used to send procedure call and receive reply.<br />
<br />
The problem is in the set of ports that calling component must have to access other components. If class ClassA invokes methods from ClassB and ClassC then corresponding component for ClassA must declare two ports â€“ one for ClassB and one for ClassC. The more different classes are used the more different ports component must declare.<br />
<br />
This issue could be solved if â€œinout allâ€ in the port type declaration would cover all possible types defined in the whole test suite (not in the current module). This would eliminate the need to have lots of ports to access class methods and would also remove the necessity to pass port instance to a proxy function.<br />
<br />
Example:<br />
Suppose we have ClassA, ClassB and ClassC classes and ClassA inokes methods from opther two classes.<br />
<br />
class ClassB<br />
{<br />
&#160;&#160;public: int f() {return 1;}<br />
}<br />
<br />
class ClassC<br />
{<br />
&#160;&#160;public: int g() {return 2;}<br />
}<br />
<br />
class ClassA<br />
{<br />
&#160;&#160;ClassB m_B;<br />
&#160;&#160;ClassC m_C;<br />
<br />
&#160;&#160;void h()<br />
&#160;&#160;{<br />
&#160;&#160;&#160;&#160;&#160;int v = m_B.f() + m_C.g();<br />
&#160;&#160;}<br />
}<br />
<br />
Currently we need to put two ports into component declaration for ClassA and pass port instance to every proxy function (look at the Part1 in the attached InOutAll.ttcn)<br />
<br />
Having â€œinout allâ€ cover any arbitrary type makes TTCN-3 code more structured. We may put port declaration to access class operations into a â€œrootâ€ component type and declare every component as an extension of the â€œrootâ€ one. Proxy functions are declared as running on â€œrootâ€ component hence we may remove port instance from the list of formal parameters (look at the Part2 in the attached InOutAll.ttcn).<br />
<br />
</td></tr><tr class="print"><td class="print-category">Steps To Reproduce</td><td class="print" colspan="5"></td></tr><tr class="print"><td class="print-category">Additional Information</td><td class="print" colspan="5">1) Making &quot;inout all&quot; to cover arbitrary types doesn't influence type checking in any way. All invoked signatures and templates still must be visible in the module. <br />
<br />
2) Keeping current semantics of &quot;inout all&quot; doesn't help.<br />
Yes, we may declare PT port type with &quot;inout all&quot; in every module and use one and the same port to invoke operations on every component. But still we must pass port reference to proxy function since component ClassA.CT and ClassB.CT are not compatible and we may not declare f_proxy with &quot;runs on&quot;.<br />
</td></tr><tr class="print"><td class="print-category">Tags</td><td class="print" colspan="5">No tags attached.</td></tr><tr class="print"><td class="print-category">Relationships</td><td class="print" colspan="5"></td></tr><tr class="print"><td class="print-category">Attached Files</td><td class="print" colspan="5"><img src="http://oldforge.etsi.org/mantis/images/fileicons/generic.gif" alt="?" />&#160;InOutAll.ttcn (3,871) <span class="italic">24-06-2008 12:55</span><br />http://oldforge.etsi.org/mantis/file_download.php?file_id=1528&amp;type=bug<br /><img src="http://oldforge.etsi.org/mantis/images/fileicons/doc.gif" alt="doc" />&#160;CR_3627_TD_18_July_2008.doc (61,952) <span class="italic">18-07-2008 14:41</span><br />http://oldforge.etsi.org/mantis/file_download.php?file_id=1573&amp;type=bug<br /><img src="http://oldforge.etsi.org/mantis/images/fileicons/zip.gif" alt="zip" />&#160;CR_3627_Bring_inout_all_back.zip (29,018) <span class="italic">13-08-2008 05:36</span><br />http://oldforge.etsi.org/mantis/file_download.php?file_id=1589&amp;type=bug</td></tr><tr><td class="print-spacer" colspan="6"><hr size="1" /></td></tr><tr><td class="form-title">Issue History</td></tr><tr class="print-category"><td class="row-category-history">Date Modified</td><td class="row-category-history">Username</td><td class="row-category-history">Field</td><td class="row-category-history">Change</td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">New Issue</td><td class="print"></td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">Status</td><td class="print">new =&gt; assigned</td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">Assigned To</td><td class="print"> =&gt; Ina Schieferdecker</td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">File Added: InOutAll.ttcn</td><td class="print"></td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">Clause Reference(s)</td><td class="print"> =&gt; 6.2.9, F.3</td></tr><tr class="print"><td class="print">24-06-2008 12:55</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">Source  (company  - Author)</td><td class="print"> =&gt; Pavel Yakovenko, ISPRAS</td></tr><tr class="print"><td class="print">18-07-2008 09:20</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Note Added: 0006320</td><td class="print"></td></tr><tr class="print"><td class="print">18-07-2008 09:20</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Assigned To</td><td class="print">Ina Schieferdecker =&gt; Thomas DeiÃŸ</td></tr><tr class="print"><td class="print">18-07-2008 09:20</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Status</td><td class="print">assigned =&gt; feedback</td></tr><tr class="print"><td class="print">18-07-2008 11:33</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a></td><td class="print">Note Added: 0006336</td><td class="print"></td></tr><tr class="print"><td class="print">18-07-2008 14:40</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Note Added: 0006339</td><td class="print"></td></tr><tr class="print"><td class="print">18-07-2008 14:41</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">File Added: CR_3627_TD_18_July_2008.doc</td><td class="print"></td></tr><tr class="print"><td class="print">18-07-2008 14:42</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Note Added: 0006340</td><td class="print"></td></tr><tr class="print"><td class="print">18-07-2008 14:42</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Status</td><td class="print">feedback =&gt; assigned</td></tr><tr class="print"><td class="print">13-08-2008 05:33</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Note Added: 0006503</td><td class="print"></td></tr><tr class="print"><td class="print">13-08-2008 05:36</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">File Added: CR_3627_Bring_inout_all_back.zip</td><td class="print"></td></tr><tr class="print"><td class="print">13-08-2008 05:38</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Note Added: 0006504</td><td class="print"></td></tr><tr class="print"><td class="print">13-08-2008 05:38</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Status</td><td class="print">assigned =&gt; closed</td></tr><tr class="print"><td class="print">13-08-2008 05:38</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a></td><td class="print">Resolution</td><td class="print">open =&gt; won't fix</td></tr><tr class="print"><td class="print">12-12-2008 11:43</td><td class="print"><a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=81">Ina Schieferdecker</a></td><td class="print">Target Version</td><td class="print"> =&gt; Edition 4.1.1 (not yet published)</td></tr></table>
<br />
<table class="width100" cellspacing="1">
<tr>
	<td class="form-title" colspan="2">
		Notes	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006320)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				18-07-2008 09:20&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				The proposal refers to the use of proxy functions and it is stated that these are not tied to component and therefore do not have a runs on clause. No reason is given in the proposal why the runs on clause should be avoided.<br />
<br />
Assuming that the proxy functions have a runs on clause, the problem could be solved quite simply: Assume there is a class A, providing a set of methods. A port type Port_A can be defined to call these methods and a corresponding component CT_A type with such a port pt_A can be defined too. The proxy function would then have clause 'runs on CT_A' allowing to access the port pt_A without having to pass it as parameter. The actual test component types used in behaviour functions would then be defined as extensions of CT_A and of other component types CT_B, CT_C, etc if methods of other classes would have to be invoked, too. Using this approach there would be no need to reintroduce 'inout all'.<br />
<br />
For further processing of the CR an explanation we need an explanation why the runs on clause has to be avoided. 			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006336)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=96">Pavel Yakovenko</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				18-07-2008 11:33&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				Yes, that's what I propose but &quot;runs on ROOT&quot; instead of &quot;runs on CT_A&quot; (see example 2 in the InOutAll.ttcn). <br />
<br />
If we add &quot;runs on CT_A&quot; to a proxy function of class A then we must add CT_A component to the extension list of every component that calls any operation from class A. This is very inconvenient from my point of view especially when writing code manually. Imagine extensions lists with tens of elements in it.<br />
<br />
And it doesn't differ much from adding pt_A port to the body of the calling component. In fact what extension mechanism does for us in this case is that it hides from the user addition of pt_A to the body of calling component. But actually it does more job - it adds all the component elements from parent component to the extended one. As a result extended component contains lots of members that are never used (except communication port) but we need to pay attention to possible name clashes. That is we need to make ports, port types, and other component elements (like &quot;this&quot; varaible storing class members) globally unique. For example we must declare this_A in class A instead of simply &quot;this&quot; and this_B for class B, because if class C calls both A and B it must extend component CT_C with CT_A and CT_B and having two &quot;this&quot; members (from A and B) will result in compile error.<br />
<br />
Now imagine if we have ROOT component with &quot;inout all&quot; port. It has only one component member (instance of that dispatching port), all components extend ROOT component and may use that port to communicate between each other as long as &quot;inout all&quot; covers transmited signature. We do not need to put every communicated component into the extension list, we do not need to care about name clashes since they may not occur.			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006339)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				18-07-2008 14:40&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				Ok, argument understood.<br />
<br />
One might have to use a more sophisticated mapping, actually one separating between the interface of a class from the implementation of a class, see the attached file CR_3627_TD_18_July_2008.doc. This should help to limit the amount of elements in the component types. And this should also help to avoid the name clashes among the 'this' component variables. Still, the extends clauses would be longer, agreed.			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006340)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				18-07-2008 14:42&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				explanation from Pavel received. Discussion within STF can continue.			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006503)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				13-08-2008 05:33&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				email from Pavel, August 12th, 2008:<br />
...<br />
Your suggestion to split interface and realization works well. I think increasing number of ports is an acceptable tradeoff over changing language semantics in this case. So let's close the case.<br />
...			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td class="print-spacer" colspan="2">
		<hr size="1" />
	</td>
</tr>
<tr>
	<td class="nopad" valign="top" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(0006504)
			</td>
		</tr>
		<tr>
			<td class="print">
				<a href="http://oldforge.etsi.org/mantis/view_user_page.php?id=112">Thomas DeiÃŸ</a>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				13-08-2008 05:38&#160;&#160;&#160;
							</td>
		</tr>
		</table>
	</td>
	<td class="nopad" valign="top" width="85%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				Alternative mapping of classes to component types solves the original problem without reintroducing 'inout all'. Therefore the CR can be closed as won't fix. The attached zip file contains a more detailed explanation of the alternative mapping and some example.			</td>
		</tr>
		</table>
	</td>
</tr>
</table>
</body>
</html>
