Click here to Skip to main content
14,237,256 members

ATL / WTL / STL

 
GeneralRe: TCP/API class basic design Pin
bkelly139-Nov-14 2:19
memberbkelly139-Nov-14 2:19 
AnswerRe: TCP/API class basic design Pin
Albert Holguin10-Nov-14 4:58
professionalAlbert Holguin10-Nov-14 4:58 
GeneralRe: TCP/API class basic design Pin
bkelly1310-Nov-14 12:40
memberbkelly1310-Nov-14 12:40 
AnswerRe: TCP/API class basic design Pin
Albert Holguin10-Nov-14 16:47
professionalAlbert Holguin10-Nov-14 16:47 
GeneralMultiple threads explained Pin
bkelly1311-Nov-14 6:30
memberbkelly1311-Nov-14 6:30 
GeneralRe: Multiple threads explained Pin
Albert Holguin11-Nov-14 7:01
professionalAlbert Holguin11-Nov-14 7:01 
GeneralRe: Multiple threads explained Pin
bkelly1311-Nov-14 9:58
memberbkelly1311-Nov-14 9:58 
AnswerRe: TCP/API class basic design Pin
pasztorpisti10-Jan-15 11:06
professionalpasztorpisti10-Jan-15 11:06 
In my client and server classes never inherited a common base class. They just used some common components/classes like a socket class, whatever. Often its cleaner and more correct to use composition than inheritance. Over-generalization is usually a bad thing that should be resolved later. I refer with this to the "Core" base class here. I guess "Core" here means a lot of things and you create an "is a" relationship with inheritance between Server and Core and between Client and Core, so basically your server "is a" set of a lot of things that means chaos. In case of simple programs its OK to have not so nice design but if you want to do it correctly then try to isolate components and features that can be correctly named and encapsulated into a class (like Socket). In my networked programs other components that often come to the scene are "Connection", "Channel", "Server-SideClientHandler" or whatever. So instead of inheriting from a common base class I think here its usually nicer to isolate common things into classes and just using those classes from both the server and the client. If I inherited from a common base class in this case than it would probably be a CApplication class or something similar in case of using a framework...

Another little note related to naming convention (although this is a matter of taste): When I have complex names like C_TCP_API_Server I usually remove parts of the name and use them as namespaces. For example in case of C_TCP_API_Server I would probably use a C_Server class that is inside a TCP_API namespace. This is however just style, its up to you how to name and organize things your code. I've already worked on codebases where the usage of namespaces was forbidden as part of the coding conventions.

/off
Fun fact: In my experience the most dangerous classes in object oriented code often have these names: Something-"Manager", Something-"System", Something-"Handler", Something-"Core", ... Big Grin | :-D
/on
QuestionTime of reading text file Pin
econy7-Nov-14 4:24
memberecony7-Nov-14 4:24 
QuestionRe: Time of reading text file Pin
Richard MacCutchan8-Nov-14 21:33
protectorRichard MacCutchan8-Nov-14 21:33 
AnswerRe: Time of reading text file Pin
econy11-Nov-14 2:06
memberecony11-Nov-14 2:06 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 5:42
protectorRichard MacCutchan11-Nov-14 5:42 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 6:56
memberecony11-Nov-14 6:56 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 7:05
protectorRichard MacCutchan11-Nov-14 7:05 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 7:17
memberecony11-Nov-14 7:17 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 7:25
protectorRichard MacCutchan11-Nov-14 7:25 
AnswerRe: Time of reading text file Pin
Aescleal12-Nov-14 6:01
memberAescleal12-Nov-14 6:01 
QuestionOptimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 6:20
memberRaunak Singh Chauhan6-Nov-14 6:20 
AnswerRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 6:45
professionalNicolas Dorier6-Nov-14 6:45 
GeneralRe: Optimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 6:49
memberRaunak Singh Chauhan6-Nov-14 6:49 
GeneralRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 6:56
professionalNicolas Dorier6-Nov-14 6:56 
AnswerRe: Optimized Solution for prime numbers.. Pin
Bernhard Hiller6-Nov-14 22:06
memberBernhard Hiller6-Nov-14 22:06 
Questionget IP address from Net Address Control (Resolved) Pin
bkelly1310-Oct-14 16:06
memberbkelly1310-Oct-14 16:06 
AnswerRe: get IP address from Net Address Control Pin
Richard MacCutchan10-Oct-14 21:18
protectorRichard MacCutchan10-Oct-14 21:18 
GeneralRe: get IP address from Net Address Control Pin
bkelly1311-Oct-14 9:11
memberbkelly1311-Oct-14 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.