- Fits into the functional programming paradigm.
- Abstracts the complexity of object creation.
- Used to divide system responsibilities.
- Dependency Injection: We should not depend on concrete classes.
rewrite
library: Simulates the database and returns a stub object.
- Isomorphic JavaScript.
- Dynamic interfaces.
- Browser:
index.mjs
- dynamic factory.
The purpose of this pattern is to establish a sequence of methods to be executed, usually within an abstract class.
- Opens and closes connections every time a connection is needed, leading to duplicated code.
-
Frequently used with NestJS. (U use often)
-
Enhances code maintainability by adding behavior to existing methods (e.g., used in a history method).
-
Acts as an interception layer.
-
agent.js emit the interceptor for httpServer for module
- substitute the way that works
-
Not change globally the InjectHttoInterceptor
-
Business case - a service that gonna emit "ticket" for all users (some tickets in banks are emitted differently)
-
Unique signature (compatible for systems)
- Flyweight - dont substituie technics