Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have attached the screenshots of a question. Kindly help me with the solution ASAP. SE450 Assignment 3: Design Principles and Design Patterns Exercise 2.
I have attached the screenshots of a question. Kindly help me with the solution ASAP.
SE450 Assignment 3: Design Principles and Design Patterns Exercise 2. (20 pts) Consider the following code. We have a Manager class which represent a person who manages the workers. Also, we have two types of workers, regular and super efficient workers. Both types of workers works and eats. The company brings some robots which work but don't eat. In order to add this new feature, a developer implements the Worker Interface interface for robots and only uses working behavior. What is the issue with this design? If there is any, which SOLID design principle is violated? You must explain your argument briefly. Also, write the code for your solution (abstract- don't write the method bodies-similar to the problem codes). Please put the codes in the document for this exercise, DO NOT submit as Java file. interface WorkerInterface { } public void work(); public void eat(); class Worker implements Worker Interface{ } public void work() { /* Work */} public void eat() { /* Eat */} class Super Worker implements WorkerInterface { public void work() { /* More work */} public void eat() { /* Eat */}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started