RE: namespace & element ownership



Date view Thread view Subject view Author view Attachment view

From: Waldin, Earl (earl.waldin@paranor.ch)
Date: Wed 29 Jan 2003 - 12:00:06 GMT


Hello

In a previous message Ivan Porres wrote:

> There are many things in UML 1.4 that do not make too much sense. A
> recursive example: data types are model elements. There is a data type
> called "Name" (page 5-10). Therefore an instance of "Name", 
> since it is also a model element, has an attribute called name of 
> type "Name".
> 

It's easy to get mixed up with all the model-levels in the UML
specification, especially if one wanders off into the model interchange part
of the spec.

The section of the UML specification in question here (5) is the section on
UML Model Interchange. So the datatypes in the figure on page 5-10 are
instances of MOF datatypes (a meta-meta level model), which means the
datatypes here are meta-model concepts for describing a UML model (i.e., an
instance of the UML meta-model). They are not UML model-level concepts. That
is, an instance of a datatype defined in section 5 is not an instance of
UML's DataType as defined in section 2.5.2.14 of the UML Core. To be more
concrete, an instance of the Name datatype in section 5 is not an instance
of DataType in section 2.5.2.14 and, therefore, is not a ModelElement as
defined in section 2.5.2.27. So there is no recursion here.

	-Earl Waldin

----------------------------------------------------------------------
Earl Waldin				tel: +41 31 828 9222
Paranor AG				fax: +41 31 828 9299
Juraweg 14				email: earl.waldin@paranor.ch
CH-3046 Wahlendorf
Switzerland
----------------------------------------------------------------------



> -----Original Message-----
> From: Ivan Porres [mailto:iporres@abo.fi]
> Sent: Wednesday, January 22, 2003 12:55
> To: puml-list@cs.york.ac.uk
> Subject: RE: namespace & element ownership
> 
> 
> Hola Gonzalo,
> 
> > It seems in UML v1.4 that a namespace owns the NAMES of the 
> elements it
> > contains, but not the DEFINITIONS of the elements. 
> I disagree. UML 1.4, page 5-4 shows that there is an 
> aggregation between
> Namespace and ModelElement with the ends named namespace and 
> ownedElement. A
> namespace owns its model elements, not the names of the model 
> elements.
> 
> > Then, an element's
> > definition could be spread among different packages. 
> This is how UML works since all associations at the metamodel 
> level are
> bidirectional (they are relations). 
> 
> Take as an example the metamodel association
> AssociationEnd.participant<->Classifier.association from page 
> 5-3 of the UML
> 1.4 standard. This metamodel association implies that if we 
> "connect" two
> classes with an association, we have to modify the definition of the
> classes. 
> 
> > For example, you
> > could
> > declare class A in package P, and then declare in package Q 
> that A is a
> > subclass of B.
> > 
> > But this seems incorrect to me. 
> Yes. 
> 
> But if we declare that C is a subclass of A in package R we 
> may also have
> modularity/encapsulation issues. What happens if the 
> definition of A is
> changed by the designer?
> 
> 
> > I think an element should not be modified
> > out of the owner package or namespace. 
> Then all model elements should be in the same package!
> 
> >I would like to hear some opinions
> > about this.
> I understand your point, but there is no general solution. 
> What you can do
> is define well-formed rules for your specific profile. In the previous
> example you could define a WFR like
> 
> context Classifier:
>   self.generalization.forAll(lambda g: g.namespace==self.namespace)
> 
> This forces a class and its generalizations in the same namespace. The
> syntax is not OCL but I am sure you get the idea.
> 
> There are many things in UML 1.4 that do not make too much sense. A
> recursive example: data types are model elements. There is a data type
> called "Name" (page 5-10). Therefore an instance of "Name", 
> since it is also
> a model element, has an attribute called name of type "Name".
> 
> Un saludo,
> 
> Ivan
> 
> > 
> > Gonzalo
> > 
> > 
> ==============================================================
> ============
> > 
> > Gonzalo Genova                        ggenova@inf.uc3m.es
> > Research and Teaching Assistant       
http://www.ie.inf.uc3m.es/ggenova/
> Department of Computer Science        http://inf.lab.inf.uc3m.es/
> Carlos III University of Madrid       http://www.uc3m.es/
> 
> Escuela PolitÚcnica Superior
> Avda. de la Universidad, 30
> 28911 LeganÚs - Madrid - Spain
> Tel. (34) 91 624 91 07
> Fax (34) 91 624 91 29
> 
> 
> 

Date view Thread view Subject view Author view Attachment view