Repository navigation
Conversation
…metamodel made not with the generator)
jecisc
left a comment
There was a problem hiding this comment.
I stopped the suggestions for the environment because there are a lot and your agent can do it more easily than me
| prop := FM3Property named: aSlot name. | ||
| prop implementingSelector: aSlot name. | ||
| prop isMultivalued: aSlot isToMany. | ||
| self haltIf: [ prop name = #modelHasProperties ]. |
There was a problem hiding this comment.
Be careful :)
| self haltIf: [ prop name = #modelHasProperties ]. |
| | class | | ||
| class := FMMaterializerTestResource current clazz. | ||
| materializer materializeClass: class. | ||
| self assert: (Smalltalk globals includesKey: class name) |
There was a problem hiding this comment.
| self assert: (Smalltalk globals includesKey: class name) | |
| self assert: (self class environment includesKey: class name) |
Smalltalk gloabls might vanish someday
|
|
||
| materializer materializeClass: class. | ||
|
|
||
| getter := (Smalltalk globals at: class name) |
There was a problem hiding this comment.
| getter := (Smalltalk globals at: class name) | |
| getter := (self class environment at: class name) |
|
|
||
| materializer materializeClass: class. | ||
|
|
||
| getter := (Smalltalk globals at: class name) |
There was a problem hiding this comment.
| getter := (Smalltalk globals at: class name) | |
| getter := (self class environment at: class name) |
| materializer materializeClass: | ||
| FMMaterializerTestResource current anotherClass. | ||
|
|
||
| implementationClass := Smalltalk globals at: |
There was a problem hiding this comment.
| implementationClass := Smalltalk globals at: | |
| implementationClass := self class environment at: |
| materializer materializeClass: superclass. | ||
| self assert: (Smalltalk globals includesKey: class name). | ||
| self | ||
| assert: (Smalltalk globals at: class name) superclass name |
There was a problem hiding this comment.
| assert: (Smalltalk globals at: class name) superclass name | |
| assert: (self class environment at: class name) superclass name |
| ] | ||
|
|
||
| { #category : 'accessing' } | ||
| FMMaterializerTestResource >> clazz [ |
There was a problem hiding this comment.
Noooooooooon, not a new clazz :( With Clotlide we tried to remove those ahah
| remotePackage := FM3Package named: | ||
| 'Fame-Materialize-TestResource-Remote'. | ||
| metamodel add: remotePackage. | ||
| remoteClass := FM3Class named: 'RemoteClass'. | ||
|
|
||
| relationRemoteClassToClass := (FM3Property named: | ||
| 'remoteClassToClass') type: class. | ||
| relationClassToRemoteClass := (FM3Property named: | ||
| 'classToRemoteClass') type: | ||
| remoteClass. | ||
| relationClassToRemoteClass package: remotePackage. | ||
| relationRemoteClassToClass opposite: relationClassToRemoteClass. | ||
| relationClassToRemoteClass opposite: relationRemoteClassToClass. | ||
|
|
||
| classRemoteProperty := (FM3Property named: self remoteNumberPropertyName) | ||
| type: FM3Number instance. | ||
| classRemoteProperty package: remotePackage. | ||
| class properties addAll: { | ||
| relationClassToRemoteClass. | ||
| classRemoteProperty }. | ||
| remoteClass properties: { relationRemoteClassToClass }. | ||
| metamodel add: remoteClass. | ||
| remoteClass package: remotePackage | ||
| ] | ||
|
|
There was a problem hiding this comment.
It would be much more readable if we allow more characters by line
| relationClassToAnotherClass := anObject | ||
| ] | ||
|
|
||
| { #category : 'as yet unclassified' } |
There was a problem hiding this comment.
categorizations? (there are others like this, I'm just commenting one)
| | slots filteredSlots | | ||
| slots := aFM3Class properties | ||
| reject: [ :property | | ||
| property type isConstant not or: [ |
There was a problem hiding this comment.
Maybe we should introduce methods such as FM3Property>>#hasConstantType and others to make the code more readable?
Merge handwritten annotations into existing descriptions, refresh property caches, and resolve opposites deterministically. Declare the materializer packages and make its fixtures independent and deterministic.
This PR adds a materializer.
The idea is that we should be able to generate concrete classes based on a Fame Metamodel instead of the existing generator.
Thus, one could modify a metamodel and regenerate the concrete classes instead of modifying the generator.
We could also (for example) build other tools to create metamodel (like a visual one, based on FMMetamodel)