What should you do?

You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application contains several classes.
A code review reveals redundant business logic within the classes in the application.
You need to eliminate the redundant business logic in the classes. What should you do?

You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application contains several classes.
A code review reveals redundant business logic within the classes in the application.
You need to eliminate the redundant business logic in the classes. What should you do?

A.
Implement a newly created interface in the related classes.
Move the shared declarations to the interface.

B.
Create an abstract base class and inherit the classes from the base class.
Move the duplicated properties and behaviors into the base class.

C.
Create a nested public class within each of the related classes.
Encapsulate the shared properties and behaviors in the public class.
Use the nested public class in the parent classes.

D.
Create a nested private class within each of the related classes.
Encapsulate the shared properties and behaviors in the private class.
Use the nested private class in the parent classes.



Leave a Reply 0

Your email address will not be published. Required fields are marked *