You are designing business layer classes by using the .NET Framework 3.5 and Microsoft SQL Server 2008.
The business classes will be used by a banking application. The class diagram for the business classes is as shown in the exhibit. (Click the Exhibit button.)
You need to ensure that the application meets the following requirements:
– Users are allowed to select only one of the three operationswithdraw, deposit, and get balance.
– Access to other members of the business objects is disallowed.
– Future types of accounts can be handled.
– Use of the operations directly from the class is disallowed.
– Child classes inherited from the business layer classes are prevented from overriding these operations. What should you do?
A.
Create a new abstract class. Add the Deposit, Withdraw, and GetBalance methods to the new class.
Change the BankAccount and CreditCard classes to inherit from the new class.
Use the abstract class to handle operations to any object in the bank hierarchy.
B.
Create a new concrete class.Add the Deposit, Withdraw, and GetBalance methods to the new class.
Change the BankAccount and CreditCard classes to inherit from the new class.
Use an instance of the concrete class to handle operations to any object in the bank hierarchy.
C.
Create a new interface.Add the Deposit, Withdraw, and GetBalance methods to the new interface.
Change the BankAccount and CreditCard classes to explicitly implement the members of the new interface.
Use the interface to handle operations to any object in the bank hierarchy.
D.
Create a new interface.Add the Deposit, Withdraw, and GetBalance methods to the new interface.
Change the BankAccount and CreditCard classes to implicitly implement the members of the new interface.
Use the interface to handle operations to any object in the bank hierarchy.