Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 45334D886 for ; Tue, 17 Jul 2012 20:43:52 +0000 (UTC) Received: (qmail 17411 invoked by uid 500); 17 Jul 2012 20:43:52 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 17389 invoked by uid 500); 17 Jul 2012 20:43:52 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 17380 invoked by uid 99); 17 Jul 2012 20:43:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 20:43:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [62.13.148.104] (HELO outmail148104.authsmtp.com) (62.13.148.104) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 20:43:41 +0000 Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id q6HKhK1c028686 for ; Tue, 17 Jul 2012 21:43:20 +0100 (BST) Received: from dhcp-wlan29.home.lan (erft-5d80a93f.pool.mediaWays.net [93.128.169.63]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id q6HKhI55003941 for ; Tue, 17 Jul 2012 21:43:18 +0100 (BST) Message-ID: <5005CE65.2040203@apache.org> Date: Tue, 17 Jul 2012 22:43:17 +0200 From: Thomas Vandahl User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Apache Torque Developers List Subject: Re: RFD: RecordMappers, Peers and MapBuilders References: <4FFC850B.1090509@apache.org> <50046802.3070903@apache.org> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: 0a80ab22-d050-11e1-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdyaAgQClZJUiwT EioPDCIGTh8qMAFL GwYeIE5WLUQhWQ4X O15TJVpedloGSkcA BHlxHghLUl1wW3N3 agBVbg9cagRHXBtr UkBXQ1RbCgNrHh4E BBsBUlczcX09IAd1 YEZiXXlfXQp4ck5+ DE4FHW1XN2VidTQf VUBFdgIBcR5Cfk1M d1B/VnELZWVVbnJj EhkJMmJ5Bxtzemxv TwoKN143SF4TEyQn A1g6EDg1BgUMQSl7 ChU+AEMdGEocKF5a X-Authentic-SMTP: 61633138303539.1015:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 93.128.169.63/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. On 17.07.12 10:41, Thomas Fox wrote: > Probably we can add the MapBuilder's methods as protected methods to the > Peer class, without even changing the Peer public interface. On the first > look, this looks like a good idea, and the public API stays the same for > the Peers, so it's better for the user (less generated classes) (and in my > opinion, the additional two or three protected methods in the generated > peers do not make the class too complicated. +1 > Thinking again about dissolving the RecordMapper into the PeerImpl class, > this would add one public method (and a bunch of protected methods, one for > each column) to the PeerImpl class. Which is again probably acceptable for > the user, but adds still more complexity to the peers. +0 > Dissolving the RecordMapper into the PeerImpl class is also problematic > because the Data Object classes can have protected getters and setters for > some fields (whenever the user sets protected="true" on a column), so the > RecordMapper must be in the same package as the data object class. We also > cannot make it protected because the peer class can be in another package > (at the moment). Let me dig around a bit. Maybe some of the dependency injection patterns can help. > Regarding the Peer and PeerImpl classes, of course we can go back to just > static methods, with all their problems (e.g. cannot be exchanged on > runtime, e.g. for unit testing). No, please don't even consider this. I'd rather strive to reduce statics in Torque much as possible. > We could also look at a compile-time switch to generate either just static > methods or impl classes, (but we have a lot of switches already, which does > not make testing easier). Rather not. What about a single static method getPeer() that returns the PeerImpl in the data objects? IIRC, its already there only not static. > What are your opinions ? I'm undecided. I'll see how far I can get with a generified BasePeerImpl. Maybe the starting point is then easier to see. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org