7 messages in com.mysql.lists.plusplusRe: using namespace?
FromSent OnAttachments
Sasha Shipka21 Oct 2004 03:52 
Chris Frey21 Oct 2004 08:48 
Warren Young21 Oct 2004 14:19 
Warren Young21 Oct 2004 14:21 
Chris Frey21 Oct 2004 15:02 
Warren Young21 Oct 2004 20:25 
Sasha Shipka22 Oct 2004 07:38 
Subject:Re: using namespace?
From:Warren Young (mysq@etr-usa.com)
Date:10/21/2004 02:19:58 PM
List:com.mysql.lists.plusplus

Sasha Shipka wrote:

wndGlasila.cc:28: error: `MysqlRow' is not a member of type `Gtk::TreeModel'

Namespaces aren't the solution to this problem. The solution is to remove define_short.hh, and then deal with the consequences of that.

This is on the Wishlist. I suspect it'll break a lot of code, but I really don't give a damn on this one. define_short is one of the worst ideas I've seen in a released library.

So, why don't mysql++ use namespaces instead of macros?

The library uses macros in a vain attempt at hiding the MySQL-ness of the library behind generic names. At one point, the maintainers of this library thought they'd make it work with other databases, so "Row" makes more sense than "MysqlRow", or even Mysql::Row. That dream is now dead, but some of its artifacts are still with us.

Not to deflect your criticism (it's valid), but the fact that you've been bitten by this problem indicates that you're probably trying to mix GUI and database code in a single module. You might rethink your program's design a bit. The first time you need to move to a different database, you'll thank me. :)