From the course: C# Framework Design
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Extend a framework - C# Tutorial
From the course: C# Framework Design
Extend a framework
- [Instructor] Let's go over an example of how we can clean up the object-oriented programming adventure game's action system to be extended so that others can easily build their own. The base Action is an abstract class. This provides the foundation for executing commands that the player enters into the console. But the Actions class, which is responsible for executing actions, is hard coded to the Action class instead of an interface. The Abstract class really doesn't contain any business logic. Even worse, it's confusing with the Actions class that's responsible for executing them. What if we want to create a new command that doesn't extend the Action class? We need to create an interface to decouple our dependence on the Action class and enable our Actions class to accept any command that implements the correct interface. Now let's go back into our object-oriented programming adventure game. You could also follow…