Question: True or False : 1)The Composite design pattern is useful when the number of possible structures of interests are large. 2)The Composite Design pattern will
True or False :
1)The Composite design pattern is useful when the number of possible structures of interests are large.
2)The Composite Design pattern will force the clients to treat individual objects and compositions of objects differently.
3)One way to design adding the primitive objects (e.g. a Line object in the example introduced during the lecture) to the composite is through the composite constructor
4)When using the Decorator design pattern, one primitive object (e.g. a Line object in the example introduced during the lecture) can only be decorated once.
5)The design of Decorator and Composite introduced during the lecture primarily replies on inheritance (subclasses) to achieve their objectives.
6)Sequence diagrams are used to model certain design decisions related to object call sequences. They model the dynamic perspective on a software system as object diagrams do.
7)In a sequence diagram, the activation box (i.e. the white vertical bar overlaid on the lifeline of one object) represents the time when a method of the corresponding object is on the execution stack.
8)In OO design, composition is commonly used to represent a collection of other abstractions or to break down complex functionalities and delegate them to specialized classes.
9)To copy an object polymorphically, one common way is to use the copy constructor, which allows the client to pass the object as an argument.
10)In Java, the clone() method is defined in the Object class. When implementing the Cloneable interface, you should override the clone method in your own class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
