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

FirstInstance refactoring changes (refined) #9

Draft
wants to merge 35 commits into
base: build-pipeline
Choose a base branch
from

Conversation

AlpTorac
Copy link
Contributor

@AlpTorac AlpTorac commented Sep 3, 2024

Introduction

This pull requests contains several refactoring changes to the FirstInstance, which are explained in the attached files by the end of the following section. Additionally, interfaces (and some "package-info.java" files) implemented within this pull request contain commentary, explaining the interactions and the intents between their implementors.

The changes within this pull request have been tested with the Teammates tests and have passed successfully.

Note: There is a follow-up pull request (#10) that contains further null checks for similarity checking constructs. Another, separate pull request (#8) is opened for adding further null checks to some utility classes. They are moved to separate pull requests, since they are not exactly a part of the refactoring done here.

About The Commits

  • In order to make the changes more visible, many non-functional (i.e. compiling the project results in errors) commits were included. Such commits are marked with the "(WIP)" in their names as well as their commit messages.

  • The commits are ordered in a way that keeps the non-functional chain of commits as short as possible. Therefore, some interfaces and constructs that become relevant later are introduced beforehand.

  • All commits, except the latest one (89e0875), only modify files/subdirectories under the bundles/fi directory. In other words, they only modify the FirstInstance.

    • The said latest commit consists only of the changes to the SecondInstance, which are necessary for it to work with the new versions of the similarity checking constructs from FirstInstance.
  • In normalisation-related elements, LinkedHashMap<X, Y> in signatures was changed to Map<X, Y>. They still use LinkedHashMap in the background, just signatures are changed.

  • Descriptions to individual classes/interfaces can be found as commentary in their respective files. "package-info.java" files within certain packages explain interactions between their contents and further elaborations. The overview of these changes and a demonstration on how to construct a SimilarityChecker, as well as how similarity checking works with those changes can be found in the attached files:
    CIPM changes.pdf

High-level similarity checking
High-level similarity checker construction

Future Ideas

  • An iterator class for ISimilarityToolbox could be useful for extracting the order of handling and/or the amount of handlers being applied to a given ISimilarityRequest.

  • Enabling "merging" of ISimilarityToolbox instances could be useful, if using separate ISimilarityToolbox instances for certain request-handler pairs can benefit future implementations.

  • Allowing access to request-handler pairs in ISimilarityToolbox and offering further methods to modify the stored pairs could be useful.

from SimilarityChecker and related classes
Implement requests and handlers for certain similarity checking operations used in Java similarity switches

Helps centralise the said operations

Helps encapsulates some parameters that would otherwise unnecessarily clutter similarity checker and similarity switches
Builds upon the ...similarity.base package, extends and complements its elements with EMFtext

Provides exemplary similarity checking requests and handlers (using them is not mandatory)
For Java-related similarity switches

Currently empty

Can help separate Java-related similarity switches from the rest in the future
to keep the logging logic for Java-related inner switches in one place
For Java-related inner switches to not implement some mutual operations multiple times
Created for Java-related similarity checking
For PCM-related similarity switches
For PCM-related inner similarity switches
For PCM-related similarity checker

Use the extracted structure
For ID-based similarity checking of PCMs

A separate similarity checker implementation will no longer be necessary

To be integrated in the following future commits
For Java-related similarity checking
For logging Java-related inner switches
To their own files without modifying them

Non-functional commit
Rename SimilaritySwitch to JavaSimilaritySwitch to indicate its intent better

Use the extracted inner switches in the JavaSimilaritySwitch

Non-functional commit
To create new Java-related similarity switches

Non-functional commit
For Java-related inner switches that create further switches

Non-functional commit
Use extracted structure in the Java-related inner switches

Use implemented interfaces in the Java-related inner switches

Non-functional commit
For Java-related similarity checking

Non-functional commit
Rename SimilarityChecker to JavaSimilarityChecker

Use the extracted structure in the JavaSimilarityChecker

Delegate similarity switch creation by using a new similarity switch request

Non-functional commit
Adapt classes affected by the changes to the Java-related part of the similarity checking

Non-functional commit
To their own files without modifying them

Non-functional commit
Use the extracted structure in PCM-related similarity switch

Use extracted inner switches in PCM-related similarity switch

Non-similarity switch
For creating new PCM-related similarity switches

Non-functional commit
For PCM-related inner switches that create further switches

Non-functional commit
Use implemented interfaces in PCM-related inner switches

Use extracted structure in PCM-related inner switches

Non-functional commit
For PCM similarity checker construction

Non-functional commit
The dynamic toolbox can be set to use ID-based similarity checking handler

Non-functional commit
To the PCM related similarity checker construction

The FirstInstance should now work in a vacuum

SecondInstance is not adapted to the changes yet
The SecondInstance should now work with the preceding changes to FirstInstance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant