Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 23079 invoked from network); 8 Apr 2004 09:28:06 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Apr 2004 09:28:06 -0000 Received: (qmail 4958 invoked by uid 500); 8 Apr 2004 09:27:39 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 4932 invoked by uid 500); 8 Apr 2004 09:27:39 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 4917 invoked from network); 8 Apr 2004 09:27:38 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 8 Apr 2004 09:27:38 -0000 Received: (qmail 23048 invoked from network); 8 Apr 2004 09:28:04 -0000 Received: from localhost.hyperreal.org (HELO apache.org) (127.0.0.1) by localhost.hyperreal.org with SMTP; 8 Apr 2004 09:28:04 -0000 Message-ID: <40751B14.1010000@apache.org> Date: Thu, 08 Apr 2004 11:27:48 +0200 From: Armin Waibel User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: OJB Developers List Subject: Re: Contribution: inheritance of field, reference and collection descriptors References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: localhost.hyperreal.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi all, Thomas Dudziak wrote: > On Wed, 7 Apr 2004, Luis Fernando Pollo wrote: > > >>All, >> >>I've patched org.apache.ojb.broker.metadata.RepositoryXmlHandler so that it >>would automatically include field, reference and collection descriptors of a >>superclass (specified via the "extends" attribute of the class descriptor) >>into a subclass' own class descriptor. >> >>Since I've seen quite a few posts on the users list regarding this >>(apparently pending) feature, I thought it might be of use to you. >> >>The repository handler now checks, at the end of the class-descriptor tag, >>whether the mapped class has a superclass ("extends=someClass" is present). >>If it does, the handler will include all mappings defined in the superclass >>that have NOT YET BEEN DEFINED in the subclass (this is so a subclass can >>override mappings). >> >>The attached diff was generated from a comparison against RC6. >> >>Hope it'll be useful. > > > Certainly useful, though there are two things about inheriting feature > descriptors that bug me: > > * From an usability point of view, it will be required to have > non-inheritance (i.e. as it is currently) as the default. Otherwise, > almost all existing repository descriptors will probably break. To > circumvent this, there could be an attribute at the class descriptor like > inheritBaseDescriptors='true' (with false as the default). This could even > be more fine-grained (inheritBaseFields or similar). > > * From a design point of view, inheriting descriptors from the base class > does not go along well with the current extent mechanism because they are > opposite in direction. Since the current extent mechanism is not natural > to java programmers anyway, there should perhaps be a redesign of it > (i.e. using an 'extends' just like in java). This however can only be done > for the 1.1 or later as it is a major change to the repository descriptor > definition (breaks compatibility). > * Think this improvement will make class-descriptor declaration "order-dependend". if (m_CurrentCLD.getSuperClass() != null) { > ClassDescriptor superCLD = m_repository.getDescriptorFor(m_CurrentCLD.getSuperClass()); The super class can only be found if the super class-descriptor was read by the xml-parser before the sub class-descriptor. Such a restriction is unduly in my opinion. Or do I overlook something? So I agree with Tom, that we should rethink the metadata stuff for 1.1. regards, Armin > Tom > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org