I have been doing research on the factory design pattern and was wondering if the below example, while not “textbook” is technically a correct use of it. Is there another design pattern that may fit the situation better? Answer IMO: Looks like the given code example actually implemented the Factory Method pattern with using the Method Object solution https://refactoring.guru/replace-method-with-method-object. Because
Tag: factory
How to make a class’s constructor unit testable when its instantiating a Guice module in it?
I have the below mentioned class in a library module, which the clients will use to interact with database. I have a public constructor that takes a parameter from the user of this library, but the problem with this is that, its a Guice module getting instantiated inside this constructor. So when I try to write a unit test for