|
1
|
- Technology Exchange
- EMF Technology in Practice
|
|
2
|
- What is UML2?
- EMF Customizations
- Element Identification
- Element Creation
- Element Destruction
- Element Retrieval
- Element Validation
|
|
3
|
- An Eclipse Modeling Development Tools subcomponent at http://www.eclipse.org/modeling/mdt/?project=uml2#uml2
- An EMF-based implementation of the UML™ 2.0 metamodel for the Eclipse
platform
- Objectives are to provide…
- a useable implementation of the metamodel to support the development of
modeling tools
- a common XMI schema to facilitate interchange of semantic models
- test cases as a means of validating the specification
- validation rules as a means of defining and enforcing levels of
compliance
|
|
4
|
- XMI resource to support identification of elements using Universally
Unique Identifiers (UUIDs)
- JET templates to generate methods that facilitate element creation, destruction,
and retrieval
- Switch classes to perform element validation operations
|
|
5
|
- Needed a way to uniquely identify elements across resources
- Wanted to minimize the impact on disk and memory footprint
- Implemented a custom XMI resource (Uml2ResourceImpl) to assign and
manage UUIDs generated in base 64 format…
- overrode ResourceImpl#getEObjectByID(String) to retrieve objects from idToEObectMap
- overrode XMLResourceImpl#getID(EObject) to assign (and reassign)
automatically generated UUIDs
- overrode ResourceImpl#detached(EObject) to preserve IDs when objects
(and their children) are detached from resources
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
- Wanted to simplify the process of creating an element and adding/setting
it to a containment feature
- Customized JET templates to generate convenient factory methods
- customized Interface.javajet to generate method declaration
- customized Class.javajet to generate method implementation
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
- Wanted a way to delete an element, including all of its children and all
cross references to it
- Customized JET templates to generate destroy() method for top-level
types
- customized Interface.javajet to generate method declaration
- customized Class.javajet to generate method implementation
|
|
17
|
|
|
18
|
|
|
19
|
|
|
20
|
|
|
21
|
- Wanted to simplify the process of retrieving named elements from lists
- Customized JET templates to generate convenient factory methods
- customized Interface.javajet to generate method declaration
- customized Class.javajet to generate method implementation
|
|
22
|
|
|
23
|
|
|
24
|
|
|
25
|
- Wanted a way to perform validation operations on elements
- Wanted to be able to evaluate different sets of constraints
- Implemented custom Switch subclasses to execute validation rules
- implemented validate(EObject, IProgressMonitor) to invoke the switch
and return an outcome in the form of a status object
- overrode Uml2Switch#defaultCase(EObject) to recursively invoke the
switch on the object’s contents
- overrode Uml2Switch#doSwitch(EObject) to inform the progress monitor of
progress
- overrode Uml2Switch#case*(*) for each type of element to which
constraints apply
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
|
30
|
|