Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-10-09 02:07:06


On Tuesday 09 October 2007 02:54:38 Jurko Gospodnetic' wrote:
> Hi.
>
> > OTOH, keeping everything as just globals is slightly easier to code.
> > Anybody can comment, better with practical concerns, which approach
> > is better?
>
> Not a Python expert or all that versed in Boost Build internals but
> when I have such a dilemma in our programs we usually go with a single
> globally accessible context singleton holding all such data. Its allows
> the same simple/fast coding style as raw global data but also allows
> relatively low cost transition to multiple contexts if and when that
> becomes necessary.
>
> We recently had to transform a single-user application to a
> multiple-user server application. User context was extracted in such a
> way and the transformation was incredibly smooth.
>
> I'd recommend going with multiple context support at once only if you
> have an actual use case already planned for the initial release.

What I'm gonna do, I think, is using "contexts" for core functionality
(features, projects, targets). Then, accessor functions will be
provided to get the singleton instances of said, and the tools
level will use that.

The reason is that while on core level, I can imagine some
use of several instances of main classes (like testing), for tools,
now, it seems like annoyance.

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk