[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] @noimplement on IMetadataRepository ?
- From: John Arthorne <arthorne.eclipse@xxxxxxxxx>
- Date: Thu, 18 Feb 2010 10:51:12 -0500
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=IFgRrv8SRlhjMuGyclPXwl1n0F9XBtGU3G+vlqchJBIEo/jQvjdu4EcMUkTC7wT2v6 YCEwXXWFDub4Z5IzVC/gw7FN9Zx6Ta2t2Qt1HJpiH9pywpw/2dvRjYigLzv+Sm4VW6R4 BLsh4HNGcjZO/N4prQohhTs6lyWn7CHmPlkmY=
Yikes, I didn't mean to start an EMF holy war here, I was just explaining the reasoning behind using an abstract base class. I can understand that EMF uses base classes for exactly the same reason and completely agree there's no easy answer here. The difference in my mind is that EMF is a technology that is used to implement domain-specific models, so this limitation affects what kinds of domain-specific APIs can be implemented via EMF (only purely interface-based APIs). IMetadataRepository *is* the domain-specific model in this case, and it seemed unjustified to impose limitations on the design of this API to satisfy the constraints of one particular technology that can be used to implement the API (EMF in this case). I doubt that line of reasoning will convince anyone but this is what I was thinking when I made the statement about the EMF limitation.
Is a possible solution here to create a subclass of AbstractMetadataRepository that encapsulates an EMF model implementing the guts of the repository behavior? I can imagine in many cases a wrapper isn't a scalable answer, but in this case the set of repository instances is going to be very small.
On Tue, Feb 16, 2010 at 11:05 AM, Ed Merks <ed.merks@xxxxxxxxx>
EMF has the same issue about subclassing EObject/InternalEObject rather
than extending the base class, i.e., BasicEObjectImpl or one of its
derivatives. Yes, it's a harsh limitation, one we share with
IMetaDataRepository and the other Eclipse APIs to which you refer. Of
course we could change the generator effectively to copy
BasicEObjectImpl into some other class we extend, but that still leaves
the client with a copy rather than a reusable base we can modify in the
future. In any case, we must realize that an abstract base isn't a
panacea for API migration given it's not always possible for an
abstract base to implement fully whatever new thing is added to the
API, e.g., the EObject.eInvoke API that was added this release.