MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
[MUD-Dev] OO Design Question
Greetings,
I have a question for the OO designers out there. :-)
Background:
My server is written in C++ and I am trying to design/code it with some
basic OO principles (I haven't had any formal OO training, but I do own
Design Patterns (GoF)).
The server is to be designed as a multi-purpose server. Basically I would
like to have a standard server class that has other specific servers derived
from this (e.g. AServer is the base for MudServer, TelnetServer, WebServer,
etc) [Note: I havent evaluated if this is feasable yet - its just a wild
idea in relation to reuse].
My question is this: Should the "Server" object be started (via a public
"startup" function) and look after everything (Method "A") or should the
main() function look after the specific's of calling AServer::Init(),
AServer::MainLoop(), etc (Method "B").
For instance, in method A, the code would be something like:
int main( /* args */ )
{
AServer * server;
server = new AServer( /* args */ );
server.Startup( /* args */ );
}
In method B, the code would be something like:
int main( /* args */ )
{
AServer * server;
server = new AServer( /* args */ );
server.Init();
while ( server.IsUp() )
{
server.CheckNewConn();
server.Input();
server.UpdateEvents();
server.Output();
server.UpdateTime();
}
server.cleanup();
}
I hope that explains the question. It is quite difficult to express my
thoughts in words at the moment. :-)
Thanks in advance,
-Brad
- Thread context:
- [MUD-Dev] JOB: Project manager and scaling/networking guru needed for game project,
J C Lawrence claw#under,engr.sgi.com, Thu 12 Nov 1998, 18:35 GMT
- [MUD-Dev] MUD clients, testing,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Thu 12 Nov 1998, 17:00 GMT
- [MUD-Dev] Re: Chemistry [Warning, scientific content],
Peck, Matthew x96724c1 x96724#exmail,usma.army.mil, Thu 12 Nov 1998, 07:47 GMT
- [MUD-Dev] AMIN: Unsubscriptions,
J C Lawrence claw#under,engr.sgi.com, Wed 11 Nov 1998, 18:40 GMT
- [MUD-Dev] OO Design Question,
Brad Leach c9608122#alinga,newcastle.edu.au, Wed 11 Nov 1998, 00:26 GMT
- [MUD-Dev] ADMIN: Attributions,
J C Lawrence claw#under,engr.sgi.com, Wed 11 Nov 1998, 00:21 GMT
- [MUD-Dev] Re: Spell components, chemistry, and the like...,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Tue 10 Nov 1998, 07:12 GMT
[ Other Periods
| Other mailing lists
| Search
]