Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

How would you assess the value of an approach like this?

Answered: 1 week ago