Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 84674 invoked from network); 9 Aug 2007 00:46:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2007 00:46:41 -0000 Received: (qmail 96121 invoked by uid 500); 9 Aug 2007 00:46:39 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 96087 invoked by uid 500); 9 Aug 2007 00:46:39 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 96074 invoked by uid 99); 9 Aug 2007 00:46:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 17:46:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.43.132] (HELO sca-es-mail-1.sun.com) (192.18.43.132) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 00:46:32 +0000 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id l790k8Mb019210 for ; Wed, 8 Aug 2007 17:46:12 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JMH00001E39UT00@fe-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for dev@openjpa.apache.org; Wed, 08 Aug 2007 17:46:08 -0700 (PDT) Received: from [192.168.0.12] (c-24-6-172-77.hsd1.ca.comcast.net [24.6.172.77]) by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JMH00KCJE4V9200@fe-sfbay-09.sun.com> for dev@openjpa.apache.org; Wed, 08 Aug 2007 17:46:07 -0700 (PDT) Date: Wed, 08 Aug 2007 17:45:59 -0700 From: Craig L Russell Subject: Re: API discussion: dependencies between modules In-reply-to: <7262f25e0708081715x1f66aa95x80d45e290afd79c9@mail.gmail.com> Sender: Craig.Russell@Sun.COM To: dev@openjpa.apache.org Message-id: <7BE78FA6-C7EE-46A7-B6CF-18C347D4C59D@SUN.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.752.3) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-265-7245521; micalg=sha1 References: <7262f25e0708081436y7c3ce76en2c5eb98779b568f2@mail.gmail.com> <4A889F23-F437-49A2-A3A9-059DF4147E62@apache.org> <7262f25e0708081448h1f03bfadh209735339a50db58@mail.gmail.com> <2FD0AD3B-1C83-4FFD-A878-5D47CDC5A005@apache.org> <7262f25e0708081715x1f66aa95x80d45e290afd79c9@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-265-7245521 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Aug 8, 2007, at 5:15 PM, Patrick Linskey wrote: >> maven. Furthermore, people wouldn't be able to rely on just the the >> public API jar for compilation, since they would get a >> NoClassDefFoundError for SomeInternalClass. > > I don't think that that's the case -- if the only refs were in code > blocks, that should work fine for compilation dependencies. > > So in any event, this definitely puts us in a difficult position. I > think that it makes sense to not violate OSGi rules for our modules, > since I think that eventually we may want to do more OSGi stuff. And > clearly, we shouldn't do something that maven won't let us do without > good cause. > > However, I think that I'm still in favor of moving the non-API classes > to a .impl sub-package. It just seems cleaner to me, and more like > what we'll want in the long term. > > Thoughts? Is it worth the pain for current OpenJPA-internals consumers > to move things like EntityManagerImpl and FetchPlanImpl to a > sub-package, even if we don't get any maven goodness from it? Well, as we discussed, it's easier for our customers to do now than later when we will have hundreds more customers. And I do think that the current interfaces have way too much stuff in them. I don't know that I've seen this possibility discussed, which would make the transition easier: Take the current o.a.o.persistence.OpenJPAEntityManager and split it into two interfaces, with only the user-intentioned methods left in the original interface, and the rest in the new interface. So, now: interface OpenJPAEntityManager extends EntityManager, EntityTransaction, javax.resource.cci.Connection, javax.resource.cci.LocalTransaction, javax.resource.spi.LocalTransaction, Closeable, ConnectionRetainModes, DetachState, RestoreState, AutoDetach, AutoClear, CallbackModes { ... /** * Return the (mutable) fetch plan for loading objects from this * entity manager. */ public FetchPlan getFetchPlan(); ... /** * Return the managed runtime in use. */ public ManagedRuntime getManagedRuntime(); ...} becomes interface OpenJPAEntityManager extends EntityManager { ... /** * Return the (mutable) fetch plan for loading objects from this * entity manager. */ public FetchPlan getFetchPlan(); ... package org.apache.openjpa.persistence.internal interface OpenJPAEntityManagerInternal extends OpenJPAEntityManager, EntityTransaction, javax.resource.cci.Connection, javax.resource.cci.LocalTransaction, javax.resource.spi.LocalTransaction, Closeable, ConnectionRetainModes, DetachState, RestoreState, AutoDetach, AutoClear, CallbackModes { ... /** * Return the managed runtime in use. */ public ManagedRuntime getManagedRuntime(); ...} Craig > > -Patrick > > On 8/8/07, Marc Prud'hommeaux wrote: >> >> That would make the whole thing much less appealing to me, since then >> we wouldn't have the advantage of enforcing API/SPI restrictions via >> maven. Furthermore, people wouldn't be able to rely on just the the >> public API jar for compilation, since they would get a >> NoClassDefFoundError for SomeInternalClass. >> >> If the point is to make it so we have a clean separation of public >> APIs/SPIs from internal implementation and kernel classes, I think we >> should go all the way and really separate them out. >> >> >> >> On Aug 8, 2007, at 2:48 PM, Patrick Linskey wrote: >> >>> Hmm. That's annoying. I think I'd prefer to just keep the impl libs >>> inside the API module rather than adding the SomeInternalClass >>> style. >>> >>> -Patrick >>> >>> On 8/8/07, Marc Prud'hommeaux wrote: >>>> >>>> This is a show-stopper if we were to refactor the code into >>>> different >>>> maven modules, since you can't have circular dependencies between >>>> modules (e.g., openjpa-persistence-public-api couldn't depend on >>>> openjpa-persistence if openjpa-persistence itself depeneds on >>>> openjpa- >>>> persistence-public-api). >>>> >>>> My suggestion for this kind of thing would be that if our API has >>>> some method like: >>>> >>>> public SomeInternalClass getFoo() >>>> >>>> then we would instead add a SomeInternalBogusInterface with no >>>> methods that is opaque to the user, and which SomeInternalClass >>>> will >>>> implement. The advantage to this is that our public APIs couldn't >>>> then have a transitive dependency on non-public APIs, which I think >>>> is beneficial from an API consistency standpoint. >>>> >>>> >>>> >>>> On Aug 8, 2007, at 2:36 PM, Patrick Linskey wrote: >>>> >>>>> Hi, >>>>> >>>>> I think it's probably worth discussing module dependency a bit. I >>>>> believe that it will be important for the API module (if we make >>>>> such >>>>> a module) to depend on the non-API modules internally. IOW, the >>>>> code >>>>> blocks of some of the classes in the API module will need to use >>>>> non-API classes. I don't see this as a problem, but thought it >>>>> would >>>>> be worth pointing out. >>>>> >>>>> It also is relevant because it means that we can directly use the >>>>> symbolic constants as the enum ordinal values. >>>>> >>>>> -Patrick >>>>> >>>>> -- >>>>> Patrick Linskey >>>>> 202 669 5907 >>>> >>>> >>> >>> >>> -- >>> Patrick Linskey >>> 202 669 5907 >> >> > > > -- > Patrick Linskey > 202 669 5907 Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-265-7245521 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICECpJVMO68ii+Xfsc1O1YYFIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MTI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