Hi
There are three kinds of typedef.
a) Concrete Syntax alias
typedef MyType = Tuple{....}
saving you the effort of typing Tuple{....} many times. This is
syntax sugar, it does not introduce a new type and so it should be
eliminated by the CS2AS conversion.
This does not appear to be supported by Eclipse QVTo.
It might be useful to support typedef in AS2CS, so it may be
appropriate for an AS 'trace' of the alias in the form of an AS
Typedef instance.
I propose to add Module::ownedTypedefs : TypedElement[*] to persist
the name=>type mappings lost in the CS2AS conversion.
b) Constrained type
typedef Employee = Person[employer <> null];
Introducing a 'new type' without defining any of its conformance
semantics.
This does not appear to be supported by Eclipse QVTo.
I see no advantage in this over something vaguely like
class Employee extends Person
{
invariant employer <> null;
}
which is standard UML with correspondingly standard semantics. The
latter is clearly a type, the former is arguably a role; an
interesting possibility but one that needs substantial
specification.
I propose to deprecate this form of typedef.
c) Internal type alias
Used to add operations to the standard library.
This is an internal facility which ignores Complete OCL and the real
problem.
The resolution is simple:
In 8.2.2.24 Typedef delete
This is specifically used in the QVT standard library to
attach operations to pre-defined primitive types, like
String and Collections.
Eclipse QVTo can continue to do whatever it likes internally.
---
Since "typedef" is not supported by the Eclipse QVTo parser, these
changes should cause no problems. Trimming "typedef" to something
useful might motivate its implementation.
With the Typedef AS class no longer mentioned in the QVTo spec,
Eclipse QVTo can continue to use it as part of its library
definition until OCL 3.0 / the Pivot provides an extensible
mechanism.
Regards
Ed
On 09/10/2015 09:16, Christopher
Gerking wrote:
Hi,
I like intermediate classes, but I've never used any 'typedef' keyword in the CS.
Are these the same concepts at AS level?
Regards
Christopher
-----Ursprüngliche Nachricht-----
Von: qvto-dev-bounces@xxxxxxxxxxx [mailto:qvto-dev-bounces@xxxxxxxxxxx] Im Auftrag von Ed Willink
Gesendet: Dienstag, 6. Oktober 2015 15:08
An: qvto-dev@xxxxxxxxxxx
Betreff: Re: [qvto-dev] QVT 1.3 Typedef issues
Hi
8.1.14
Well clearly you find Typedefs really useful.
Regards
Ed Willink
On 06/10/2015 13:55, Christopher Gerking wrote:
Hi
I'm not yet familiar with typedefs. Could you provide examples for 2) and 3) ?
-----Ursprüngliche Nachricht-----
Von: qvto-dev-bounces@xxxxxxxxxxx
[mailto:qvto-dev-bounces@xxxxxxxxxxx] Im Auftrag von Ed Willink
Gesendet: Montag, 5. Oktober 2015 22:35
An: QVTOML developer mailing list <qvto-dev@xxxxxxxxxxx>
Betreff: [qvto-dev] QVT 1.3 Typedef issues
Hi
Adolfo raised a couple of issues that question the integrity of typedef in QVTo.
1) The Constrained Typedef seems to be an underspecified QVTo-specific syntax bloat that could be handled in a general UML-specified way by a Class with an invariant.
2) The added operations library type typedef seems to be an irrelevant SmartQVT implementation detail that conflicts with Complete OCL.
3) Only the textual type synonym has integrity and utility.
Is it going to cause a problem if 2) is deleted completely, 1) is strongly deprecated with the Typedef AS class shrinking to an Element subclass that persists the textual macro for 3).
Regards
Ed Willink
_______________________________________________
qvto-dev mailing list
qvto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/qvto-dev
_______________________________________________
qvto-dev mailing list
qvto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/qvto-dev
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6140 / Virus Database: 4435/10768 - Release Date:
10/06/15
_______________________________________________
qvto-dev mailing list
qvto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/qvto-dev
_______________________________________________
qvto-dev mailing list
qvto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/qvto-dev
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6140 / Virus Database: 4435/10783 - Release Date: 10/08/15
|