Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#11121) RFC: modularity in freeciv
Home

[Freeciv-Dev] (PR#11121) RFC: modularity in freeciv

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11121) RFC: modularity in freeciv
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Nov 2004 19:19:46 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11121 >

Every now and then someone comes along with a grand scheme, or more 
likely a vague idea for a grand scheme, to make Freeciv's code modular.

Well, this isn't one of those.  I do think Freeciv needs to be more 
modular.  The problem is that the problem is too large to even come up 
with a solution!  What we need is some guidelines so that we can make 
things somewhat more modular while we figure out the real scope of the 
problem.  Eventually we should have a full-fledged design.

So, the guideline is this: Freeciv should be split up into modules, 
which depend on as few other modules as possible.  We should aim for a 
strict hierarchy of modules where no module depends on a module "above" 
it (although this may not be possible).

We already have a few candidates for such modules: utility, common, 
client, server, ai, and generator.  However the boundaries between these 
modules are blurred.  For instance the common code depends on some 
variables and functions in client and server!  The generator no doubt 
depends on server and ai functions.  And the server and ai are so 
intertwined they are basically one giant module.  So a good place to 
start would be from the bottom up, by fixing common to be an independent 
module that depends only on utility.

Why do we want Freeciv code to be modular?  Aside from general 
maintainability and elegance, it is pretty much a prerequisite for 
adding new modules.  Anyone who has ever looked at the civworld code has 
probably seen how ugly its interface is.  This is because it links to 
both client and server code.  But because there is no clean separation 
of dependencies, this requires changing those modules (particularly the 
client) as well as filling out stub functions to provide 
unused-but-required features that are normally provided by other modules.

jason





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11121) RFC: modularity in freeciv, Jason Short <=