Question: Question 4 Consider the following code to answer below questions Not yet answered Marked out of 10.00 public abstract class DbCommand { public abstract DbDataReader


Question 4 Consider the following code to answer below questions Not yet answered Marked out of 10.00 public abstract class DbCommand { public abstract DbDataReader ExecuteReader(); ... // other methods not needed } P Flag question public abstract class DbDataReader {...} public class SqlCommand extends DbCommand { public override DbDataReader ExecuteReader() { SqlDataReader reader; ... Il rest of the code return reader; } } public class SqlDataReader extends DbDataReader {...} public class OracleDbCommand extends DbCommand { public override DbDataReader ExecuteReader() { OracleDbDataReader reader; ... // rest of the code return reader; } oublic class Aracle Date Deader extendebate Dender public abstract class DbDataReader {...} public class SqlCommand extends DbCommand { public override DbDataReader ExecuteReader() { SqlDataReader reader; ... Il rest of the code return reader; } } public class SqlDataReader extends DbDataReader {...} public class OracleDbCommand extends DbCommand { public override DbDataReader ExecuteReader() { OracleDbDataReader reader; ... Il rest of the code return reader; } } public class OracleDbDataReader extends DbDataReader 1. (2 points) What is the pattern used in the above code? 2. (6 points) For each class and based on your answer in 1, specify the role of each class in the pattern? 3. (2 points) Is the design flexible? show how to add new concrete class of type DbDataReader
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
