Dependency Injection
Design Pattern, where Dependency are injection from the outside of the component rather than the inside
Goal is to achieve Inversion of Control, rather than main method the framework or container manages the dependecies
Easier testing by mocking depedencies, more flexible to swap components and more readable
Singleton
Only one instance of a class -> global state
Global Access aswell
Only created when first needed
When to use: Logger, Database Connection, Cache Manager
Factory
Design Pattern, with an interface for the superclass and subclass to alter the superclass, ofthen with a factory method
Promotes loose coupling and encapsulation of the classes
Static Methods
Belongs to a class rather than an instance
Last changed7 months ago