Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C4C4200D0E for ; Tue, 26 Sep 2017 16:03:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5AC5B1609C1; Tue, 26 Sep 2017 14:03:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9EF9A1609B4 for ; Tue, 26 Sep 2017 16:03:13 +0200 (CEST) Received: (qmail 99389 invoked by uid 500); 26 Sep 2017 14:03:12 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 99378 invoked by uid 99); 26 Sep 2017 14:03:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 14:03:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1D87B1A0306 for ; Tue, 26 Sep 2017 14:03:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id J7Q4YQJjWM6r for ; Tue, 26 Sep 2017 14:03:08 +0000 (UTC) Received: from post.selbstdenker.com (mail.selbstdenker.com [81.27.166.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B1E485F299 for ; Tue, 26 Sep 2017 14:03:07 +0000 (UTC) X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.19.2 (ClamAV engine v0.99.2) Received: from [81.27.162.131] (account maik@selbstdenker.ag HELO [81.27.162.227]) by selbstdenker.ag (CommuniGate Pro SMTP 6.1.15) with ESMTPSA id 13688425 for dev@cayenne.apache.org; Tue, 26 Sep 2017 16:03:00 +0200 From: "Musall, Maik" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Allowing property getters without a "get" prefix on DataObjects Date: Tue, 26 Sep 2017 16:02:57 +0200 References: <8A42EBEE-E852-47C0-8FC5-D77FABE588EC@karlmenn.is> To: dev@cayenne.apache.org In-Reply-To: <8A42EBEE-E852-47C0-8FC5-D77FABE588EC@karlmenn.is> Message-Id: <669DEF70-C747-4A78-9458-5FF17E009299@selbstdenker.ag> X-Mailer: Apple Mail (2.3273) archived-at: Tue, 26 Sep 2017 14:03:14 -0000 +1 :-) > Am 26.09.2017 um 15:32 schrieb Hugi Thordarson : >=20 > Hi Michael, >=20 > thanks for an honest attempt to convince me. Hard sell, though. :) >=20 > I use a lot of 3rd party libraries and I've only hit one time where = using the bean spec was necessary =E2=80=94 JasperReports. That was = easily fixed by providing *BeanInfo classes, in accordance with the Bean = spec. But Cayenne doesn't really follow the Java Bean Spec, it just = hardcodes "is", "get" and "set". >=20 > As for the Eclipse thing=E2=80=A6 Well. A standard DataObject already = has five methods prefixed with "get" so that list is questionable. And I = don't miss this functionality. >=20 > I think it's important to note that the change I'm proposing would not = affect those who choose to add the prefix. It just accommodates those of = us who choose not to, thus expanding the audience of the framework. >=20 > Cheers, > - hugi >=20 >=20 >=20 >> On 26 Sep 2017, at 12:01, Michael Gentry wrote: >>=20 >> Hi Hugi, >>=20 >> Let me try to sell you on the "get" prefix. :-) >>=20 >> (I did a lot of WebObjects/EOF in the past, in Objective-C and Java, = so I >> understand the reluctance.) >>=20 >> * The "get" prefix is part of the JavaBeans standard/contract. With = the >> exception of "is" for booleans (with a little "b"). >>=20 >> * There are tons of Java frameworks out there that expect and utilize = the >> JavaBeans contract, so it is great for folding external frameworks = into >> your code. Or folding Cayenne into other frameworks, such as = Tapestry. I >> can specify Cayenne object/relationship paths in Tapestry (and other >> frameworks) such as >> = t:value=3D"currentItem.resourceSummary.grossCost.costs.continuingFootnote"= >> (real example). Since Tapestry expects the JavaBeans contract and = Cayenne >> provides it, this works flawlessly. >>=20 >> * In Eclipse (and others, I'm sure) I can do anObject.get[pause or >> control-space] and see all the getters associated with that object. >> Without the get prefix, they are spread out a-z and therefore you = can't get >> as concise a list. >>=20 >> mrg >>=20 >>=20 >> On Tue, Sep 26, 2017 at 7:02 AM, Hugi Thordarson = wrote: >>=20 >>> Hi all >>>=20 >>> Touching on an old subject that has now become more important with >>> field-based Data Objects. >>>=20 >>> All of my DataObjects use accessor methods without the "get"-prefix. = This >>> was fine with Map Based data objects (where a MapAccessor would get >>> property values by name), but now that my objects are field based, = along >>> comes BeanAccessor which is hardcoded to have every getter prefixed. >>>=20 >>> I propose that BeanAccessor be modified to allow accessor methods = without >>> the "get"-prefix. Methods with "get" would get precedence, but if no = method >>> with a "get"-prefix exists, check for the existence of a method with = only >>> the property name. >>>=20 >>> Although it's a minimal change in code, I realise it comes with a = bit of >>> potential baggage WRT testing. But this is not just to scratch a = personal >>> itch; once Cayenne 4.0 is out I want to start a large scale = introduction of >>> Cayenne to the EOF world where the get prefix is generally not liked = and >>> this change would have a big appeal. Besides, I'm not a big fan of = the >>> get-prefix myself, I find it a bit redundant :). >>>=20 >>> An alternative would be to adhere to the Bean standard, and make >>> BeanAccessor read bean meta information (usually specified in = *BeanInfo >>> classes) and get names of getter/setter methods from there. But that = would >>> be a much larger change than just checking for a method with = propertyName >>> if the getPropertyName method doesn't exist. >>>=20 >>> What do you think? >>>=20 >>> Cheers, >>> - hugi >=20