Style/Structuring question: One vs. multiple global objects

Deewiant deewiant.doesnotlike.spam at gmail.com
Mon Jul 2 12:09:56 PDT 2007


Henning Hasemann wrote:
> Well the dependency-inversion thingy I found 
> (http://www.objectmentor.com/resources/articles/dip.pdf) was really 
> enlightning, maybe it helps you too. The basic idea is to misuse interfaces
> to simulate some of the benefits of C++'s header files.

It incurs runtime penalties and makes the code too cluttered, IMHO.

One thing I came up with was doing the "tile_and_entity.d" like so:

module tile_and_entity;

mixin(import(tile.d));
mixin(import(entity.d));

Should work, but quite hacky.

-- 
Remove ".doesnotlike.spam" from the mail address.


More information about the Digitalmars-d-learn mailing list