Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 8493 invoked from network); 23 Jul 2009 16:14:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jul 2009 16:14:02 -0000 Received: (qmail 32994 invoked by uid 500); 23 Jul 2009 16:15:07 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 32943 invoked by uid 500); 23 Jul 2009 16:15:07 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 32933 invoked by uid 99); 23 Jul 2009 16:15:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2009 16:15:07 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.2.163] (HELO exprod7og105.obsmtp.com) (64.18.2.163) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 23 Jul 2009 16:14:57 +0000 Received: from source ([74.125.92.27]) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKSmiMa/FVUwZCsiNya3lVkB1DvLcgNcMD@postini.com; Thu, 23 Jul 2009 09:14:36 PDT Received: by qw-out-2122.google.com with SMTP id 3so603421qwe.29 for ; Thu, 23 Jul 2009 09:14:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.31.70 with SMTP id x6mr848337ibc.32.1248365675216; Thu, 23 Jul 2009 09:14:35 -0700 (PDT) In-Reply-To: <00bc01ca0bae$a31aad50$e95007f0$@com> References: <00b401ca0ba6$8e3a9100$aaafb300$@com> <00bc01ca0bae$a31aad50$e95007f0$@com> Date: Thu, 23 Jul 2009 12:14:35 -0400 Message-ID: Subject: Re: Dynamic entity definition creation - is it possible? From: Daryl Stultz To: cnd@cndavies.com, OpenJPA User List Content-Type: multipart/alternative; boundary=00032557395e9efeaf046f61c87e X-Virus-Checked: Checked by ClamAV on apache.org --00032557395e9efeaf046f61c87e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Thu, Jul 23, 2009 at 11:59 AM, C N Davies wrote: > I=92m a bit of a puritan when it come to abstractions, and while > abstraction is a great thing I must confess to feeling that sometime I ta= ke > it to the n=92th degree and try push it too far. > > Well, we could argue forever on such things - I've had some pretty heated discussions with developers that feel the need to push things too abstract. I like to balance the abstract with the practical (and the budget!). > All of my entities are created (integrated using a fileinputstream of CSV > or XLS/XLSX) using a model whereby I read the file headers then search fo= r a > setter method that uses =93set=94, then call the set= ter. > I definitely get what you are trying to do, though I don't know why. A Clas= s is a template for an object that has certain known properties and behaviors= . Since you are modifying it at runtime, you don't really know anything about the new properties. You don't have any code that calls getWidget() just in case the new CSV file has a new column called "widget". So is this just a "puritanical" issue or do you have a good reason not to simply use a Map of some kind to extend the core entity? Reflection is a great way for a running system to discover the fixed definition of things, but it seems like you are using a form of reflection on both sides of a running system which ultimately doesn't look any different to the coder developing around it. --=20 Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:daryl@6degrees.com --00032557395e9efeaf046f61c87e--