Community
Participate
Working Groups
= Problem description = Information exposed on IMetaModelDescriptor has declarative character and is used for many different kind of purposes. On example is the analysis of files in the workspace to see if they contain instances of a given metamodel or not. However, a part of the information exposed on IMetaModelDescriptors, in particular its name and the default content type id, is currently retrieved from static constants on the EPackages of the underlying metamodel implementation. As a consequence, it happens that the (potentially quite big) EPackages and sub EPackages of a metamodel get initialized just because the IMetaModelDescriptor's name or default content type is requested. This can have significant impact on runtime performance, e.g., in the UI when IMetaModelDescriptors are used to determine if some common navigator content needs to be activated or not, and may cause that the EPackages of a metamodel get initialized even though not a single instance of that metamodel exists in the workspace. = Resolution approach = Make sure that IMetaModelDescriptor implementations never access any information (static or non-static) on the EPackages of the underlying metamodel. Therefore the implementation of IMetaModelDescriptors must be modified in the following way: 1. It should be possible to initialize the AbstractMetaModelDescriptor#getName() via an optional constructor parameter; when no name is provided it must not be deduced from the the AbstractMetaModelDescriptor#getRootEPackage()'s name. 2. AbstractMetaModelDescriptor#getRootEPackageContentTypeId() should be deprecated and no longer be used for implementing AbstractMetaModelDescriptor#getDefaultContentTypeId(); IMetaModelDescriptor implementations which need to advertise default content type should always explicitly override AbstractMetaModelDescriptor#getDefaultContentTypeId() and return a value as appropriate. 3. IMetaModelDescriptor implementations (i.e., Hummingbird10MMDescriptor, UML2MMDescriptor, EXTLibraryMMDescriptor, GMFNotationDescriptor, etc.) must not refer to static eNS_URI or eCONTENT_TYPE fields of EPackages to retrieve name and default content type id information. They should redefine those pieces of information on their own and expose them as public constants on instead.
Fixed as propose in description.
Mass-closing Resolved tickets