Skip to content

This repository features two branches: one with the original salary liquidation code and another showcasing the same process restructured using the Template Method pattern. Explore the benefits of enhanced code organization and reusability. Includes JUnit 5 tests for validating email routing logic.

Notifications You must be signed in to change notification settings

vlambo3/TemplateMethod---Employment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Explanation of the Program in the Main Branch

Our program is responsible for managing employee salary liquidation. To accomplish this task, we follow a specific process involving three key steps:

1. Calculate the Corresponding Salary:

  • For permanent employees, the salary is calculated based on a basic salary, with applicable discounts and bonuses.
  • For contract employees, the salary is calculated based on the number of hours worked and the specific hourly rate.

2. Print or Generate Salary Receipts:

  • Permanent employees receive a printed salary receipt.
  • Contract employees receive a digital salary receipt.

3. Deposit the Corresponding Amount:

  • Regardless of the employee type, the calculated salary is deposited into the employee's bank account.

In summary, the process we perform is called calculateTotalSalary(), which includes the steps of calculation, printing, and depositing the salary. Each employee has a name, surname, and a bank account number used for salary deposits. Permanent employees have additional information such as basic salary, discounts, and bonuses, while contract employees have the number of hours worked and the hourly rate.

Usage of the Template Method Design Pattern in the Template Method Branch

In the template-method branch, we have implemented the Template Method design pattern to simplify and better structure the salary liquidation process. This pattern allows us to define the skeleton of an algorithm in a base class and delegate the implementation of specific steps to subclasses, promoting code reuse and extensibility.

About

This repository features two branches: one with the original salary liquidation code and another showcasing the same process restructured using the Template Method pattern. Explore the benefits of enhanced code organization and reusability. Includes JUnit 5 tests for validating email routing logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages