1998Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] OO Design Question -->
<!--X-From-R13: "Penq Zrnpu" <p9608122Nnyvatn.arjpnfgyr.rqh.nh> -->
<!--X-Date: Tue, 10 Nov 1998 16:26:12 &#45;0800 -->
<!--X-Message-Id: 000001be0d09$97298520$a3a7fea9@mythrid -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] OO Design Question</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:c9608122#alinga,newcastle.edu.au">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00813.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00815.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00820.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00815.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00814">Author</A>
&nbsp;|&nbsp;<A HREF="#00814">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00814">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] OO Design Question</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: [MUD-Dev] OO Design Question</LI>
<LI><em>From</em>: "Brad Leach" &lt;<A HREF="mailto:c9608122#alinga,newcastle.edu.au">c9608122#alinga,newcastle.edu.au</A>&gt;</LI>
<LI><em>Date</em>: Wed, 11 Nov 1998 11:24:05 +1100</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
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



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00815" HREF="msg00815.html">[MUD-Dev] Re: OO Design Question</A></strong>
<ul compact><li><em>From:</em> J C Lawrence &lt;claw#under,engr.sgi.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00813.html">[MUD-Dev] ADMIN:  Attributions</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00815.html">[MUD-Dev] Re: OO Design Question</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00820.html">[MUD-Dev] AMIN: Unsubscriptions</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00815.html">[MUD-Dev] Re: OO Design Question</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00814"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00814"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00834" HREF="msg00834.html">[MUD-Dev] JOB: Project manager and scaling/networking guru needed for game project</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 12 Nov 1998, 18:35 GMT
<LI><strong><A NAME="00832" HREF="msg00832.html">[MUD-Dev] MUD clients, testing</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 12 Nov 1998, 17:00 GMT
<LI><strong><A NAME="00827" HREF="msg00827.html">[MUD-Dev] Re: Chemistry [Warning, scientific content]</A></strong>, 
Peck, Matthew x96724c1 <a href="mailto:x96724#exmail,usma.army.mil">x96724#exmail,usma.army.mil</a>, Thu 12 Nov 1998, 07:47 GMT
<LI><strong><A NAME="00820" HREF="msg00820.html">[MUD-Dev] AMIN: Unsubscriptions</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 11 Nov 1998, 18:40 GMT
<LI><strong><A NAME="00814" HREF="msg00814.html">[MUD-Dev] OO Design Question</A></strong>, 
Brad Leach <a href="mailto:c9608122#alinga,newcastle.edu.au">c9608122#alinga,newcastle.edu.au</a>, Wed 11 Nov 1998, 00:26 GMT
<UL>
<LI><strong><A NAME="00815" HREF="msg00815.html">[MUD-Dev] Re: OO Design Question</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 11 Nov 1998, 00:57 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00813" HREF="msg00813.html">[MUD-Dev] ADMIN:  Attributions</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 11 Nov 1998, 00:21 GMT
<LI><strong><A NAME="00805" HREF="msg00805.html">[MUD-Dev] Re: Spell components, chemistry, and the like...</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 10 Nov 1998, 07:12 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00806" HREF="msg00806.html">[MUD-Dev] Re: Spell components, chemistry, and the like...</A></strong>, 
JavaAl <a href="mailto:JavaAl#aol,com">JavaAl#aol,com</a>, Tue 10 Nov 1998, 07:16 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>