Question
Consider the following scenario There is a Class called Scientific experiments that has a method called Analyse which accepts an array of integers as input
Consider the following scenario
There is a Class called Scientific experiments that has a method called Analyse which accepts an array of integers as input and returns their Accuracy of Integers, as output Now, an improved version of Scientific-experiments class called New Scientific-experiments has been released and Scientific-experiments has been withdrawn In this version, the 'Analyse method takes one more input parameter called Type of analysis it Type of analysis=1, the method returns Accuracy of integers if Type of analysis=2 then it returns the Precision of the experiments
a) Which Design Pattern will you sise to protect the calling programs from further changes to Scientific experiments class. We do not wish to change the calling programs.
b) Explain in detail why you have chosen to use this design pattern
c) Explain with me help of class dagram & pseudo code, the solution to protect the calling program from changes to 'Scientific experiments' Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a The Design Pattern suitable for this situation would be the Adapter Pattern b The Adapter Pattern works as a bridge between two incompatible interfa...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