Question: 1. What is the OODP ? class Client { Component comp; } class Component { public void op1 () {...} public void op2() {...} }

1. What is the OODP ? class Client { Component comp; } class Component { public void op1 () {...} public void op2() {...} } class Leaf extends Component { public void op1 () {...} public void op2() {...} } class Branch extends Component { Set compSet; public void op1 () {...} public void op2() {...} } Component represents a base class (or possibly an interface) for primitive objects, and Branch represents a Branch class. For example, the Component class might represent a base class for graphic primitives, whereas the Branch class might represent a Drawing class. Leaf class represents a concrete primitive object; for example, a Line class or a Text class. The Operation1() and Operation2() methods represent domain-specific methods implemented by both the Component and Branch classes. The Branch class maintains a collection of components. Typically, Branch methods are implemented by iterating over that collection and invoking the appropriate method for each Component in the collection. Component represents a base class (or possibly an interface) for primitive objects, and Branch represents a Branch class. For example, the Component class might represent a base class for graphic primitives, whereas the Branch class might represent a Drawing class. Leaf class represents a concrete primitive object; for example, a Line class or a Text class. The Operation1() and Operation2() methods represent domain-specific methods implemented by both the Component and Branch classes. The Branch class maintains a collection of components. Typically, Branch methods are implemented by iterating over that collection and invoking the appropriate method for each Component in the collection.

Facade, Prototype, Singleton, Flyweight, Composite ,Bridge

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!