Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 1 [ 1 5 points ] Table 1 shows the difference between decorator pattern and Inheritance. Please write which label ( Decorator , Inheritance
QUESTION points Table shows the difference between decorator pattern and Inheritance. Please write which label DecoratorInheritance the columns belong to Table Used to extend the functionality of a particular object.,Used to extend the functionality of a class ofobjectsDoes not require subclassing.,Requires subclassing.DynamicStatic.Runtime assignment of responsibilities.,Compile time assignment of responsibilities.Prevents the proliferation of subclasses leading to lesscomplexity and confusion.Could lead to numerous subclasses, explodingclass hierarchy on specific occasions.More flexible.,Less flexible.Possible to have different decorator objects for a givenobject simultaneously. A client can choose whatcapabilities it wants by sending messages to anappropriate decorator.Having subclasses for all possible combinations ofadditional capabilities, which clients expect out ofa given class, could lead to a proliferation ofsubclassesEasy to add any combination of capabilities. The samecapability can even be added twice.Difficult.QUESTION points Table shows the difference between decorator pattern and Inheritance. Please write which label DecoratorInheritance the columns belong to Table Used to extend the functionality of a particular object. Used to extend the functionality of a class of objects. Does not require subclassing. Requires subclassing. Dynamic. Static. Runtime assignment of responsibilities. Compile time assignment of responsibilities. Prevents the proliferation of subclasses leading to less Could lead to numerous subclasses, exploding complexity and confusion. class hierarchy on specific occasions. More flexible. Less flexible. Possible to have different decorator objects for a given Having subclasses for all possible combinations of object simultaneously. A client can choose what capabilities it wants by sending messages to an appropriate decorator. additional capabilities, which clients expect out of a given class, could lead to a proliferation of subclasses. Easy to add any combination of capabilities. The same capability can even be added twice. Difficult.
QUESTION points Table shows the difference between decorator pattern and Inheritance. Please write which label DecoratorInheritance the columns belong to Table Used to extend the functionality of a particular object.,Used to extend the functionality of a class ofobjectsDoes not require subclassing.,Requires subclassing.DynamicStatic.Runtime assignment of responsibilities.,Compile time assignment of responsibilities.Prevents the proliferation of subclasses leading to lesscomplexity and confusion.Could lead to numerous subclasses, explodingclass hierarchy on specific occasions.More flexible.,Less flexible.Possible to have different decorator objects for a givenobject simultaneously. A client can choose whatcapabilities it wants by sending messages to anappropriate decorator.Having subclasses for all possible combinations ofadditional capabilities, which clients expect out ofa given class, could lead to a proliferation ofsubclassesEasy to add any combination of capabilities. The samecapability can even be added twice.Difficult.QUESTION points
Table shows the difference between decorator pattern and Inheritance. Please write which
label DecoratorInheritance the columns belong to
Table
Used to extend the functionality of a particular object.
Used to extend the functionality of a class of
objects.
Does not require subclassing.
Requires subclassing.
Dynamic.
Static.
Runtime assignment of responsibilities.
Compile time assignment of responsibilities.
Prevents the proliferation of subclasses leading to less
Could lead to numerous subclasses, exploding
complexity and confusion.
class hierarchy on specific occasions.
More flexible.
Less flexible.
Possible to have different decorator objects for a given
Having subclasses for all possible combinations of
object simultaneously. A client can choose what
capabilities it wants by sending messages to an
appropriate decorator.
additional capabilities, which clients expect out of
a given class, could lead to a proliferation of
subclasses.
Easy to add any combination of capabilities. The same
capability can even be added twice.
Difficult.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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