[wg11] sub-supertype constraints on USED entities

Jochen Haenisch Jochen.Haenisch at epmtech.jotne.com
Tue Oct 26 14:26:32 EDT 2004


Hi Lothar,

I would think that the crosswise schemas are correct (except for a missing ;
). The style, however, neglects the capabilities of P11 edition 2. So, I
agree that your approach is of a much better style (except for a couple of
syntax errors). The subtype_constraint was introduced for such cases.

Concerning P11: I think it allows both and does not give any usage guidance.

Regards, Jochen

> -----Original Message-----
> From:	Lothar Klein [SMTP:lothar.klein at lksoft.com]
> Sent:	26. oktober 2004 20:07
> To:	'WG11 exploder'; AP-INTEROP-L at ATICORP.ORG
> Subject:	[wg11] sub-supertype constraints on USED entities
> 
> Hi,
> 
> In the modules I found a situation which is wrong in my opinion.
> Please have a look to the simplified Express below.
> Two schemas using each other crosswise. I have doubts that the
> ABSTRACT SUPERTYPE constraint of "Variable" is valid since it calls
> out entities which are USED FROM. As a minimum I would consider this
> as a bad modelling style.
> 
> 
> SCHEMA Expression_arm;
> 
>  USE FROM Generic_expression_arm;
> 
>  ENTITY String_variable
>    SUBTYPE OF (Variable);
>  END_ENTITY;
> 
>  ENTITY Numeric_variable
>    SUBTYPE OF (Variable);
>  END_ENTITY;
> 
> END_SCHEMA;
> 
> 
> SCHEMA Generic_expression_arm;
> 
>  USE FROM Expression_arm;
> 
>  ENTITY Variable
>    ABSTRACT SUPERTYPE OF (ONEOF (Numeric_variable,
>                                  String_variable))
>  END_ENTITY;
> 
> END_SCHEMA;
> 
> ------------------------
> 
> A much better and correct modelling style would be to use
> SUBTYPE_CONSTRAINT; something like this:
> 
> SCHEMA Expression_arm;
> 
>  USE FROM Generic_expression_arm;
> 
>  ENTITY String_variable
>    SUBTYPE OF (Variable);
>  END_ENTITY;
> 
>  ENTITY Numeric_variable
>    SUBTYPE OF (Variable);
>  END_ENTITY;
> 
>  SUBTYPE_CONSTRAINT separate_variables FOR Variable;
>    ONEOF(Numeric_variable, String_variable)));
>  END_SUBTYPE_CONSTRAINT;
>  
> END_SCHEMA;
> 
> 
> SCHEMA Generic_expression_arm;
> 
>  ENTITY Variable
>  END_ENTITY;
> 
> END_SCHEMA;
> 
> Here schemas are no longer referencing each other crosswise.
> Expression_arm is clearly build on top of Generic_expression_arm.
> 
> --------
> 
> What are others thinking about this?
> Is there a place in part 11 which clarifies the situation?
> 
> Lothar
> 
> 
> 
> -- 
> // Lothar Klein, LKSoftWare GmbH
> // Steinweg 1, 36093 Kuenzell, Germany
> // +49 661 933933-0, Fax: -2
> // url: http://www.lksoft.com
> 
> _______________________________________________
> wg11 mailing list
> wg11 at steptools.com
> http://lists.steptools.com/mailman/listinfo/wg11


More information about the wg11 mailing list