title: Thought on Code to Interface in Spring?
body: <p>I know in spring we all code to interface. So the implementation class should not be known to outside world at all. But it is a public class so anyone make an instance of the implementation class also. How do you prevent this? Do you make the constructor private? Since spring creates an instance of through reflection, it should be fine. Has anybody put any thought on it? I know if you make an instance of the implementation class it will not work properly because dependencies are all <code>null</code>, but that is beside the point.</p>