Code Refactoring

Last week I got an opportunity to refactor code from one of the class which was responsible to remove the individual spending account balance and replacing it with $0.

 

Task: Make the design and process generic to include other functionality at later point of time.

 

We were 3 members in the team and this is how we started and finished the task.

 

  1. Understand the functionality: We started with testing the existing functionality and understood the pre-conditions and post-conditions.
  2. Understand the code: What the responsible class doing and how it is structured.
  3. The ideas: We started with brain storming and listed down the ideas for the possible changes.
  4. Design Principles: We referred SOLID design principles and applied “Single responsibility Principle”  & “Open/Closed Principle”.
  5. Listed down all the bad smells and done changes.
  6. Tested the flow after the changes.

 

Lots of thought process gone through and we were able to finish the task within the specific timeline.

 

 

Reference: Refactoring Improving The Design Of Existing Code  By Martin Fowler

Java Design Patterns By Vaskaran Sarcar

The WeekLog 20

Coding:

Attended Naming Conventions in Java session – Learnt how important it is to have proper names for methods, variable and class. Code must not only do as per expected functionality, it must also need to communicate to others what it is doing.

 

 

Dzone Article:

The JVM Architecture Explained

 

 

Postgresql:

Explain & Analyse

 

 

 

Java Magazine:

November/December 2018

 

 

 

Interesting:

5 Debugging Tools Every JavaScript  Programmer Should Know And Use

 

 

Create a free website or blog at WordPress.com.

Up ↑