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 D22B6D1E913 for ; Mon, 1 Mar 2004 18:09:42 +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 34802-01 for ; Mon, 1 Mar 2004 14:09:39 -0400 (AST) Received: from internet.potentialtech.com (h-66-167-251-6.PHLAPAFG.covad.net [66.167.251.6]) by svr1.postgresql.org (Postfix) with ESMTP id BB25AD1E8E7 for ; Mon, 1 Mar 2004 14:09:38 -0400 (AST) Received: from potentialtech.com (pa-plum1c-102.pit.adelphia.net [24.53.179.102]) by internet.potentialtech.com (Postfix) with ESMTP id 78D2169A71; Mon, 1 Mar 2004 13:09:38 -0500 (EST) Message-ID: <40437C5F.5070607@potentialtech.com> Date: Mon, 01 Mar 2004 13:09:35 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Greg Stark Cc: pgsql-general@postgresql.org Subject: Re: value too long error References: <4043677D.6040905@potentialtech.com> <871xoceat5.fsf@stark.xeocode.com> In-Reply-To: <871xoceat5.fsf@stark.xeocode.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/29 X-Sequence-Number: 58073 Greg Stark wrote: > 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. Really? I can only assume you're referring to languages such as perl that have ties (or equivalent capability). In that case, you're still accessing the data through a method, it's just a more abstract abstraction. Or are you referring to something else? >>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. I threw it out there for the sake of discussion. I can see advantages and disadvantages. For example, I'm working on financial software, and _everything_ is accessed through stored procedures. This is A Good Think (in my opinion) because the software is designed to be easily integrated with other systems. The last thing we'd want is someone getting the wrong answer to a financial query because they don't understand the schema. A much more reliable way is to have them SELECT * FROM get_monthy_payment(month, account); so we know they're getting the correct answer. But I _can_ see the potential PITA this can cause. I guess it depends on the circumstance. -- Bill Moran Potential Technologies http://www.potentialtech.com