anuragraghavan / franca

Automatically exported from code.google.com/p/franca
0 stars 0 forks source link

Support anonymous TypeCollections #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Given the following simple Franca example file:

-----------------------------------------------

package A

typeCollection B {
    typedef C is String
}

interface i {
    attribute A.B.C myString
}

-----------------------------------------------

The attribute "myString" has the full qualified name A.B.C because the type 
collection adds the "B" segment to the namespace. As type collections are not 
common in other interface descriptions technologies (UML, Fibex, ...) 
conventions are needed to handle type collections when it comes to model to 
model transformations. Round-trips are impossible most times. Thus anonymous 
(or default) type collections are needed to make transformation round-trips (to 
and from Franca) possible. Example:

-----------------------------------------------

package A

typeCollection {
    typedef C is String
}

interface i {
    attribute A.C myString
}

-----------------------------------------------

The attribute "myString" would have the full qualified name A.C because the 
type collection does not extend the namespace of its members.

Original issue reported on code.google.com by johannes...@googlemail.com on 17 Jun 2013 at 4:10

GoogleCodeExporter commented 9 years ago
I do consider this as a bug, as it is not possible to define typecollections 
relevant to the current package other than by actually placing such 
typecollections in the parent package and name the type collection according to 
the last part of the package name.
This is more or less a quite crude workaround...

Original comment by manfred....@bmw.de on 18 Jun 2013 at 12:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attempt to describe the issue more general:

In contrast to some other (programming) languages Franca forces data types to 
have a full qualified name of at least three segements (e.g. A.B.C) and 
interfaces to have a FQN of at least two segments. Thus the original definition 
of the FQN of interfaces and data types can not always be represented by 
Franca. Thus additional meta information must be added to retain the original 
FQN (which also must be used by transformations instead of Franca's namespace).

A possible solution could be something like a default package (like in Java) 
and a default/anonymous type collection.

Original comment by johannes...@googlemail.com on 18 Jun 2013 at 4:58

GoogleCodeExporter commented 9 years ago
Franca should support anonymous typeCollections. The types they contain will be 
located directly in the surrounding package. In the model API, the 
name-attribute of the FTypeCollection object will be null.

This requires some tweaking in the deployment models. A deployment definition 
with "for typeCollection" must be able to reference also anonymous type 
collections (i.e., their name for linking is just the FQN of the surrounding 
package). 

In a later step (not covered by this issue) we will analyse if it is possible 
to define elements in a "root" package (i.e., a fidl file without a "package" 
declaration). This will also lead to types being defined in the root namespace 
if this is used in conjunction with anonymous type collections.

Original comment by klaus.birken@gmail.com on 26 Jun 2013 at 3:23

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 26 Jun 2013 at 3:32

GoogleCodeExporter commented 9 years ago

Original comment by szabt...@gmail.com on 27 Jun 2013 at 9:23

GoogleCodeExporter commented 9 years ago
Available with Franca 0.8.9.

Original comment by klaus.birken@gmail.com on 28 Aug 2013 at 9:47