News for hackers. Stuff that matters.
Re:Why you should never ever ever have Managers in your clas... by BIackSwan on Sunday March 31, 2013 @08:11PM (#5470759)
You can create a ConnectionPool class with the relevant logic to manage Connections. If you want multiple pools (which you might connect to different servers ;) ) you just instantiate multiple ConnectionPools.

ConnectionPool makes you think of it as an actual object. ConnectionManager makes you think of this all encompassing thing that handles/manages anything that is Connection related.

Re:Why you should never ever ever have Managers in your clas... by joe_the_user on Sunday March 31, 2013 @08:28PM (#5470799)
The Connection Manager in QT, for example, is not a Connection Pool. It's more of an interface to get at all the classes that represent real things within a connection process (requests, responses, active connections, etc). There is no information in the Connection Manager except system/process defaults. The Connection Manager would create connection pools if that is what's needed but it isn't Connection Pool any more than it is a connection.

That said, I sympathize with the impulse that the term "manager" says there's something wrong in your OO design. It is simply that determining how to get around the problem is hard.

Re:Why you should never ever ever have Managers in your clas... by neeharc on Sunday March 31, 2013 @08:35PM (#5470820)
The point that is being made is to make sure that the name of the class makes its responsibilities clear. The problem with the term "manager" or "handler" is that it leaves things ambiguous.
Re:Why you should never ever ever have Managers in your clas... by mkmkmmmmm on Sunday March 31, 2013 @08:52PM (#5470860)
ConnectionPool makes me think of a collection of reusable connections that I can borrow from to talk to a server without the overhead of creating an object and opening a socket, it doesn't make me think of managing at all. Maybe I am doing it wrong?

I'm just hoping for a discussion, this is an important topic for me as a developer.

Re:Why you should never ever ever have Managers in your clas... by BIackSwan on Sunday March 31, 2013 @08:57PM (#5470875)
You got it right. Thats exactly what it should be doing. If you have additional requirements you might want to create another class for that requirement or rename it to something else.
Re:Why you should never ever ever have Managers in your clas... by mkmkmmmmm on Monday April 01, 2013 @01:13AM (#5471575)
That seems like an incredibly appropriate class name, then. I'm glad I wasn't missing something :)
Re:Why you should never ever ever have Managers in your clas... by robryan on Sunday March 31, 2013 @08:24PM (#5470793)
You still might want a connection manager to contain your connection pools. Or even call it a messages or something, so at the relevant point in the code you just call a send function and aren't exposed to any underlying details of connections.
Re:Why you should never ever ever have Managers in your clas... by Evbn on Sunday March 31, 2013 @10:56PM (#5471198)
Specifically, what is the class doing with those pools? "Managing" is vague.
Re:Why you should never ever ever have Managers in your clas... by drivebyacct2 on Sunday March 31, 2013 @08:35PM (#5470822)
Exactly, it's description of the name of the object, rather than trying to be descriptive of what it does. AutomaticallyRetryingConnectionManager or ConnectionPool{.ConnectWithRetry,etc}
Re:Why you should never ever ever have Managers in your clas... by Evbn on Sunday March 31, 2013 @10:54PM (#5471191)
You mean "pool connections" not "manage connections".