[wg11] Part 11: redeclared attributes
Georgi Kuzmanov
g.kuzmanov at eim.surrey.ac.uk
Wed Apr 21 07:06:21 EDT 2004
Jochen, Heidi
Having a redeclaration reference [the entity containing] another
redeclaration (rather than the original declaration) of an attribute was
made "officially" legal by TC2 in 1999. The original 1994 version of
the standard does not allow this possibility, but does not explicitly
forbid it either.
With the risk of being accused of splitting hairs, I would favour
referencing the original declaration over referencing a redeclaration,
even though the alternative approach is perfectly legal.
Quoting the second sentence from P11 (1994) 9.2.3.4: "The attribute
remains in the supertype but the allowed domain of values for that
attribute is governed by the redeclaration given in the subtype".
Logically this means a redeclaration of an attribute is not its repeat
declaration with a new type, but rather a constraint on its value
domain. Like domain rules, all applicable redeclarations of an
attribute for a complex entity instance are combined to constrain its
value domain.
Following Heidi's example, attribute_a stays in A even though its domain
is constrained (by the redeclaration in B) in complex entity instances
which are instances of both A and B. So if C redeclares attribute_a
refering to the redeclaration in B rather than the original declaration
in A, it is, in a way, using B as a "proxy" to point indirectly to the
an attribute which still belongs to A (and A as a supertype of B is
always guaranteed to be present in any valid instance of C because of
inheritance rules/P11 Annex B).
This is why having a redeclaration refer to another redeclaration seems
to me a bit like using the label of a domain rule to refer to the
attribute whose value it constrains (apologies for the lame analogy, but
I hope the meaning comes across).
The only situation I can imagine in which a redeclaration might need to
refer to another redeclaration is where some strange interaction of
explicit/implicit inter-schema interfacing and attribute renaming would
prevent the direct naming of the originally declaring supertype. I
cannot think of such an example at the moment.
On a separate note, I think attribute renaming in e2 may have been
mis-named and "attribute aliasing" would be a more accurate description
- according to e2 9.2.3.4 NOTE 1 "The old identifier remains available
in this entity data type and in any subtypes that are declared for this
entity data type".
Regards,
Georgi
On Tue, 2004-04-20 at 22:24, Jochen Haenisch wrote:
> Yes, Heidi, this is valid Express (as long as Z is a specialization of Y).
> P11 (e2) says in 9.2.3.4:
> "d) The group_qualifier in the qualified_attribute syntax shall identify
> either the entity
> data type in which the attribute was originally declared, or an entity data
> type that
> redeclares the attribute from another supertype.
> "
> And 'group_qualifier' is '\' entity_ref .
>
> I hope the experts agree :-)
>
> Best regards,
> Jochen
>
> > -----Original Message-----
> > From: Heidi L Preston [SMTP:hpreston at ebmail.gdeb.com]
> > Sent: 20. april 2004 22:32
> > To: wg11 at steptools.com
> > Subject: [wg11] Part 11: redeclared attributes
> >
> > All-
> >
> > I was hoping someone could entertain a Part 11 question. Is the following
> > EXPRESS legal?:
> >
> > ENTITY A;
> > attribute_a : X;
> > END_ENTITY;
> >
> > ENTITY B
> > SUBTYPE OF (A);
> > SELF\A.attribute_a : Y;
> > END_ENTITY;
> >
> > ENTITY C
> > SUBTYPE OF (B);
> > SELF\A.attribute_a : Z;
> > END_ENTITY;
> >
> > Questionable here is the redeclare in C. It appears that it should be a
> > redeclare of B (not A). Is the above construct allowed according to Part
> > 11?
> >
> > Thanks,
> > Heidi
> >
> >
> >
> >
> >
> > **************************************************************************
> > *
> > Heidi Preston
> > Electric Boat Corporation
> > 75 Eastern Point Road
> > Groton, CT 06340
> > (860) 433-8649
> >
> >
> > _______________________________________________
> > wg11 mailing list
> > wg11 at steptools.com
> > http://lists.steptools.com/mailman/listinfo/wg11
> _______________________________________________
> wg11 mailing list
> wg11 at steptools.com
> http://lists.steptools.com/mailman/listinfo/wg11
>
More information about the wg11
mailing list