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

Distributed functionality for matching package names with different capitalization #178

Open
HeikoKlare opened this issue Jan 28, 2022 · 1 comment
Labels
Java Related to Java Applications or Java Domain PCM Related to PCM Applications or PCM Domain UML Related to UML Applications or UML Domain

Comments

@HeikoKlare
Copy link
Contributor

HeikoKlare commented Jan 28, 2022

In #175, we have adapted the transformations to ignore the capitalization of package names. We have centralized the functionality for mapping between PCM elements and UML/Java packages two utilities of the according transformations (PCM-UML and PCM-Java).
However, there is at least one further place at which functionality for ignoring the capitalization is repeated (as discussed in the according PR), which is a query util for the UML domain (see here).

We should centralize the functionality for matching package names ignoring the capitalization in the Java/UML domains and refer to these domain-specific implementations within the transformations, in particular in the above mentioned utils.
This should be fixed together with #169, as it affects the same method implementations.

@JanWittler
Copy link
Contributor

Before starting a refactoring, it might be a good opportunity to define a reference implementation for such utility methods. The linked approaches realize all the find part of the find-or-create pattern, but with two different concepts: PCM-Java and PCM-UML use inter-domain logic for the matching (i.e. information from both domains is taken) while the UML query util uses intra-domain logic (i.e. information only from UML).
Inter-domain logic allows for more precise customization and is bidirectional but needs to be setup again for every domain pair thus is poor in scaling and scatters matching logic.
Intra-domain logic centralizes the matching logic and scales better but is unidirectional. Thus, when setting up a domain pair, the consistency between the two unidirectional intra-domain matching logics needs to be verified.
A third option which could combine benefits of both approaches would be to define identifying attributes for each element type. Without knowing too much about the Commonalities language, I would guess that this approach follows a similar direction.

From my perspective, the centralization of the matching logic is the most important aspect which is why I would go with the intra-domain matching logic, like it is already done in the UML query util. I would suggest to place these utility methods directly in the domain packages (of the Vitruv-Domains repository) as they are only depending on the domain and any application of the domain should use and therefore easily discover these utilities.
The proposed solution would require to split the isPackageFor method into distinct methods for Java, UML, and PCM that each take a namespace list instead of an element from another domain. Additionally, the getCorrespondingPackageName method would be moved to the PCM domain util and findUml... methods should be moved from the temporary package.

@JanWittler JanWittler added Java Related to Java Applications or Java Domain UML Related to UML Applications or UML Domain PCM Related to PCM Applications or PCM Domain labels Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Related to Java Applications or Java Domain PCM Related to PCM Applications or PCM Domain UML Related to UML Applications or UML Domain
Projects
None yet
Development

No branches or pull requests

2 participants