X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 875B4D1BA9F for ; Mon, 1 Mar 2004 17:28:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15930-03 for ; Mon, 1 Mar 2004 13:28:40 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 6EE8ED1B4E7 for ; Mon, 1 Mar 2004 13:28:39 -0400 (AST) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id C9FEB17C324; Mon, 1 Mar 2004 12:28:38 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1AxrDa-0007JY-00; Mon, 01 Mar 2004 12:28:38 -0500 To: pgsql-general@postgresql.org Subject: Re: value too long error References: <4043677D.6040905@potentialtech.com> In-Reply-To: <4043677D.6040905@potentialtech.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 01 Mar 2004 12:28:38 -0500 Message-ID: <871xoceat5.fsf@stark.xeocode.com> Lines: 25 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/25 X-Sequence-Number: 58069 Bill Moran writes: > In OO programming, the generally accepted rule is that a program shouldn't > access class values directly, but the class should have methods to set > and retrieve the data. This allows internal representations to change > without affecting the public API of the class. It also allows data > validation to occur, if needed. Note that this is largely a C++ rule. In C++ accessing class members is very different and much less flexible than using class methods. Other OO languages are not universally so hobbled. > I'm just wondering how far this rule of thumb could/should be extended to > databases? I mean, you could say: "Nobody does a direct INSERT, but always > calls a stored procedure that stores the result." I don't know how much > this might break the mindset of the client developer. This is a popular old-school database approach. Personally I find it incredibly annoying, but I can see its advantages as well. But to me stored procedures just don't seem like nearly a powerful enough abstraction tool to make them worth all the pain this approach entails. -- greg