From the course: Secure Coding in Java

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Extensibility

Extensibility - Java Tutorial

From the course: Secure Coding in Java

Start my 1-month free trial

Extensibility

- [Instructor] Extensibility is a core concept of object oriented programming languages. Inheritance and composition are critical to this style. However, sometimes that extensibility can allow you to expose yourself to security risks. When dealing with class and method extensibility in Java, you need to work within the guidelines of the language itself, and in doing so, you need to put some time into design. Designing of classes needs to take into account the Java inheritance model. You need to be cognizant of the effects of extending your class and what power that gives somebody, your consumer, or worse yet, a bad actor can leverage the ability to extend your class to use it to leak data, or impact the systems negatively. Better yet, when working with code that will be consumed, consider using final modifiers on the classes themselves. This will allow you to not only protect your classes as we have previously discussed,…

Contents