Thread: Re: comment on pgAdminIII source

Re: comment on pgAdminIII source

From
"Dave Page"
Date:

> -----Original Message-----
> From: Knut P. Lehre [mailto:k.p.d.lehre@basalmed.uio.no]
> Sent: 16 April 2003 14:12
> To: Dave Page
> Subject: comment on pgAdminIII source
>
>
> I'm sending this email to you in lack of an address of a pgadminIII
> developer mailing list. If such a list exists I would
> acknowledge receiving
> the address so that I can post my comments there.

The list is pgadmin-hackers@postgresql.org (I've CC'd this there).

> I downloaded the pgAdminIII source code today (2003.04.16
> about midday
> CETime) from http://cvs.pgadmin.org/cgi-bin/viewcvs.cgi/pgadmin3/src/
> looking for coding examples for postgres schema manipulation.

OK.

> 1) Several of the the pg..... classes (like pgConn,
> PgDatabase etc) are
> bound to wxWindows classes including wxFrame. It would have
> been nice if
> the classes communicating directly with postgres were
> independent of GUI
> framework, so that they more easily could be reused in other
> projects.

Well pgConn is not derived from anything, and as far as I can see at a
glance (it's a while since I wrote it or worked on it) uses only a few
wxWindows classes such as wxString and wxLog itself.

pgDatabase is derived from wxTreeItemData and needs to be to attach to
treeview nodes.

Please remember, we are not trying to develop code for others to take
and use in their own projects (though you are welcome to do so subject
to the licence), but we are developing a program with a specific purpose
and that will always be our primary concern.

> A
> similar comment/question could be: why not use the libpq++ classes in
> pgAdminIII?

Because libpq++ is deprecated and I considered libpqxx to be overkill
for our needs. pgConn, pgSet and pgQueryThread do pretty much all we
need without requiring another project dependency.

> 2) In the pqServer class, code has been added in the
> ctor/dtor (conn =
> NULL;   if (conn) delete conn;) (Keith 2003.03.05) to prevent
> memory leaks.
> However, in "pgServer::Connect(...)" a delete appears to be
> missing before
> "conn = new pgConn(...);".

As far as I can see, if conn is a valid pgConn object then it will never
get to that code anyway.

Or am I misunderstanding what you are saying?

Regards, Dave.