Upload
margery-underwood
View
220
Download
0
Tags:
Embed Size (px)
Citation preview
1/15
ENT MetamodelImplementation & Applications
ENT metamodel, prototype implementationComponent substitutability checking, ENT based component comparisonCase Study: Component model OSGiAutomated generating OSGi component versionsFuture work
Lukáš Valenta
& what are we working on…
2/15
ENT MetamodelElement – interface element
Name, type Additional non-functional information –
Tag Classification:
Nature, Kind, Role, Granularity, Construct, …
Trait – related elements Equal classifier and meta-type Set of traits defines the component model
Categories – „similar“ traits Defined „angle of view“f Exports : role =
{ provided }f Needs : role = { required }
3/15
ENT Metamodel Implementation- Review of the Diploma Thesis
3 parts Definition of the concrete component model Classification system and categories ENT representation of the component
Applicable for any component model(now implemented: EJB, OSGi)
New: ENT based component comparison
4/15
Component Substitutability Checking
“a substitute component should be usable whenever the current one was expected, without the client noticing it” [Wegner, Zdonik, 1988]
“instances of type T' can be bound to variables declared to be of type T if T‘ <: T (subtype)”
short <: long structured types: use rules
recursively until primitive types are reached
Issue with statically typed languages (Java, C++, …)
Although int <: long, runtime error!
1 none If a = b
2
insertion if a is not defined but b is
specialization
if b <: a
3
deletion if b is not defined but a is
generalization
if a <: b
4 mutationif b contains both ins/spec and del/gen differences
5 unknownIf b cannot be compared to a
Compare two types a and b:
Diff(a,b): Type x Type -> differences
It returns:
5/15
ENT Based Component Comparison
Comparing structured types (e.g. whole components)
Input: ENT representations of two components (elements, tags)Appropriate parts are compared using subtyping rules
= The rules for comparing various metatypes
e.g. Enumeration: Subtyping relation between
values of the set must be specified
Authentication:supported <:
required List, Map, …
Output: comparison result
6/15
Comparison Result Representation
Hierarchical (tree) structure Complete information for all levels of comparison
“custom” depth XML representation
<component ctype="OSGi_R4" model="OSGi_R4"> <name>Log Service</name> <part name="" level="component"> <diff>Mutation</diff> <part name="Exports" level="category"> <diff>Mutation</diff> <part name="export_types" level="trait"> <diff>Mutation</diff> <part name="cz.zcu.Logger" level="class"> <diff>Mutation</diff> <part name="flush()" level="method"> <diff>Insertion</diff> </part> <part name="getItemCount()" level="method"> <diff>Generalization</diff> </part> </part> </part> <part name="Needs" level="category"> <diff>None</diff> </part> </part></component>
7/15
Case Study: Generating OSGi Component Versions
Practical use of ENT component comparison for OSGi platformWe are able to compare two components and get the complete information about the changes (at any „level of detail“)
8/15
OSGi Service PlatformOpen Services Gateway initiative
Common architecture to develop, deploy and manage services
Target range: embedded/mobile devices enterprise servers
The core formed by the Framework (= container) Supports the deployment of applications called bundles
Why? Simple component model … but contain versioned dependencies, industrial
importance
Practical applications: Eclipse Platform (Equinox) Enterprise Component Framework (ECP)
9/15
OSGi BundleBundles can share Java packages (exporters importers) and provide servicesBundle = JAR archive
Java classes + other resources needed to provide functionality
Manifest file Description of the contents Provide information about the bundle Specification of bundle dependencies … Primary source for generating the bundle ENT
representation
Bundle-Name: AExport-Package: cz.zcu.logging;version=1.3.0
10/15
OSGi Bundle – Versioned Dependencies
Every exported package has version identifier Well-known versioning schema: major.minor.micro
major – incompatible change minor – compatible change in component interface micro – change not affecting interface (e.g. bugfix)
Importers can specify the version range of required packages (+ other constraints)Framework resolves all constraints and link importers to the right exporters
Valid version identifiers all possible problems identified already
in the deployment phase Valid version identifiers = important !
Bundle-Name: AExport-Package: cz.zcu.logging;version=1.3.0
Bundle-Name: BImport-Package: cz.zcu.logging;version=“[1.2.6, 2)”
11/15
Differences and Versioning Related
In general: there is a connection between the change and the new version identifier
The knowledge of difference between two subsequent versions of an interface part is sufficient to determine the new version identifier of that part
d = Diff (Ri-1, Ri ) : difference between two consecutive revisions
Vold = majold.minold.micold : version of Ri-1
The new version identifier Vnew = majnew.minnew.micnew is defined:
Diff (Ri-1, Ri ) majnew minnew micnew
none majold minold micold+1
specialization, insertion
majold minold+1
0
deletion, generalization, mutation
majold+1 0 0
unknown unknown
12/15
Generating OSGi Component Versions
13/15
Example
Bundle-Name: ABundle-Version: 2.2.6Export-Package: cz.zcu.logging;version=1.2.5Require-Bundle: B
Bundle-Name: ABundle-Version: ?.?.? Export-Package: cz.zcu.logging;version=?.?.?Require-Bundle: B, C
Previous version: New version:
Exported package is specialized new version 1.3.0The whole bundle has new required dependency (C) its “needs” are specialized bundle is generalized (backward strict incompatible) new version 3.0.0
14/15
Future Work – My IdeasTry to find a way to solve a problem with statically typed languages (Java)Automated creation of the connectors between the „incompatible“ interfaces
15/15
Conclusion
At the abstract level of the component representation we can do the substitutability checksAnother component model can be added easily – implement the compare method for particular elements and tagsThe result can be used for another applications
Thank you