From: Snowdog <sn...@ga...> - 2006-06-15 19:06:05
|
Mark Tarrabain wrote: > I was noticing that the following classes should probably be refactored > from the openrpg2.common.core.network package and into packages that are > specific to either the client or the server, as appropriate. > > NetworkAcceptThread, NetworkServer, NetworkServerModule, > NetworkServiceThread, and NetworkThreadPool do not seem to get used by > the client. Similarly the NetworkClient and NetworkClientModule classes > do not seem to get used by the server. > You are correct the client and server portions do not interact. They reside in the same core package due to visibility constraints that are required to prevent outside (i.e. non core.network) classes from direct access to classes/objects on which both the client and server network code depend. To move those classes you mentioned above to a new package would require visibility changes (i.e. from private to public) that could compromise the 'black-box' of the OpenRPG2 network layer. This is an example of 'defensive' programming; the network layer is essentially only accessible through the NetworkClient and NetworkServer objects and their respective APIs. Initially those classes were in separate packages (outside of the core package) however as the network came together it made more and more sense to migrate them into a single package even if a tad counter intuitive. The lesser of two evils IMO. --Snowdog |