[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: ecore model

Understanding MOF certainly takes some getting used to.  I hope the following is helpful:
 
It's very important to remember that the OMG's MOF meta-levels must be considered as relative to something.  The MOF spec does not say that these layers are absolute (although many people mistakenly believe it does).
 
For example, if EMF were used in a modeling tool, the user (and the tool) are creating instances that actually model or describe something the user is interested in.  For example, if a user is modeling a relational database and creating "Table" and "Column" objects in their model, then the user may view the actual database objects (e.g., the "CUSTOMERS" table in some database) as M0.  Then, from this perspective the layers are:
 - M0 -> "CUSTOMERS" table in some database
 - M1 -> Table and Column objects
 - M2 -> EClass objects called "Table" and "Column" that are represented with EClass and EStructuralFeature objects
 - M3 -> EClass objects called "EClassifier" and "EStructuralFeature" that are represented with EClass and EStructuralFeature objects
 
The same system is viewed differently from the perspective of the modeling tool:
 - M0 -> Table and Column objects (which may be stored persistently in an XMI file)
 - M1 -> EClass objects called "Table" and "Column" that are represented with EClass and EStructuralFeature objects
 - M2 -> EClass objects called "EClassifier" and "EStructuralFeature" that are represented with EClass and EStructuralFeature objects
 
Interestingly, from the perspective of someone interested in the data in the database:
 - M0 -> "ACME, Corp" record in the CUSTOMERS table of some database
 - M1 -> "CUSTOMERS" table in some database
 - M2 -> Table and Column objects (which may be stored persistently in an XMI file)
 - M3 -> EClass objects called "Table" and "Column" that are represented with EClass and EStructuralFeature objects
 - M4 -> EClass objects called "EClassifier" and "EStructuralFeature" that are represented with EClass and EStructuralFeature objects
 
The MOF layers are always relative to each other.
 - The "meta-metamodel" is generally the self-reflective layer; that is, the layer that actually can describe itself
 - A "metamodel" layer contains model that describe the instances in the layer below
 - A "model" layer contains instances that are being worked with
 - A "data" or "instance" or "user object" layer generally are the things described by the "model" layer
 
The power of EMF and MOF are that they make it possible to define more than one "metamodel".  While UML is merely a very well know metamodel, there are many others.  So, the first perspective mentioned can be expanded:
 - M0 -> "CUSTOMERS" table in some database, or "Customer" class in some application, or "Customer" complex type in some .xsd
 - M1 -> Relational::Table and Relational::Column objects, or UML::Class and UML::Method objects, or XSD::ComplexType
 - M2 -> EClass objects called "Table", "Column", "Class", "Method" and "ComplexType" that are represented with EClass and EStructuralFeature objects
 - M3 -> EClass objects called "EClassifier" and "EStructuralFeature" that are represented with EClass and EStructuralFeature objects
 
 
 
"Shu Wang" <shu@xxxxxxxxxx> wrote in message oprt7yp2yuimyqh2@localhost">news:oprt7yp2yuimyqh2@localhost...
> Dave,
>
> Ecore model is very flexible and has multiple roles.
>
> * M3(Meta-Metamodel Layer)  - for defining standard metamodels like EJB or
> UML
> * M2(Meta Model Layer )     - as a metamodel for user models like Library
> packages in the tutorials.  UML is often used at this level too.  An
> example program is a class browser or the EMF code generator.
> * M1(Model Layer )          - if you are using Ecore without making new
> classes of your own.  For example, a reflective EMF.edit editor that edits
> any eobjects.
> * M0(User Object Layer)     - when operating on the objects as data, for
> example, loading ecore.ecore in an XMIResource.
>
> Regards,
> Shu
>
>
> On Wed, 20 Aug 2003 17:29:35 +0000 (UTC), Dave <
scerproj@xxxxxxxxxxx>
> wrote:
>
> > Hi all,
> >
> > Quick question.  In the OMG four layer architecture, what layer is the
> > ecore model?  M3?
> >
> > Thanks
> >
> >
>
>
>
> --
> Using M2, Opera's revolutionary e-mail client:
http://www.opera.com/m2/