Sign in to follow this  
stodge

ClientConnection and ServerConnection class names.... quick poll.

Recommended Posts

I keep scratching my head over this one. Given class names ClientConnection and ServerConnection, would you: a) Assume the connections are TO a client and a server respectively? b) Assume the connections are FROM a client and a server respectively? Perhaps not a big deal to most people, but which makes more sense to you? Thanks

Share this post


Link to post
Share on other sites
If it's a ClientConnection, I'd suspect it's on the server, connecting to a client. If it's a ConnectionClient, then I'd suspect it's on a client, connected to a server. However, in either case, I'd verify with the code to make sure -- you can never assume these things.

Share this post


Link to post
Share on other sites
It's my code so I can choose. :)

I always confuse myself when I forget my original design intention when returning to look at the code - I don't have much time so it's usually several days before I can work on it again. So I was wondering which seemed more logical to other people.

I typically think the reverse - a ClientConnection is a connection to a client, while a ServerConnection is one to a server.

Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'd guess that they're connections to a client or a server. Kinda confusing...

I think you'd be better off naming them like this:

CClient - Object represents a client
CServer - Object represents a server

CClient::Connection (or socket, etc.) - the actual connection to a server
CServer::ClientList - a list of connections to clients

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this