X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CCE883A2B36 for ; Fri, 29 Oct 2004 17:58:12 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96001-07 for ; Fri, 29 Oct 2004 16:58:06 +0000 (GMT) Received: from mail.logi-track.com (www.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 9F4613A2B1B for ; Fri, 29 Oct 2004 17:58:05 +0100 (BST) Received: from kingfisher.intern.logi-track.com (J0b0d.j.pppool.de [85.74.11.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 18CBE3016C; Fri, 29 Oct 2004 18:58:07 +0200 (CEST) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id 7A97016E15F; Fri, 29 Oct 2004 18:57:59 +0200 (CEST) Date: Fri, 29 Oct 2004 18:57:58 +0200 From: Markus Schaber To: pgsql-jdbc@postgresql.org Subject: Re: PGobject overhaul (was Re: tightening up on use of oid Message-ID: <20041029185758.0ae72196@kingfisher.intern.logi-track.com> In-Reply-To: <418056E5.9060601@opencloud.com> References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <416E5B40.1060901@opencloud.com> <418056E5.9060601@opencloud.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > - Implementations of PGobject should provide a ctor taking a single=20 > String; this is called by the driver to construct non-null objects. Is it possible to use a static factory function instead? This would make it possible to produce different subclasses depending on the String, which would be useful e. G. for PostGIS, als all the geometry classes share the same postgres type "geometry". > When we come to do binary-format types, I'd expect we would have a=20 > subinterface (PGbinaryobject?) that adds whatever methods are needed for= =20 > binary parameter formatting. Objects that implement PGbinaryobject=20 > become candidates for binary transfer. What do you think about the factory / handler object approach that AFAIR was discussed here some days ago? So the driver gets registered one PGfactory for every postgres type, and this factory then has methods to transform objects to text and binary representation and vice-versa. This would allow us to read and write instances of third-party defined classes that don't implement any postgres specific interface. We still could have a default factory implementation that gets used whenever any legacy application uses PGObject subclasses. Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com