OMF::Package Class Reference
#include <Package.hpp>
Inheritance diagram for OMF::Package:
List of all members.
Detailed Description
The Package class is (not surprisingly) one of the more critical components to the OMF's dynamic packaging implementation. By dynamic packaging, we simply imply that each package must be implemented in its own shared library. This goes for more complex and nested shared metamodel packages as well (such as UML and CWM). The Package class provides one primary service: a lookup for extents and proxies for elements within the scope of the derived package. Note, also that all derived package classes must be singleton instances.
Note that we handle package imports very differently than the previous versions. First, the metamodel implementations don't really deal with imports. All imports are resolved at author time so we can just cram all the classes into a single namespace. This eliminates any possibility of name ambiguity. As such, a package importing another will simply define all of the imported classes within that namespace. Second, this means that the outermost package will always provide accessors to the extents and proxies defined within the imported namespaces. However, the metamodels themselves will retain the concept of importation - it just becomes a relatively useless artifact in terms of model processing.
Note that a package import is significantly different than an XMI model import. That allows elements in one model to reference elements of another (such as defining extensions to a metamodel).
Nested packages might be handled somewhat differently - there is still some analysis on this topic to be done (when I consider the CWM as a target metamodel to implement). Generally speaking, I don't know if outer pacakges will provide accessors to elements defined in inner packages. We'll have to do some checking.
Constructor & Destructor Documentation
OMF::Package::Package |
( |
const std::string & |
name, |
|
|
const std::string & |
uri |
|
) |
[protected] |
|
virtual OMF::Package::~Package |
( |
|
) |
[virtual] |
|
Member Function Documentation
Association* OMF::Package::association |
( |
const std::string & |
name |
) |
const |
|
|
Get the association extent with the given name. |
void OMF::Package::defAssoc |
( |
Association * |
assoc |
) |
[protected] |
|
|
Derived package classes must use this to initialize the association extents defined within the package. |
void OMF::Package::defProxy |
( |
Class * |
proxy |
) |
[protected] |
|
|
Derived package classes must use this to initialize the proxies defined within the package. |
virtual Model* OMF::Package::model |
( |
|
) |
[pure virtual] |
|
|
This method returns the model that defines this metamodel implementation. The model is loaded from disk on the first access using the ModelService to locate and "remember" the model. Derived classes must implement the loading of this method.
Implemented in Model::ModelPackage, and UML::UMLPackage.
|
const std::string& OMF::Package::name |
( |
|
) |
const |
|
|
Return the name of the package. |
Class* OMF::Package::proxy |
( |
const std::string & |
name |
) |
const |
|
|
Get the class proxy for the metaclass with the given name. |
const std::string& OMF::Package::uri |
( |
|
) |
const |
|
|
Return the uri of the package. |
The documentation for this class was generated from the following file:
Generated on Fri Sep 10 13:07:38 2004 for OpenModelingFramework by
1.3.8