I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to.
However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object.
class.setParentPackage(Namespace) Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? thanks.
Usman _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
On May 11, 2011, at 11:55 AM, Usman Bhatti wrote: > I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. > > However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. > > class.setParentPackage(Namespace) > > > Since, C# uses namespaces instead of Packages to organize classes, but I guess that this the same in java. May be I'm incorrect but FAMIX class has Namespace and not package as parent. > it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. Yes it should > I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? > > thanks. > > Usman > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Usman Bhatti
I use Class.setContainer(Namespace) in VerveineJ But it is a bit strange that: - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? nicolas De: "Usman Bhatti" <[hidden email]> _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
On 11 May 2011, at 12:42, Nicolas Anquetil wrote: > I use Class.setContainer(Namespace) in VerveineJ Indeed, this is what should be used. > But it is a bit strange that: > - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) No. parentPackage is different than container. See below. > - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." > Why not call it Namespace in this case? Because it can also be a Method in the case of Java. The comment says that for Smalltalk the container is explicitly a Namespace and not a Package. > And, again, why should we treat differently Namespaces and Packages? Because they are different entities. Namespaces have semantic meaning in the language so they influence the unique name of the entity, while Packages are physical entities for packaging :). In Smalltalk the two are explicitly different. In C++ we have explicit Namespaces, but not so explicit Packages. In Java, we have both Namespace (what you define in your Java source), and Package (the folder structure), but they happen to overlap in naming (although one is with . and the other one is with /) so people tend to see them as packages only. Cheers, Doru > nicolas > > De: "Usman Bhatti" <[hidden email]> > À: "Moose-related development" <[hidden email]> > Envoyé: Mercredi 11 Mai 2011 11:55:40 > Objet: [Moose-dev] Namespace and Packages > > I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. > > However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. > > class.setParentPackage(Namespace) > > Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? > > thanks. > > Usman > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "The coherence of a trip is given by the clearness of the goal." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Nicolas Anquetil
On May 11, 2011, at 12:42 PM, Nicolas Anquetil wrote: > I use Class.setContainer(Namespace) in VerveineJ > > But it is a bit strange that: > - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) you have two links. a class is scoped by a namespace a class is contained in a file/package in java and C3 the two are mixed but these links that orthogonal. > > - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." > Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? > > nicolas > > De: "Usman Bhatti" <[hidden email]> > À: "Moose-related development" <[hidden email]> > Envoyé: Mercredi 11 Mai 2011 11:55:40 > Objet: [Moose-dev] Namespace and Packages > > I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. > > However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. > > class.setParentPackage(Namespace) > > Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? > > thanks. > > Usman > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Ok ... so:
ScopingEntity that defines the scope of the entity... ContainerEntity that contains a given entity... And I'll use ContainerEntity for C#. I was thinking of the way in which Moose interprets them...
On Wed, May 11, 2011 at 2:46 PM, Stéphane Ducasse <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
Just to clarify: - container points to the entity that influences the unique name of the current Type - parentPackage points to the entity that represents the physical organization Cheers, Doru On 11 May 2011, at 15:38, Usman Bhatti wrote: > Ok ... so: > ScopingEntity that defines the scope of the entity... > ContainerEntity that contains a given entity... > And I'll use ContainerEntity for C#. > > I was thinking of the way in which Moose interprets them... > > > On Wed, May 11, 2011 at 2:46 PM, Stéphane Ducasse <[hidden email]> wrote: > > On May 11, 2011, at 12:42 PM, Nicolas Anquetil wrote: > > > I use Class.setContainer(Namespace) in VerveineJ > > > > But it is a bit strange that: > > - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) > > you have two links. > a class is scoped by a namespace > a class is contained in a file/package > > in java and C3 the two are mixed but these links that orthogonal. > > > > > > - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." > > Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? > > > > nicolas > > > > De: "Usman Bhatti" <[hidden email]> > > À: "Moose-related development" <[hidden email]> > > Envoyé: Mercredi 11 Mai 2011 11:55:40 > > Objet: [Moose-dev] Namespace and Packages > > > > I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. > > > > However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. > > > > class.setParentPackage(Namespace) > > > > Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? > > > > thanks. > > > > Usman > > > > > > _______________________________________________ > > Moose-dev mailing list > > [hidden email] > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > > _______________________________________________ > > Moose-dev mailing list > > [hidden email] > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "It's not how it is, it is how we see it." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
On May 11, 2011, at 3:53 PM, Tudor Girba wrote: > Hi, > > Just to clarify: > - container points to the entity that influences the unique name of the current Type in fact ScopingEntity would be a better name :) > - parentPackage points to the entity that represents the physical organization > > Cheers, > Doru > > > On 11 May 2011, at 15:38, Usman Bhatti wrote: > >> Ok ... so: >> ScopingEntity that defines the scope of the entity... >> ContainerEntity that contains a given entity... >> And I'll use ContainerEntity for C#. >> >> I was thinking of the way in which Moose interprets them... >> >> >> On Wed, May 11, 2011 at 2:46 PM, Stéphane Ducasse <[hidden email]> wrote: >> >> On May 11, 2011, at 12:42 PM, Nicolas Anquetil wrote: >> >>> I use Class.setContainer(Namespace) in VerveineJ >>> >>> But it is a bit strange that: >>> - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) >> >> you have two links. >> a class is scoped by a namespace >> a class is contained in a file/package >> >> in java and C3 the two are mixed but these links that orthogonal. >> >> >>> >>> - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." >>> Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? >>> >>> nicolas >>> >>> De: "Usman Bhatti" <[hidden email]> >>> À: "Moose-related development" <[hidden email]> >>> Envoyé: Mercredi 11 Mai 2011 11:55:40 >>> Objet: [Moose-dev] Namespace and Packages >>> >>> I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. >>> >>> However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. >>> >>> class.setParentPackage(Namespace) >>> >>> Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? >>> >>> thanks. >>> >>> Usman >>> >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > -- > www.tudorgirba.com > > "It's not how it is, it is how we see it." > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
On 11 May 2011, at 16:01, Stéphane Ducasse wrote: > > On May 11, 2011, at 3:53 PM, Tudor Girba wrote: > >> Hi, >> >> Just to clarify: >> - container points to the entity that influences the unique name of the current Type > > in fact ScopingEntity would be a better name :) The convention in FAMIX is to name the properties by the type they point to. In our case, we have: ContainerEntity ScopingEntity Namespace Package Type BehaviouralEntity Because a Type can be contained BehaviouralEntity (in Java), we point to the container, not to the ScopingEntity. Cheers, Doru >> - parentPackage points to the entity that represents the physical organization >> >> Cheers, >> Doru >> >> >> On 11 May 2011, at 15:38, Usman Bhatti wrote: >> >>> Ok ... so: >>> ScopingEntity that defines the scope of the entity... >>> ContainerEntity that contains a given entity... >>> And I'll use ContainerEntity for C#. >>> >>> I was thinking of the way in which Moose interprets them... >>> >>> >>> On Wed, May 11, 2011 at 2:46 PM, Stéphane Ducasse <[hidden email]> wrote: >>> >>> On May 11, 2011, at 12:42 PM, Nicolas Anquetil wrote: >>> >>>> I use Class.setContainer(Namespace) in VerveineJ >>>> >>>> But it is a bit strange that: >>>> - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) >>> >>> you have two links. >>> a class is scoped by a namespace >>> a class is contained in a file/package >>> >>> in java and C3 the two are mixed but these links that orthogonal. >>> >>> >>>> >>>> - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." >>>> Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? >>>> >>>> nicolas >>>> >>>> De: "Usman Bhatti" <[hidden email]> >>>> À: "Moose-related development" <[hidden email]> >>>> Envoyé: Mercredi 11 Mai 2011 11:55:40 >>>> Objet: [Moose-dev] Namespace and Packages >>>> >>>> I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. >>>> >>>> However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. >>>> >>>> class.setParentPackage(Namespace) >>>> >>>> Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? >>>> >>>> thanks. >>>> >>>> Usman >>>> >>>> >>>> _______________________________________________ >>>> Moose-dev mailing list >>>> [hidden email] >>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>>> >>>> _______________________________________________ >>>> Moose-dev mailing list >>>> [hidden email] >>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> >> -- >> www.tudorgirba.com >> >> "It's not how it is, it is how we see it." >> >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "In a world where everything is moving ever faster, one might have better chances to win by moving slower." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
I really want to write a FAMIX document to represent all these decisions.
Stef On May 11, 2011, at 4:10 PM, Tudor Girba wrote: > Hi, > > On 11 May 2011, at 16:01, Stéphane Ducasse wrote: > >> >> On May 11, 2011, at 3:53 PM, Tudor Girba wrote: >> >>> Hi, >>> >>> Just to clarify: >>> - container points to the entity that influences the unique name of the current Type >> >> in fact ScopingEntity would be a better name :) > > The convention in FAMIX is to name the properties by the type they point to. In our case, we have: > > ContainerEntity > ScopingEntity > Namespace > Package > Type > BehaviouralEntity > > Because a Type can be contained BehaviouralEntity (in Java), we point to the container, not to the ScopingEntity. > > Cheers, > Doru > > >>> - parentPackage points to the entity that represents the physical organization >>> >>> Cheers, >>> Doru >>> >>> >>> On 11 May 2011, at 15:38, Usman Bhatti wrote: >>> >>>> Ok ... so: >>>> ScopingEntity that defines the scope of the entity... >>>> ContainerEntity that contains a given entity... >>>> And I'll use ContainerEntity for C#. >>>> >>>> I was thinking of the way in which Moose interprets them... >>>> >>>> >>>> On Wed, May 11, 2011 at 2:46 PM, Stéphane Ducasse <[hidden email]> wrote: >>>> >>>> On May 11, 2011, at 12:42 PM, Nicolas Anquetil wrote: >>>> >>>>> I use Class.setContainer(Namespace) in VerveineJ >>>>> >>>>> But it is a bit strange that: >>>>> - NamedEntities have a ParentPackage relationship. Maybe this ParentPackage could be removed for the sake of consistency in the metamodel and we keep the more generic belongsTo (a ContainerEntity) >>>> >>>> you have two links. >>>> a class is scoped by a namespace >>>> a class is contained in a file/package >>>> >>>> in java and C3 the two are mixed but these links that orthogonal. >>>> >>>> >>>>> >>>>> - then Type as the relationship "container" (a ContainerEntity) which is explicitly documented as: "Container is a namespace, not a package (Smalltalk)." >>>>> Why not call it Namespace in this case? And, again, why should we treat differently Namespaces and Packages? >>>>> >>>>> nicolas >>>>> >>>>> De: "Usman Bhatti" <[hidden email]> >>>>> À: "Moose-related development" <[hidden email]> >>>>> Envoyé: Mercredi 11 Mai 2011 11:55:40 >>>>> Objet: [Moose-dev] Namespace and Packages >>>>> >>>>> I am creating a C# extractor for Moose. I am using Fame for java to access Famix objects and populate their information (similar to VerveineJ). While creating Famix.Class objects for C# classes, I need to set parent namespace to represent the namespace that the class belongs to. >>>>> >>>>> However, the Famix.Class only provides a single method to set the parent and that take a Famix.Package as a parameter. So, the following expression is an error for a Famix.Class object. >>>>> >>>>> class.setParentPackage(Namespace) >>>>> >>>>> Since, C# uses namespaces instead of Packages to organize classes, it would be good to set a Famix.Namespace to be the parent of a class. Does meta-model not provide a way that we can set Famix.Namespace as a parent of a class. I can see another method in the Famix.Class and that is SetContainer(ContainerEntity se). Can I use this method to set a Namespace to be the parent of a Class and keeping the parentPackage relationship empty? >>>>> >>>>> thanks. >>>>> >>>>> Usman >>>>> >>>>> >>>>> _______________________________________________ >>>>> Moose-dev mailing list >>>>> [hidden email] >>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>>>> >>>>> _______________________________________________ >>>>> Moose-dev mailing list >>>>> [hidden email] >>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>>> >>>> >>>> _______________________________________________ >>>> Moose-dev mailing list >>>> [hidden email] >>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>>> >>>> _______________________________________________ >>>> Moose-dev mailing list >>>> [hidden email] >>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> >>> -- >>> www.tudorgirba.com >>> >>> "It's not how it is, it is how we see it." >>> >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > -- > www.tudorgirba.com > > "In a world where everything is moving ever faster, > one might have better chances to win by moving slower." > > > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |