I need to create an abstract class for handling logic in my middleware. Right now the middleware is tightly coupled to mongodb and may look to change to a SQL db in the future. As I go, I am finding that the data is more relational than not. So I want to implement an abstract class with methods that mimic the logic of finding users and repair orders. Then create a concrete class that implements the methods. Those class methods should be used in the middleware so that they can be easily swapped out later.
I need to create an abstract class for handling logic in my middleware. Right now the middleware is tightly coupled to mongodb and may look to change to a SQL db in the future. As I go, I am finding that the data is more relational than not. So I want to implement an abstract class with methods that mimic the logic of finding users and repair orders. Then create a concrete class that implements the methods. Those class methods should be used in the middleware so that they can be easily swapped out later.