You have to do the last - he will cancel the manager from his delegate. To properly perform the decoupling, you must create an interface that defines the behavior that the manager expects, and then provide the implementation by inverting the control / dependency injection. This will allow you to test the manager and his working class (I called him a delegate, but he may not be isolated).
EDIT - this answer assumes java because you mentioned the servlet.
You have your own manager class, in it you expect an interface
class Manager {
Worker worker;
Manager(Worker worker) {
this.worker = workder
}
}
Worker is an interface. It defines behavior, but not implementation
interface Worker {
public void doesSomething();
}
you need to create an implementation
class WorkerImpl implements Worker {
}
The manager just knows that he has a worker. You can provide any class that implements the interface. This is a denouement - the Manager is not associated with any particular implementation, it is associated only with the behavior of the worker.