|
Boost : |
From: Calum Grant (calum_at_[hidden])
Date: 2005-09-27 17:05:14
> -----Original Message-----
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Larry Evans
> > Is there any interest in providing relational containers in Boost?
> > Are there any features/improvements you can suggest for RML?
> http://visula.org/relational/implementation.html contains:
>
> The reason this has to be a macro is because it needs to work with
> names, not just types. It was felt that the benefits of
> being able to
> write customer.name or customers.name instead of
> column<1>(customers)
> or col<1,1>() outweighs the inherent disadvantages of
> using a macro.
>
> why not use an enumerator:
>
> column<name>(customers)
>
> instead of a number:
>
> column<1>(customers)
>
> ? Would this eliminate the macro need?
An early RML did use tuples indexed in the way you describe. I did use
enums - writing magic numbers is very bad for readibility and
maintainability. Personally I prefer to read
customers.name
instead of
column<name>(customers)
There is also a big problem with enums - being able to associate the
correct enum with the correct type. I.e. the "name" column may be 2 for
customers, and 3 for products. So you really need
column<customer_name>(customers) and column<product_name>(product).
Calum
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk