The most common solution to this problem is using a Factory Method to
return the correct implementation of the interface. Your classes should
never know which implementation is in use because they will all ask the
Factory Method for the object. You just need to change the one line in
the
The most common solution to this problem is using a Factory Method to
return the correct implementation of the interface. Your classes should
never know which implementation is in use because they will all ask the
Factory Method for the object. You just need to change the one line in
Alternatively,
If you are worried about test code in production, you could extend from
ConnectionHandlerFactory with a TestConnectionHandlerFactor and override
the getConnectionHandler() method to return the connectionHandler for
testing.
James
James CE Johnson wrote:
The most common
3 matches
Mail list logo