Skip to main content

One post tagged with "factory"

View All Tags

Factory pattern

· 4 min read

The objective of this post is to explain and show how to implement the Factory Pattern in a basic way.

Pre-requisites

Check all the description and information related to the Factory Pattern and return here to see a practical example.

Description

Suppose a company has different levels of employees: Junior, Mid-Level and Senior. Each level has a different base salary. We want to implement a system that calculates the salary of an employee according to his seniority.