What I need to do is connect to an LDAP, and then pass this connection to several classes, which do various steps of processing.
The problem I face is if I should pass the connection to these classes via the constructor, or if every class should manage his own connection.
The problem I see with the first approach is that the caller may not know that he is responsible for closing the stream by itself. The second approach also doesn't seem appropriate because opening/closing/reopening the connection also makes no sense.
Any ideas on this?