-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Labels
awaiting infoinformation is requestedinformation is requested
Description
Service Locator is it's actually an anti-pattern and should be avoided.
the problem with Service Locator is that it hides a class' dependencies, causing run-time errors instead of compile-time errors, as well as making the code more difficult to maintain because it becomes unclear when you would be introducing a breaking change.
Service Locator violates SOLID:
Violates the Interface Segregation Principle (ISP). That's because a Service Locator effectively has infinitely many members.
Service Locator violates encapsulation:
Violates encapsulation in statically typed languages because it doesn't clearly communicate preconditions.
Bwolfs2
Metadata
Metadata
Assignees
Labels
awaiting infoinformation is requestedinformation is requested