Great Example of Open Closed Design Principle
I am big fan of pattern pattern article in addition to beloved to read articles on pattern patterns in addition to late wrote almost decorator pattern pattern inwards Java, Observer pattern, static mill pattern in addition to almost Singleton pattern. Today I come upward across this skilful article on opened upward closed pattern pattern, what I similar most is at that spot instance in addition to clear agency of explanation, get-go instance is truthful value in addition to it volition assistance y'all sympathise opened upward closed regulation real rapidly in addition to minute instance is likewise non bad. I convey likewise shared many questions on pattern patterns in addition to Object oriented pattern principles similar 10 Java singleton interview questions , which discusses unopen to of the most mutual questions on Singleton pattern similar how to write Thread-Safe Singleton bird , should nosotros utilization Enum equally Singleton or non etc in addition to xx design pattern interview questions, if y'all are preparing for senior bird Java interview, where questions from pattern is expected, its worth looking for quick review.
10 OOPS in addition to SOLID pattern principles Java programmer should know.
In Simple linguistic communication Open closed pattern principles says that novel functionality should survive added yesteryear introducing novel classes, methods or fields instead of modifying already tried in addition to tested code. One of the agency to arrive at this is Inheritance where bird is extended to innovate novel functionality on overstep of inherited basic features.
In Simple linguistic communication Open closed pattern principles says that novel functionality should survive added yesteryear introducing novel classes, methods or fields instead of modifying already tried in addition to tested code. One of the agency to arrive at this is Inheritance where bird is extended to innovate novel functionality on overstep of inherited basic features.
Benefit or Open Closed Design Principle:
1) Application volition survive to a greater extent than robust because nosotros are non changing already tested class.
2) Flexible because nosotros tin easily conform novel requirements.
How to brand code extensible
Basic regulation of making your code extensible in addition to next opened upward closed regulation is providing object to class at run fourth dimension in addition to making utilization of polymorphism to invoke extended functionality.
If functionality is difficult Coded than it wouldn’t survive extensible exactly if y'all write interface in addition to furnish implementation of that interface at run fourth dimension y'all arrive extensible.
Further Learning
Top thirty UNIX Command Interview Questions Answers