Reading notes for class 6 of 401
Authentication
Explain what a “Singleton” is (in Computer Science terms)
A software design pattern that restricts the instantiation of a class to one “single” instance.
Explain how the Singleton pattern can be used with Node modules, specifically with classes
Add a constructor to a class. Within the constructor, check and see if an instance has already been created. If there’s not an instance, create one. Return that instance using a get instance method.
Vocab
Router Middleware
- Router middleware works the same as application middleware, except it is bound to an instance of express.Router()
Dynamic Module Loading
- Dynamic loading is a mechanism by which a computer program can, at run time, load a library (or other binary) into memory, retrieve the addresses of functions and variables contained in the library, execute those functions or access those variables, and unload the library from memory.
Singleton Pattern
- A software design pattern that restricts the instantiation of a class to one “single” instance
CRUD -> REST Method Matches
- DELETE / delete
- UPDATE / put
- READ/ get
- CREATE / post
Mock Testing
- Creating a fake version of an external or internal service that can stand in for the real one, helping your tests run more quickly and more reliably.