Chapter 3: Base Class by Chris Pitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 3

images

Base Class

One of the excellent things about building an MVC framework, using OOP paradigms, is the ability for us to reuse code, with minimal effort. At any time, we might be required to add core functionality to the majority of our classes, and a good OOP base will help us to do this.

Imagine we build an application with our newly built framework, and we suddenly need to add new security measures across the whole application. We could make changes to every controller, invoking a repeated function, or referencing a shared function, but the best solution would be to add the shared functionality higher up the inheritance chain.

If all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required