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