22/05/2002 software engineering ii simon lepore di

76
22/05/2002 Software Engineering II Simon Lepore di

Post on 22-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

22/05/2002

Software Engineering II

Simon Leporedi

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Terminology

• Model = A semantically closed abstraction of a system

• Meta-model = A semantic information model

• Meta-metamodel = The language in which to express meta-models

Metamodeling = Is an activity, and this activity produces meta-models

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Scope

• An attempt at describing the world around us for a particular purpose

• As a schema for data that needs to be exchanged or that needs to be stored

• As a language that supports a particular methodology or process(the original purpose of the UML meta-model)

• As a language to make information on the web more semantic

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

What is Metamodeling

• To express kinds of things in order to model them in a particular system

• To define our concepts in terms of other concepts • It expresses various models that it wants to define (the RELATIONSHIP are instances of E-R diagram)

• Then model dictate the way in which the next level would be expressed

22/05/2002

What is Metamodeling

Some traditional types of users for meta-models:

1. CASE tool vendor / modeling tool vendor:In essence, what the chief architect does is extending the meta-model.The data structures in the tool arethe physical representation of the meta-model.

2. Repository vendor:For example, you may sell a repository (or database, or directory, ...) to customers who want to store software/systems development information in it. They may call it "meta-data".

3. Systems integrator:One the first activities in such a project is to understand the meaning of the data in all thesystems that need to be integrated: which data has the same meaning, which data iscomplementary, and how everything relates. Performing this analysis yields a semanticmodel for the types of data to be integrated, in other words, a meta-model.

4. End user:Functionality is one aspect ("this one has a nice shiny button over here"), but the supported meta-model is even more important. After all, the meta-model determines what you can express with the software

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Attribute TypeProcessType

…Obj.Type

EntityType

ProductEmployee

Betty

…Bob

metamodellevel

modellevel

data &processlevel

meta-metamodel level]

Metamodeling

22/05/2002

Metamodeling

• A metamodel is a model of models.

• It contains meta-obj. type.

• Object types whose istances are also object types.

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Maintaining modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Levels• Each level is supposed to define the basis for instantiating the next

• The number of the levels adapted depends on the points of view.

• OMG organized hierarchies in four levels:

– meta-meta-model level : description of the structure and semantics of meta-meta-data

– meta-model level : the descriptions (i.e., meta-meta-data) that define the structure and semantics of meta-data

– model level : meta-data that describes information

– user level : the information that we wish to describe

22/05/2002

Attribute TypeProcess Type

…Obj.Type

Entity Type

Product

meta-modellevel

modellevel

Person

SonyCDpB&OTurnt

V45729V45728

data &processlevel

modellevel

data &processlevel

Inventory clerk’ s view

Saleperson’s view

Levels

22/05/2002

Levels

• Metamodeling can define many levels of types whose instances are also types • Two various needs of approach: salesperson’s object is the clerk’s object type

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Modeling levels

• For change the kinds of object types that can be defined at the model level, a metamodel must be modified.

• These rigid structures are implemented in the most CASEtool : this is a problem

22/05/2002

Metamodel

Model

Data andprocess

definesInstances of

definesInstances of

Modeling levels

• Most CASE tools maintain models and metamodels as physically separate levels.

22/05/2002

• Problem solution :

Object

Model level Metamodel level

Object type

Model levelMetamodel level

Object type is now an Object and Object is an Object type

Modeling levels

22/05/2002

Modeling levels

• This cannot be supported by most CASE tools.

• Secondly, modifying separately maintained metamodels is often impossible.

• No metamodel customization features from sw vendors or may consider the contents of its metamodel to be proprietary.

• Exist implicity as program code(difficult to modify).

22/05/2002

Modeling levels

• Level modeling falters when the bottom level also instances(such as exsample)and so on

• The ability to instantiate at the model level were allowed, any number of levels, could be defined within it

• This ability could be supported by defining Object is an instance of one or more Object types.

22/05/2002

Object

ObjectType

Is aninstance of

classifies

Modeling levels

• Each Object type classifies any number of Objects.

• Each Object instance is an instance of one or more Object type.

22/05/2002

Modeling levels

• In other worlds, by defining the is an instanced of mapping at the metamodel level, all levels can have types and instances.

• Only difference between the model and the metamodel levels is that one has instances of the other.

22/05/2002

Attribute TypeProcess Type

…Obj.Type

Entity Type

Product

…Person

SonyCDpB&OTurnt

V45729V45728Is an

instances of

Is aninstances of

Is aninstances of

Is aninstances of

Modeling levels

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Modeling in one framework

• Modeling in rigid, physically separate levels can create problems.• These can remedied by modeling within a single frame- work instead.

Model maintenance is performed on one coherent and integrated model, not fragmented by levels. Object type and instances share the same model. Any numbers of instantiates levels is possible. since a rigid number of levels is not required.

22/05/2002

Modeling in one framework

• A single framework model can be used to decribe it self

• If a model is sufficently descriptive, it should be able to specify its own object types.

• A small subset of the model can then describe a much larger subset and so on.

• If a model can be a metamodel to describe itself, it can be a metamodel to describe other models.

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Kerenelmetamodel

Kernel Metamodel

• An approach of this kind can both describe different models and provide a common framework for expressing and comparing models.

22/05/2002

Kernel Metamodel

• The kernel metamoddel with which the model describes itdelf would contain such primitive obj types as Object Type, Object, Relation and Function.

• Also contain Operation, Trigger Rule, Control- Condition… for support processing requirements.

• These primitives, can be used to form foundational construct for other structures.

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

In last

• In a single framework model, the boundaries are non- existent.

• The only reason for inhibiting changes to the kernel meta- level is to maintain standardization.

• The standards for the future are most important for the interoperability

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

M3

M2

M1

M0

MOF(Meta Object Facility)

• It is a Standard of Object Management Group(OMG).

• In September of 1997, finalized a standard.

• MOF is the M3 levels (meta-meta-model)

• Is Object Oriented.

Meta-meta-model

Meta-model

Model

Object

22/05/2002

Four levels(OMG)

• M0 it represents the data busines level (client n° 1234.)used from DBMS, SO.

• M1(model) describes the structure of M0 level (identifier client=1234)1234 is an instances of M1 level.

• M2(metamodel) describes the structures of M1 level (atribute=identifier client) identifier client is an instances of M2.

• M3(meta-metamodel)its a model to decribe another model and the structures of m2 level(i.e.meta-atr = atribute).

22/05/2002

ObjectSecify a pure Object

Specify meta-meta classesfor metamodel.

Specify classes for UMLmodel of designer.

<<instanceOf>>

M3

M2

M1

M0

UMLPackagenotation

Specify meta classesfor metamodel.i.e. Class

OMG levels

22/05/2002

Maria : Girl

Girl

GetName(): String

Age : IntegerName : String

GetAge(): Integer

Atributes OperationClasses

MetaOperationMeta-ClassesMeta-Attributes

MOF Meta-metamodel

UML metamodel

Analisys modelUML

Object

<<instanceOf>><<instanceOf>> <<use>>

<<instanceOf>><<instanceOf>> <<use>>

<<use>><<instanceOf>>

OMG levels

22/05/2002

Goal of MOF

• M3 describe itself (MOF Model is formally defined using its own meta-modeling constructs).

• UML is an instancies of MOF.

• Defines a set of CORBA IDL interfaces that can be used to define and manipulate metamodels and their models– provides the infrastructure for implementing CORBA-based design

and reuse repositories– specifies precise mapping rules to automatically generate CORBA

interfaces for metamodels,thus encouraging consistency in manipulating metadata in all phases of the distributed application development cycle

22/05/2002

Goal of MOF• Interoperability, interchange of meta data in distribuited systems, distribuited object systems.• Beyond to the repository MOF-based we can use(for inter- change meta-data)the format stream-based(standard XMI). • XMI defines the rules for mapping from MOF to XML to generate automatic XML

code.• Essentially a subset of the UML core:• Class

– attributes– operations (only name and functionality, no associated method)

• Generalization– sub-Class inherits all features of its super-Classes – any explicit Constraints that apply to a super-Class and– any implicit behavior for the super-Class apply equally to the sub-Class– At the M1 level, an instance of an M2-level Class is type substitutable for instances

of its M2-level super-Classes– Abstract classes– Root and leaf classes

22/05/2002

Goal of MOF• Association

– Association links– Multiplicity specification– Navigability setting

• Aggregationasymmetrical association Component is part of at most one composite

– A component cannot be part of itself (also indirectly) – When a composite is deleted, all its components are deleted

• References(attributes corresponding to navigable associations ends to offer a simple way to update links)

• DatatypesMeta-model definitions often need to use attribute and operation parameter values that have “ordinary” types

• Packages– Groups elements into a meta-model– Mechanisms to compose packages

• Constraints– Used to attach consistency rules to other meta-model components– A Constraint comprises: constraint name, a language used to express the consistency rules

22/05/2002

Description of Mof• Can be described by using the MOF model itself

– circularity problem

– Direct “description” by natural language and UML diagrams

• Abstract and Concrete Mappings

22/05/2002

Description of Mof

• The Abstract mapping (defined in“The MOF Abstract Mapping” chapter)fleshes out a MOF meta-model into an abstract information model (i.e., by spellingout the logical structure of the meta-data described by the meta-model).

• The IDL Mapping (Section 2.4.2, “CORBA Meta-data Services - The MOFIDL Mapping,” on page 2-22) produces the standard OMG IDL and associatedbehavioral semantics for meta-objects that can represent meta-data conforming tothe meta-model.

• The XML Mapping (see Section 2.4.3, “Meta-data Interchange - The MOFXML Mapping,” on page 2-22) produces the standard XML DTD for

interchangingmetadata conforming to the meta-model.

22/05/2002

Index

• Index• Terminology• Scope• What is Metamodeling - Metamodeling - Level architectures - Modeling levels - Modeling in one framework - Kernel metamodel - In last• Mof• Case Study

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

Introduction

Web-based hypermedia systems are becoming more and

more sophisticated, new modeling requirements constantly

arise, and design models must constantly evolve.(an example of this

evolutions is HDM Hyper text design model)

Since design tools should complement models to support an

efficient design process, model evolution raises technological

issue: Design tools must be modified when their underlying

model changes. This is why the paper proposes a general

approach to efficiently update design tools in response

to model evolutions.

22/05/2002

Introduction

The key ideas are: the description of a hypermedia model

in terms of a general meta-model, powerful enough to

express the semantics of current and future design constructs.

the transformation of a hypermedia design tool into a meta-CASE tool, able to cope with model updates without requiring to be redefined and rebuil from scratch.

22/05/2002

Introduction

The approach is presented by discussing a case study, that is,the feasibility study to transform the design toolkit, Jweb, into a meta-CASE tool (Jweb3).

This tool will support the latest version of our model (called W2000), and will easily evolve with the model it supports. In this document it comes discussed the adoption of the OMGmetamodeling standards MOF and XMI as enabling technologya sample of the representation of W2000 in terms of MOF, and the sketch of the architecture of the under-implementationJweb3.

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

Feasibility Study• As to the first aspect, they decided to probe the possibilities ofusing existing UML CASE tools as temporary front-ends forthe forthcoming schema editor.The idea was not to select “the best” available tool, but simplydo some experiments and delay the implementation of a specialpurpose editor to better refine W2000 constructs. As side effect,this implied that they did not want to work with proprietaryformats to store models(W2000 schemas), but they needed across -platform standard to be able to change the front-endaccording to our needs. • They decided to exploit the OMG novel way to meta-modeling to find a cumulative solution.

22/05/2002

Feasibility Study

• Using the OMG jargon, they can say that each model (i.e.artifact)

must be compliant to a given meta-model (i.e., notation).

• This definition allows their to decompose a CASE tool into a

provider of modeling features, which depends on the supported

meta-model, and a consistency checker between defined models

and their meta-model. Meta-CASE tools do a similar job at a

meta-meta-level. Meta-CASE tools let the developer define his

own meta-model and express the semantics of the primitives of

this meta-model in terms of a meta-metamodel.

22/05/2002

Feasibility Study

• Describing a new modeling feature of a meta-model (e.g., a new

primitive for W2000) with a meta CASE tool would require the

designer to describe the semantics of the new construct in terms

of the meta-meta-model.

• The key point is that a meta-metamodel

(MOF) supplies all modeling features to render extensions and

mechanisms to (automatically) update the tools with respect to

consistency checking and manipulation operations.

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

W2000 as a Profilable MOF Meta-model

• W2000 can be seen as a UML extension (profile, according to

the UML terminology).UML, in fact, supplies ad-hoc features

(stereotypes, tagged values, and constraints) to extend the

Original UML to cope with particular needs and specific

application domains.

• Defining W2000 as a UML profile allows us to exploit

UML commercial tools, but also XMI-UML, that is, the UML

instantiation of XMI , which is rapidly becoming the ”lingua

franca” to exchange UML models in a vendor-independent way.

22/05/2002

W2000 as a Profilable MOF Meta-model

• The adoption of UML profiles is enough to use UML CASE

tools as front-ends for the schema editor, but does not allow

semantic checks. Currently, available CASE tools support

profiles partially(only Objecteering provides some support)

• Evolution and consistency checks would not be possible. This is

why they decided to adopt MOF to describe the W2000 meta-

model, that is,to give a precise definition of W2000 concepts in

terms of a flexible meta-metamodel.

22/05/2002

W2000 as a Profilable MOF Meta-model

• The W2000 meta-model reuses many UML concepts, and thismeans that we can see W2000 as a UML profile and all possibleversions of W2000 constructs can always be mapped ontoinstances of UML primitives, but with respect to conventionalUML profiles it satisfies also an additional condition

• All concepts (both new and borrowed ones) are defined usingMOF. Thus, they can say that W2000 is a profilable MOF meta-model (hereafter, p-meta-model). The reason for introducingthe concept of p-meta-model is that if the UML metamodel canbe described in terms of MOF, the opposite does not hold true,not all meta-models described in MOF can be mapped ontothe UML meta-model.

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution– Remarks

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

Technological solution

• The gray box in the upper left corner identifies meta-modeling technology;all other tools belong to the usual modeling chain, which must be enabled bya set of preliminary meta-modeling steps. They start by defining the W2000p-meta-model:

• Usually they do this using Rational Rose integrated with the Unisys add-onfor XMI. This model, stored in XMI-MOF, is the main input to the two meta-modeling tools.

22/05/2002

Technological solution

• The translator generator : produces a translator from XMI-UML to XMI-

W2000 as a set of XSLT rules.

• The checker generator uses the same meta-model to produce a set of

Schematron rules.

• The designer specifies his W2000 models using his preferred UML editor

and stores them in XMI-UML. The translator, through the XSLT rules,

transform the XML file compliant to XMI-UML to another XML file, but

compliant to XMI-W2000. This file is then the input to the checker that

validates it through the Schematron rules.

22/05/2002

Remarks

• Even if p-meta-models have been defined to solve a specific problem,

that is, to define the meta-model of W2000, they are absolutely general

and can be used in all those cases where either we need (want) a MOF

definition of an extended UML notation or simply we want to integrate

MOF-based and UML-based tools.

• They implemented all logical components of Figure through special-

purpose scripts and XSLT sheets, all coordinated by HTML interfaces.

• This implementation style should better fit evolution and simplify

maintenance.

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

A p-meta-model for W2000

• This section presents an example application of the p-meta-model ofW2000 . The p-meta-model for W2000 (Figure 2) comprises the threestandard UML packages, and the new W2000 package.

Foundation package supplies all basic modeling elements(classes,attributes, associations, etc.) BehavioralElements package supplies the elements to specify the dynamic behavior

of a model. ModelManagement package supplies the means to cope with complexity and organize a model into submodels according to the differentviewpoints. The new package, W2000, defines how we extended UML torepresent W2000 constructs.

22/05/2002

A p-meta-model for W2000

• The profilability of the p-meta-model implies that all new W2000 conceptsbe specified as extensions to standard UML elements, that is, W2000elements are subclasses of standard UML meta-model classes.This organization is partially shown in Figure,which collects some excerptsfrom the W2000 package; • Information Model Design(fig. a): classes Entity and Component are both subclasses of class Class (defined in the Core subpackage of the UMLFoundation package). Both classes are abstract classes because Entity arealways specialized in either EntityTypes or SpearEntities, whileComponents become ComponentTypes or SpearComponents. Types aresimilar to classes: They will be instantiated as many times as needed in the runningapplication; spear elements correspond to singletons: They specify special-purpose elements singularly instantiated in the application.

22/05/2002

A p-meta-model for W2000• Access Layer Design(fig. b): has a similar organization. A Collection,

abstract concept, comes from a Class and is specialized in SpearCollectionsand CollectionTypes. Moreover, each collection has a

CollectionCenterType,which is a subclass of Center-Type.

• Navigation Design(fig. c):

Once more, Nodes must be either NodeTypes or SpearNodes. Links must be

either CollectionLinks or SemanticLinks, or StructuralLinks.

Collection links relate the elements of a collection with their center, semantic links

correspond to semantic associations, and structural links render the component-based

decomposition of complex entities.

22/05/2002

A p-meta-model for W2000

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model– Impact on Jweb

• Conclusions and future work

22/05/2002

An example W2000 model

• Figure presents the information model for the paper entity type. The entity

is structured in three main components: The abstract is always part of the

paper and it presents some basic information, like the paper title, authors,

and affiliation, along with other information required by the conference, that

is, paper id (number) and review status.

22/05/2002

An xample W2000 model

• Either we have a first submission, or after accepting the paper, we have

its camera-ready version.

These components reuse also some information already defined in the abstract.

Each time an attribute (slot) is reused in a component, we simply refer to its original

definition, instead of re-specifying it.

This way, we avoid inconsistent redefinitions and we maximize reuse.

a)

22/05/2002

An xample W2000 model• When we move to navigation design, Figure 6(a), we see that the paper has

been decomposed in three nodes. Once more, the main one contains all base

information, while the other two nodes correspond to the first submission

and camera-ready respectively. The actual contents of these nodes is

specified using the keyword body, which make readers refer to the

information design to understand the actual contents.

b)

22/05/2002

An xample W2000 model

• For example, the contents of the AbstractNode node is defined by the

body of the Abstract component. The correspondence between nodes

and components is not mandatory, but it helps modularize the design.

• Users are free to specify the contents of nodes as lists of attributes taken

from the entities and components that they embody.

Figure 6(b) shows how the user of the Web application can navigate among

papers and authors.

22/05/2002

Impact on Jweb

• A briefly introduce on toolset for clarify its main components.

Jweb assists designers during the whole design process: from information

design to prototype and enactment. Figure shows its main logical

components:

• The editor lets designers design their applications using HDM/W2000 and produces a HDM/W2000 schema.

• The mapper takes this schema and automatically generates the relational

schema for the editorial repository, suitable interfaces for populating the repository,

and a general description (XML mapping) of the relational schema.

22/05/2002

Impact on Jweb

• The configurator reads the HDMschema, the description of the editorial repository, and the editorial contents andallows for the creation of special-purpose filters to select data; the description ofthese filters is rendered in XML.

• The generator uses the HDM/W2000 schema, the description of the editorialrepository and its contents, together with the filters defined to select data, andgenerates the run-time database, populating it with the editorial contents suitablyfiltered.

• The engine reads the contents from the run-time database, presents this contents to user and is responsible formanaging the interaction between the user and theapplication.

22/05/2002

Case study

• Introduction

• Feasibility Study

• W2000 as a profilable MOF Meta-model

• Technological solution

• A p-meta-model for W2000

• An example W2000 model

• Conclusions and future work

22/05/2002

Conclusions and Future Work

• The group experiments in using the meta-modeling technology to support

design tools are so far limited to the editor, but starting from the p-meta-

model they induced a non-trivial modification and they studied the impact of

these modifications.

• The main bottleneck was the definition and test of all (new) constraints in

Schematron, but all other changes were almost trivial and they could be

obtained automatically.

22/05/2002

Conclusions and Future Work

This exercise suggested two interesting considerations:

– The availability of a real MOF repository together with a friendlier notation for specifying constraints would further shorten the maintenance process.– If we had done the same exercise using our standard way, we would have used the following process:

1. The new meta-model would have been coded directly using a DTD, with suitable comments to explain the meaning of the new/changed features;

2. The implementer in charge of working on the new editor (component) would have taken this definition as the reference for his work.

22/05/2002

Software Engineering II

The End

22/05/2002

References• www.metamodel.com

– Site for to learn much about model metamodel end modeling– There’s many definition about models

• www.omg.org– Object Managment Group, leader of O-Otechniques– Unified Modeling Language Specification version 1.4, Beta 1, November 2000.– Meta Object Facility Specification version 1.3 New Edition: March 2000.

• www.jamesodell.com– Is a consultant, writer, and educator in the areas of object-oriented and agent-based systems,

business reengineering, and complex adaptive systems.– Meta-modelling 1995

saturne.info.uqam.ca/Labo_Recherche/Larc/MetamodelingWorkshop/Odell/metamodeling/metamodeling.ps

• baresi|garzotto|mainetti|[email protected]– Meta-modeling Techniques Meet Web Application Design Tools, L. Baresi, F.

Garzotto, L. Mainetti, and P. Paolini Dipartimento di Elettronica e Informazione

Politecnico di Milano www.elet.polimi.it