Question: You will implement 2 different patterns. Design Pattern 1 - Facade Pattern Implement the Facade Pattern to simplify your application's interaction with various subsystems. The

You will implement 2 different patterns. Design Pattern 1- Facade Pattern Implement the Facade Pattern to simplify your application's interaction with various subsystems. The Facade will provide a simple interface for adding employees, generating reports, and calculating bonuses.Create an EmployeeManagementFacade class that will provide high-level methods for:Adding an employee.Assigning a department and role to the employee.Generating reports based on employees' roles or departments.Calculating total compensation (salary + bonus) for a given employee.This will encapsulate the complexity of interacting with different subsystems (e.g., EmployeeFactory, ReportGenerator, and BonusStrategy) into a simple interface.HINTEmployeeManagementFacade facade = new EmployeeManagementFacade();facade.addEmployee("John Doe", 30,"123 Main St","E123", Department.IT, Role.ENGINEER, 80000);facade.generateReportByDepartment(Department.IT);Design Pattern 2- Decorator PatternImplement the decorator pattern to add behavior dynamically to employees (or managers) without modifying their existing class. System.out.print allow you to "decorate" employee objects with additional responsibilities, such as performance reviews or certifications.Create a CompensationDecorator class that will extend the functionality of the Employee class.Implement concrete decorators such as PerformanceReviewDecorator and CertificationDecorator.These decorators will add new responsibilities to employees (e.g., a performance review score or special certifications) that may influence their total compensation.HINTEmployee employee = new Employee("Alice",35,"456 Oak St","E456", Department.ENGINEERING, 90000);Employee decoratedEmployee = new PerformanceReviewDecorator(employee,4.5);decoratedEmployee = new CertificationDecorator(decoratedEmployee, "AWS Certified");System.out.println("Total Compensation: "+ decoratedEmployee.calculateTotalCompensation());

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!