Hi guys,
I modeled a Git repository in Smalltalk. My first class objects are: - GitterAuthor - GitterRevision, and - GitterRepository I want to have a Moose model (i.e., an extension of FAMIX), so that I can use all the tool suite of Moose. I have a couple of questions on that since I don't find a good explanation on how to do that. Let me describe what I did. For each of the classes listed above: - I create a class side method 'annotation' as follows GitterRepository class>>annotation <MSEClass: #GitterRepository super: #Object> <package: #Gitter> - For each of the accessor of the instance variables I added the pragmas as follows: GitterRepository>>authors <MSEProperty: #authors type: #GitterAuthor > <multivalued> <MSEComment: 'Authors appearing as committers in this Repository.'> The first question is what can be the choice for the type of a property? As far as I understood I can have Number, String, and one of the classes belonging to the model. But what if an instance variable has type, for example FileSystemGitRepository. Should I put #Object in the type or what else? - The last thing I did is to create an accept method to add the visitor, as follows GitterRepository>>accept: aVisitor aVisitor visitGitterRepository: self. Then implemented FAMIXImportingVisitor>>visitGitterRepository: aGitterRepository self visitEntity: aGitterRepository . I'm wondering if I did everything needed and how can I test it in a way.. Cheers and thanks in advance, Roberto Minelli _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Roberto,
Sorry for the late reply. Looks good. You should also: - Subclass your classes from MooseEntity - The FAMIXVisitor is more for the code meta-model. In your case, your meta-model is separate, so you probably do not need this particular Visitor. - You should also reinitialize the meta-repository to see your objects properly: MooseModel resetMeta - Regarding the type of a property pointing to FileSystemGitRepository, you probably do not need to add this as a property at all because FileSystemGitRepository will not be serialized. However, if you need to have it in the browser, then indeed, best use #Object. Cheers, Doru On Jan 15, 2013, at 10:22 AM, "[hidden email]" <[hidden email]> wrote: > Hi guys, > > I modeled a Git repository in Smalltalk. My first class objects are: > - GitterAuthor > - GitterRevision, and > - GitterRepository > > I want to have a Moose model (i.e., an extension of FAMIX), so that I can use all the tool suite of Moose. > > I have a couple of questions on that since I don't find a good explanation on how to do that. Let me describe what I did. > > For each of the classes listed above: > - I create a class side method 'annotation' as follows > GitterRepository class>>annotation > <MSEClass: #GitterRepository super: #Object> > <package: #Gitter> > > - For each of the accessor of the instance variables I added the pragmas as follows: > GitterRepository>>authors > <MSEProperty: #authors type: #GitterAuthor > <multivalued> > <MSEComment: 'Authors appearing as committers in this Repository.'> > > The first question is what can be the choice for the type of a property? As far as I understood I can have Number, String, and one of the classes belonging to the model. > But what if an instance variable has type, for example FileSystemGitRepository. Should I put #Object in the type or what else? > > - The last thing I did is to create an accept method to add the visitor, as follows > GitterRepository>>accept: aVisitor > aVisitor visitGitterRepository: self. > > Then implemented > FAMIXImportingVisitor>>visitGitterRepository: aGitterRepository > self visitEntity: aGitterRepository . > > > I'm wondering if I did everything needed and how can I test it in a way.. > > Cheers and thanks in advance, > Roberto Minelli > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "There are no old things, there are only old ways of looking at them." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |