Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2+3 6 1. (a) What are the main components of OOP? Explain the statement classes should be open for extension and closed to modification with
2+3 6 1. (a) What are the main components of OOP? Explain the statement classes should be open for extension and closed to modification with proper example. (b) Indicate for each case which design pattern you will use if you intend to: i. Be able to replace the implementation of an interface at run time. ii. Decouple clients of a system X from dependencies on subsystems of X. iii. Provide clients with a reference to an object of type X, but defer the creation of an expensive object of type X until it is needed. iv. Define a new operation without changing the classes of the elements on which it operates. Used to restore state of an object to a previous state. vi. Promote "invocation of a method on an object". (c) Explain a scenario where Builder pattern can be used. Write the corresponding code for that scenario. Also, draw the UML diagram for that scenario. V. 4+5+5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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