DSM/SPL: Getting Practical - A Sample Metamodel
Our Meta-Metamodel
Just as a reminder, the basic meta-metamodel we're going to start off with is as follows: (I've added the "E" prefix as used in ecore to make it easy to distinguish the meta-metamodel concepts from similar metamodel concepts that may be used in languages for describing things like domain entities/classes. It'll also mean that all of the meta-model tables will be together if I'm looking at the underlying db which will be useful until I rebuild enough tooling on top of this to make direct viewing of the db tables unnecessary.)
- Name: string
- AttributeList: EAttribute:0.*
- ReferenceList: EReference:0.*
- eSuperType: EClass:0.1
EAttribute
- Name
- DataType: EDataType:1.1
EDataType
- Name: String
EReference
- name: String
- containment: Boolean
- lowerBound: int
- upperBound: int
The Entity Model
When you're building non-trivial web applications, you often want to start with your business object model. Describing users, articles, products, categories, and the like. Let's start off with a VERY simplistic entity model and then work from there.
- Title: String - The title for the object
- Properties: Property:0.*
- Relationships: Relationship: 0.*
Property
- Title: String
- DataType: DataType: 1.1
Relationship
- Title: String
- Object: Object: 1.1
- Dependency: String (actually Enum: associated or composed)
DataType
- Title: String
This is clearly a very simplistic model, but it provides a starting point to start creating functionality around and once we have the core system we should be able to easily extend it by applying transformations to the meta-metamodel to add additional entities, attributes, relationships, etc.
So, we have a sample metamodel described in a manner that's consistent with out meta-metamodel. Now we need to find a way to store this metamodel in the database. To do that, we need to create a set of tables representing our meta-metamodel. From there we can then create a set of tables for storing model statements within this metamodel (e.g. objects like Product or User or Article or Page). Once we've done that manually, we should be in a pretty good place to generalize and to write a simple script to create metamodel tables for storing model statements for any arbitrary metamodel. But I think this posting is long enough, so lets put that into another post . . .



There are no comments for this entry.
[Add Comment]