Skip to content

[doc] Add ADR about services organization#1592

Merged
AxelRICHARD merged 2 commits into
mainfrom
ari/doc/adr002
Oct 29, 2025
Merged

[doc] Add ADR about services organization#1592
AxelRICHARD merged 2 commits into
mainfrom
ari/doc/adr002

Conversation

@AxelRICHARD

Copy link
Copy Markdown
Member

PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the priority: and pr: labels been added to the pull request? (In case of doubt, start with the labels priority: low and pr: to review later)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (area:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

@adaussy adaussy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just remarks that need to be discussed.

Comment thread doc/adrs/002_services_organization.adoc Outdated

- Services that query/mutate the model will be located in the new module `syson-sysml-metamodel-services`.
- this module will depend on `syson-sysml-metamodel`.
- all services in this module won't depend on Sirius-Web or any diagram/table related code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this coment not dependend of Spring, so it can be reused in other context.

- all services in this module won't depend on Sirius-Web or any diagram/table related code.
- Services that query/mutate the model through Sirius-Web services will be located in the existing module `syson-services`.
- all services in this module will be allowed to depend on Sirius-Web
- for example, services that query the model through `IObjectSearchService`.

@adaussy adaussy Oct 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this where I would plug the to previous services in Spring system.

- Services that query/mutate a tree will be located in the new module `syson-tree-services`.
- all services in this module will be allowed to depend on Sirius-Web.
- Services that query/mutate a form will be located in the new module `syson-form-services`.
- all services in this module will be allowed to depend on Sirius-Web.

@adaussy adaussy Oct 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if all those modules will not make the creation of new "common" service harder.

What I really like is to create only one "Sirius" Service class by representation. This is the main entry point so devellpers always know where to start debuging (or create a new service for a representation). It give the correct place to put code that only impact one representation. For any other comment behavior I whould create a service in syson-service and then inject then in the Sirius class services.

I would also create a naming convention to easily distinguish "Sirius" services class from other "Spring" service.

- a service querying label of elements will be in a class named `LabelQueryService`.
- a service modifying the label of elements will be in a class named `LabelMutationService`.
- a service querying label of diagram elements will be in a class named `LabelDiagramQueryService`.
- a service modifying the label of elements will be in a class named `LabelDiagramMutationService`.

@adaussy adaussy Oct 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to create as many service class, it could be great to split some of them between semantic but 8 might be too much. I think we need to ease the creation/update of service. Having to many choice might lead to complixity.
For DiagramServices, I would have one for each representation (maybe for each view type if we see it makes to many of them for the "GeneralViewDiagram" an maybe a CommonDiagramService. But I'm not sure it is usefull to split between Query/mutation.
I would not create a specific service for label. The label might be different en each representation (Tree, Table, General view, as IconLabel, as container). I would put them in each reprensetation class service, splitting query and mutation in two different methods. Then it might be delegatted in a common service.

Comment thread doc/adrs/002_services_organization.adoc Outdated
- a service modifying the label of elements will be in a class named `LabelDiagramMutationService`.


- The initial categories of services will be:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "category" the "something" in previous paragraphe? If it is does, it might induce a really big number of service.

Comment thread doc/adrs/002_services_organization.adoc Outdated
- Node
- Edge
- BorderNode
- Compartment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that we really need to distinguish NodeType BorderNode et Compartment. Once service class with several methods.

- `syson-table-services`
- Row
- Column
- Cell

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me those services will be stored in each representation service let say RequirementTableService (and maybe in a CommonTableService if we need to mutualize some code at some point). Again using the previously discuss pattern of one "Sirius" service class by representation.

- Cell
- `syson-tree-services`
- Tree
- TreeItem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remarks above

- Tree
- TreeItem
- `syson-form-services`
- Widget

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remarks

- `syson-form-services`
- Widget
- `syson-representation-services`
- Expose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm I guess it would also be accessible throught the service defined for each representation but for this one, I guess we will really need a "CommonExposeService".

Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
@AxelRICHARD AxelRICHARD force-pushed the ari/doc/adr002 branch 4 times, most recently from 25ad2e5 to 6521c2a Compare October 29, 2025 09:32
@AxelRICHARD AxelRICHARD linked an issue Oct 29, 2025 that may be closed by this pull request
Bug: #1628
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
@AxelRICHARD AxelRICHARD merged commit dce77a1 into main Oct 29, 2025
4 checks passed
@AxelRICHARD AxelRICHARD deleted the ari/doc/adr002 branch October 29, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce new services organization

2 participants