HackerNoon Mobile

Better reading experience on the app
Open Closed Principle With Service Locator Patternby@esca
450 reads

Open Closed Principle With Service Locator Pattern

May 20th 2020
3m
by @esca 450 reads
tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Open closed principle is the most simple one in the list of software design principles I understand. "Open for extension, close for modification" - the idea seems quite straightforward. When a new message type comes in, you have to change this class again to support the new type. This approach violates the open closed principle. To deal with this, we use the ServiceLocatorFactoryFactoryBean provided by Spring framework to support new validation without changing the existing code. By this approach, your code will look much cleaner and become easier to maintain.
featured image - Open Closed Principle With Service Locator Pattern
Esca HackerNoon profile picture

@esca

Esca

Receive Stories from @esca

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!