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

Performed refactoring techniques to make the code more clear #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rutvik-09
Copy link

The following refactoring techniques were applied:

  1. Rename the variable: The file "Mapping Context.java" had a boolean variable called isNew and it has been changed to isNewConcreteClass due to behavior and usage of that variable for knowing whether the concrete class has been introduced or not.
  2. Extract Method: The file " ScoringClassMapBuilder.java" had a code of block, which was converted into a method named "getUnmatchedFields()" to specify which fields will be mapped and the remaining ones will be unmatched, which gets returned by the mentioned function.
  3. Move Method: A new class called "ElementTypeClass.java" was created, which had the method called "defaultElementType()" and was moved to the given class due to its implementation from the original class called "Property.java" and later called in this class.
  4. Push-Down Method: A method named "List asList(Object[] iterable)" was pushed down from a class called "GeneratedObjectBase.java" to a class called "GeneratedObjectFactory" as to it belonged more to the former one due to its functionality.
  5. Pull-Up Method: The changes were made to three inter-related interfaces having a superclass and subclass relationship. The method called "void setMapperFactory()" was moved into the interface called "BaseSpecificition.java", which was implemented by the two interfaces called "Specification.java" and "AggregateSpecification.java".

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