Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uses relationships as composition in FamixUMLRoassalBackend #782

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Famix-UMLDocumentor/FamixUMLRoassalBackend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ FamixUMLRoassalBackend >> canvas [

{ #category : #api }
FamixUMLRoassalBackend >> export: famixUMLEntities [

"note: formating is described in #modelDescriptor:"
| builder |

builder := RSUMLClassBuilder new.
builder modelDescriptor: (FamixUMLRoassalDescriptor new umlModel: famixUMLEntities ; yourself).

builder classes: (famixUMLEntities select: [:e | e class = FamixUMLClass]).
builder build.

Expand Down
20 changes: 19 additions & 1 deletion src/Famix-UMLDocumentor/FamixUMLRoassalDescriptor.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"
Used by Roassal (`RSUMLClassBuilder`) to get informations about classes to put in the visualization

""Formating"" is in #initialize

The other methods or mainly helpers

API:
- aggregations -- returns all aggregations in the model
- compositions -- used to represent class-use-trait relationships
"
Class {
#name : #FamixUMLRoassalDescriptor,
Expand Down Expand Up @@ -28,6 +36,16 @@ FamixUMLRoassalDescriptor >> aggregations [
(self umlClassNamed: aggreg source) -> (self umlClassNamed: aggreg target) ])
]

{ #category : #accessing }
FamixUMLRoassalDescriptor >> compositions [

^(umlModel
select: [ :umlEntity | umlEntity class = FamixUMLUse ]
thenCollect: [ :use |
(self umlClassNamed: use target) -> (self umlClassNamed: use source) ])

]

{ #category : #initialization }
FamixUMLRoassalDescriptor >> initialize [

Expand All @@ -39,7 +57,7 @@ FamixUMLRoassalDescriptor >> initialize [
instVars: [ :famixUMLClass | famixUMLClass properties sorted: #name ascending ] ;
methods: [ :famixUMLClass | #() ] ;
instVarSelector: #name ;
methodsLimit: SmallInteger maxVal ;
"methodSelector: #name ;"
isAbstract: [ :famixUMLClass | famixUMLClass isStub ]
]

Expand Down
Loading