Jay Pipes wrote:
> Hi friends, please evaluate the proposal below.
> 
> PROPOSAL: Use namespaces effectively and organize drizzled/ directory by
> functional unit
> 
> I'd like to be able to use C++ namespaces in order to better organize
> the code in the main drizzled/ server source code directory.  Here is a
> proposed naming convention for the namespaces.

I have no opinions on the use of capital letters or not for namespaces.

However, please observe that namespaces are more than a way to structure the
code in a tree, it also introduces a namespace for name lookups, so functions
that operate on entities in a namespace should be in the same namespace.
Otherwise, name lookup will behave strange and even run the risk of finding the
wrong function.

Basically, no function prototype should have references to entities in another
namespace.

> 
> namespace Drizzled
> 
> Anything in the /drizzled directory
> 
> namespace Drizzled::Serialize
> 
> Anything in the drizzled/serialize/ directory (the Google Proto Buffer
> code and classes)
> 
> namespace Drizzled::Replication
> 
> All replication stuff, to be moved out of the main drizzled/ directory
> and into a subdirectory named drizzled/replication/
> 
> namespace Drizzled::SQL
> 
> Classes and code corresponding to the execution of specific SQL commands
> -- files such as sql_table.cc, sql_select.cc, etc...
> 
> namespace Drizzled::Optimizer
> 
> Classes and code for the optimizer -- files such as opt_range.cc,
> opt_sum.cc, and eventually a whole lot more after it gets refactored
> into non-spaghetti
> 
> namespace Drizzled::Item
> 
> The Item_XX classes.  Move item_ classes into /drizzled/item
> 
> namespace Drizzled::Item::Field
> 
> The Item_field classes.  Move the directory drizzled/field/ under
> drizzled/item/field/

I don't think you need to separate the fields into a separate namespace since (I
assume) that functions in the Item namespace will operate on entities in the
Item::Field namespace.

> 
> namespace Drizzled::Plugin
> 
> All code for the server's plugin API, to be put in /drizzled/plugin/
> 
> namespace Drizzled::Parser
> 
> All parser/lexer code, to be moved into drizzled/parser/
> 
> I think that moving to such a directory structure and namespace
> organization will be helpful for developers to better organize code (in
> their heads) and also may help if certain functionality will eventually
> be made into a stand-alone library (for instance /drizzled/parser/
> ->libdrizzleparse)
> 
> Just some thoughts.  Bad idea?  Advice/suggestions welcome.
> 
> Cheers,
> 
> Jay
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp

-- 
Mats Kindahl
Lead Software Developer
Replication Team
MySQL AB, www.mysql.com
begin:vcard
fn:Mats Kindahl
n:Kindahl;Mats
org:Sun Microsystems
adr;quoted-printable:;;Tegv=C3=A4gen 3;Storvreta;SE;74334;Sweden
email;internet:[EMAIL PROTECTED]
title:Lead Replication Software Developer
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to