Question: In the previous segment on Factory pattern, you created a superhero called The Magician from The Revengers team. You applied the Factory pattern to assign

In the previous segment on Factory pattern, you created a superhero called The Magician from The Revengers team. You applied the Factory pattern to assign certain actions to the superhero. Let us continue the same example and try to assign certain features to The Magician.
You have to assign name, suitType, weapon, eye color, numberOfActions to all the superheroes from The Revengers.
This will be achieved thrugh 3 major steps:
1. Create the Revenger class which will call the Builder functions
2. Create the Builder class which will define all the major features of the superhero
3. Write the client code
Before applying the Builder pattern, the client code will look like this:
public TheRevenger(String name, SuitType suitType, Weapon weapon, EyeColor eyeColor, NumberOfActions numberOfActions){
}

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 Databases Questions!