Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the entire hierarchy of The Revengers. Apply the Composite design pattern to the hierarchy like: Level 1 : The Revengers, Level 2 : The

Consider the entire hierarchy of The Revengers. Apply the Composite design pattern to the hierarchy like:
Level 1: The Revengers,
Level 2: The Magician, Avon The Slayer and Manic the Mayhem.
Level 3(actions): The Magician (Disappear, Fly), Avon The Slayer (Fight), Manic The Mayhem (Run fast, Unbreakable).
You can refer to the following 3 steps for implementing the solution:
1. Create the Abstract class which initialises the superhero list
2. Create a directory which implements the abstract class which adds a particular superhero to the directory
3. Create the Composite pattern class which has the main class that takes the input for the 3 levels of abstraction

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions