Skip to content

Noor-e001/Lab7_Refactoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SYSC 3110 Lab 7: Refactoring (Form Template Method)

Overview

This lab recreates and refactors Martin Fowler’s Site example to implement the Template Method Pattern.

Steps Completed

  1. Built initial classes with duplicated "getBillableAmount()" logic.
  2. Extracted common base computation "getBaseAmount()".
  3. Converted "Site" to abstract class defining the template method.
  4. Subclasses now implement "getTypeSpecificCharge(base)" as hooks.
  5. Verified identical runtime results.

IntelliJ Refactorings Used

  • Extract Method
  • Make Abstract Class
  • Pull Up (if applicable)
  • Safe Delete / Reformat Code

Output

Residential bill: 19.0
Industrial bill: 30.0

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages