Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Modeling and meta-modeling presentation at LTH, Sweden
1. Modeling & meta-modeling
SERG, LTH – May 15, 2012
By: Saïd Assar1,2
(1) Telecom Ecole de Management, Department of Information Systems, Evry, France
(2) Centre de Recherche en Informatique, University of Paris 1 La Sorbonne, France
2. 1. Introduction & background
• Initial research work on CASE design, model
transformation, code generation (PhD, 1995)
Different research topics:
Methods and tools for SE & ISE
Technology adoption & diffusion
SERG@LTH – May 15, 2012 2
3. 1. Introduction & background (cont'd)
• INSTITUT TELECOM: 4 leading schools in engineering
and management
Telecom Ecole de
Management
Telecom Bretagne Telecom Sud Paris
Telecom Paris
SERG@LTH – May 15, 2012 3
4. 1. Introduction & background (cont'd)
Since 1999, long-term research collaboration with CRI at
Paris 1 Sorbonne
SERG@LTH – May 15, 2012 4
5. 1. Introduction & background (cont'd)
Objectives
Overview of modeling and meta-modeling in IS & SE
Present fundamental issues in modeling & meta-
modeling
Overview of available tools for meta-modeling
Sketch some actual research problems in meta-
modeling
SERG@LTH – May 15, 2012 5
6. 1. Introduction & background (cont'd)
Agenda
1. Introduction & background
2. About models
3. About meta-models
4. Computerized tools for meta-modeling
5. A meta-modeling application: model transformation
6. Behavior meta-modeling
7. Conclusion
SERG@LTH – May 15, 2012 6
8. 2. About models
"A model (M) for a system (S) and an observer (O) is any kind of representation
which can help O in answering questions about S"
Descriptive
models
Observer
Prescriptive
models
SERG@LTH – May 15, 2012 8
9. 2. About models (cont'd)
"A model (M) for a system (S) and an observer (O) is any kind of representation
which can help O in answering questions about S"
A model is an abstraction
A model is a reduction
A model helps in better understanding the real world object/artifact
A model is built using some kind of notation (formal and/or graphical)
A model is the result (i.e. the product) of some specific activity (i.e. the modeling
process)
Modeling is an essential activity in engineering
Modeling is deeply related to design
Models are essential for reasoning on the artifact being engineered
Models are artifacts, i.e. they can also be modeled
SERG@LTH – May 15, 2012 9
10. 2. About models (cont'd)
Models and modeling in computer science
What is modeled is information about concrete and abstract objects, relations,
links, events, operations, actors, roles, …
Classification is an essential facet in modeling
Models are constructed using modeling languages
Information models have specific properties (i.e. instantiability, executability)
Selling an object
An airplane ticket
An official document
(car registration)
SERG@LTH – May 15, 2012 10
11. 2. What is a model ? (cont'd)
Examples of models in computer science (1)
Conceptual data model name number location
fname minit lname 1
salary
N works for department
name sex address
1 number of
startdate employees
ssn 1
employee controls
1 manages
bdate
N
supervisor hours N
degree supervisee
1 M
supervision works on project
dependents of name number location
N
dependent
name sex birthdate relationship
SERG@LTH – May 15, 2012 11
12. 2. About models (cont'd)
Examples of models in computer science (2)
Physical DB model
SERG@LTH – May 15, 2012 12
13. 2. About models (cont'd)
Examples of models in computer science (3)
Informal process model
SERG@LTH – May 15, 2012 13
14. 2. About models (cont'd)
Examples of models in computer science (4)
More precise process
model (UML)
SERG@LTH – May 15, 2012 14
15. 2. About models (cont'd)
Examples of models in computer science (5)
More formal
process model
(BPMN)
SERG@LTH – May 15, 2012 15
16. 2. About models (cont'd)
Examples of models in computer science (5)
Strictly formal process model (Petri net)
SERG@LTH – May 15, 2012 16
17. 2. About models (cont'd)
Examples of models in computer science (6)
Executable web-service based process model (BPEL)
SERG@LTH – May 15, 2012 17
18. 2. About models (cont'd)
Examples of models in computer science (7)
Feature models to capture systems variability
Example 1
Example 2
SERG@LTH – May 15, 2012 18
19. 2. About models (cont'd)
Open problems in modeling
What is the quality of a model and how to evaluate it
How to validate a model
How to transform a model from one form to another
How to link and integrate complementary models
How to deal with model evolution
How to create models (i.e. modeling process)
What are the best usages of models
What are the best/most adequate modeling languages
How to express constraints that can't be directly represented
How to create modeling languages that are adequate, relevant, efficient, …
…
Model engineering
Model driven engineering
SERG@LTH – May 15, 2012 19
21. 3. About meta-models
Definition
• As model is an engineering artifact, it can be modeled
• Meta-models are formal representations of models (i.e. models of models)
• They are built using a (meta-) modeling language
• Meta-models generally describe structural properties of models, while behavioral
and semantic properties are expressed differently
• Meta-models formalize knowledge about modeling languages, i.e. abstract syntax
=> The modeling language is seen as instances of concepts in the meta-model
SERG@LTH – May 15, 2012 21
22. 3. About meta-models (cont'd)
Examples (1)
• Entity/Relationship meta-model (self description)
SERG@LTH – May 15, 2012 22
23. 3. About meta-models (cont'd)
Examples (2)
• A simple process meta-model (E/R style)
Source: Hanns-Alexander Dietrich, Exercice 1 Meta-modelling, European Research Center for Information
Systems, Information Modelling Summer Term 2012.
SERG@LTH – May 15, 2012 23
24. 3. About meta-models (cont'd)
Examples (2)
• A simple process meta-model (E/R style)
Source: Hanns-Alexander Dietrich, Exercice 1 Meta-modelling, European Research Center for Information
Systems, Information Modelling Summer Term 2012.
24
25. 3. About meta-models (cont'd)
Examples (3)
• An extract of the OMG SPEM meta-model (UML)
SERG@LTH – May 15, 2012 25
27. 3. About meta-models (cont'd)
Related concepts (2)
• Programming language syntax definition (C language)
C language abstract syntax can be easily defined as a meta-model
SERG@LTH – May 15, 2012 27
28. 3. About meta-models (cont'd)
Where does meta-modeling come from?
• Artificial intelligence (i.e. frame concept, Smalltalk, ObjVLisp1)
• Databases (i.e. meta-database)
• Object oriented modeling (i.e. Classes are objects too => MetaClasses, PowerTypes2)
[2] Mili, H., Pachet, F., Benyahia, I., Eddy, F.: Metamodeling in OO: OOPSLA’95 workshop
summary. Addendum to the proceedings of the 10th annual OPPSLA conference (OOPSLA’95).
ACM, New York, USA, pp. 105–110 (1995).
[1] Cointe, Pierre: Metaclasses are first class: The ObjVlisp
Model. SIGPLAN Notices. 22(12), 156–162 (1987).
SERG@LTH – May 15, 2012 28
29. 3. About meta-models (cont'd)
What for?
• Better understanding and communicating about a modeling language
• Reasoning on its structure, its semantics and its usage
• Comparing and evaluating modeling languages
• Design of new modeling languages
• Design and implementation of MDE approaches
• Design and implementation of new methods
(i.e. method engineering)
Henderson-Sellers, Brian: Method engineering for OO systems
SERG@LTH – May 15, 2012 development. Communication of the ACM. 46(10), 73–78 (2003). 29
30. 3. About meta-models (cont'd)
The instantiation problem (1)
• Meta-modeling is a specific form of modeling …
• However, if Class instances are Objects, what are the instances of MetaClasses ?
Purely conceptual meta-models (i.e. no instantiation)
Manual instantiation (i.e. translation/transformation based)
Direct instantiation using a specific meta-modeling language
SERG@LTH – May 15, 2012 30
31. 3. About meta-models (cont'd)
The instantiation problem (2)
• Manual instantiation to build an E/R repository
CREATE TABLE EntityType (EntityName, …)
CREATE TABLE RelationshipType (RelationName, … )
CREATE TABLE RelationLinkEntities(EntityName, RelName, cardinality, …)
CREATE TABLE Attributes( … )
…
SERG@LTH – May 15, 2012 31
32. 3. About meta-models (cont'd)
The instantiation problem (3)
•The meta-
modeling language
issue
Source: ibid, Hanns-Alexander Dietrich, 2012
SERG@LTH – May 15, 2012 32
33. 3. About meta-models (cont'd)
The instantiation problem (4)
• Meta-modeling frameworks and languages: Meta Object Facility (MOF) by OMG
=> Strict instanciation
SERG@LTH – May 15, 2012 33
34. 3. About meta-models (cont'd)
The instantiation problem (5)
• Meta-modeling frameworks and languages: Meta Object Facility (MOF) by OMG
Source: OMG
SERG@LTH – May 15, 2012 34
35. 3. About meta-models (cont'd)
The instantiation problem (6)
• Meta-modeling frameworks and languages: Meta Object Facility (MOF) by OMG
SERG@LTH – May 15, 2012 35
36. 3. About meta-models (cont'd)
The instantiation problem (7)
• Meta-modeling frameworks and languages: ISO/IEC 24744 standard (Software
Engineering Metamodel for Development Methodologies)
• Pbs:
– How to simultaneously create a generalization link AND an instantiation link
– How to a define Class attributes
– How to cross the strict instantiation levels
Task CodingTask T1
instance instance
+ TaskCategory TaskCategory: Coding + TaskDuration:10d
+ TaskDuration TaskDuration: ?
• Proposal: Powertypes & Clabject
– A Clabject is a combination of an Object and a Class
– A Powertype is the description of a Clabject at the type level
SERG@LTH – May 15, 2012 36
37. 3. About meta-models (cont'd)
The instantiation problem (8)
• Meta-modeling frameworks and languages: ISO/IEC 24744 standard (Software
Engineering Metamodel for Development Methodologies)
Source: Henderson-Sellers, B., Gonzalez-Perez, C.: The
rationale of powertype-based metamodelling to underpin
software development methodologies. Proceedings 2nd
Asia-Pacific conf. on Conceptual modelling - Volume 43. pp.
7–16. Australian Computer Society, Inc. (2005). 37
38. 3. About meta-models (cont'd)
The instantiation problem (9)
• Meta-modeling frameworks and languages: deep instantiation
• Proposal:
– Add an indicator (potency) of the abstraction level at which the attribute is to
be instantiated
Task CodingTask T1
instance instance
+ TaskCategory1 TaskCategory: Coding + TaskDuration:10d
+ TaskDuration0
SERG@LTH – May 15, 2012 38
40. 4. Computerized tools for meta-modeling
MetaEdit (1)
• A meta-CASE tool for automatic customization of CASE tools
• Result of research project at Jyväskyla (K. Lyytinen, M. Rossi, S. Kelly et al. - 1990')
• Actually commercialized by MetaCASE
• Targeted towards Domain Specific Modeling
Meta-model definition Model definition
(Executable)
Generate code
SERG@LTH – May 15, 2012 40
41. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (2)
• Meta-modeling language: GOPRR
• Graph
• Object
• Property
• Relationship
• Role
SERG@LTH – May 15, 2012 41
42. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (3)
• Meta-editing functionalities
SERG@LTH – May 15, 2012 42
43. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (4)
• Customized editor
SERG@LTH – May 15, 2012 43
44. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (5)
• MERL: A scripting language for generating code (i.e. flow of characters)
SERG@LTH – May 15, 2012 44
45. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (6)
• Example in MERL for generating SQL code from E/R schema
SERG@LTH – May 15, 2012 45
46. 4. Computerized tools for meta-modeling (cont'd)
MetaEdit (7)
• A detailed Domain Specific example
Source:
http://www.metacase.com/cases/phone_ex
ample.html
SERG@LTH – May 15, 2012 46
47. 4. Computerized tools for meta-modeling
Conceptbase (1)
• A deductive database supporting object-centered TELOS modeling language
• Result from research project DAIDA (J. Mylopoulos, M. Jarke et al. - 1990')
• Continued as an open source project (M. A. Jeusfled)
• Targeted towards Model Engineering
TELOS modeling language
• Any element (class, object, attribute, link, constraint … ) is internally represented as
a predicate in a deductive DB
• Attributes are first order objects i.e. they can have properties
• Attributes correspond to links between two elements
• Any object can be instantiated
Multiple instantiation ('Paul' in 'Employee' and 'Paul' in 'Student')
Multiple levels of instantiation
Multiple Generalisation/Specialisation (i.e. heritage)
Generalisation/Specialisation can co-exist with instantiation
SERG@LTH – May 15, 2012 47
48. 4. Computerized tools for meta-modeling (cont'd)
Conceptbase (2)
• Model llustration
Person in Class with Employee isA Person with
attribute attribute
ID: Integer; function: String
name:String end
end
Student isA Person with
Client isA Person with attribute
attribute age:Integer
reduction:Real end
end
SERG@LTH – May 15, 2012 48
49. 4. Computerized tools for meta-modeling (cont'd)
Conceptbase (3)
• Model illustration
John in Student, Employee, Client with
ID
id_john: 44555
name
name_j: "John Legrand"
reduction
r1: 30.0
function
f1: "Sale manager"
age
age1: 24
end
Client with constraint
reduction_OK:
$ forall c/Client x/Real (c reduction x) ==> (x>=5.0) $
end
QueryClass AllPeople isA Person with
constraint
Allpeople_c: $ exists s/String (this nom s) $
end 49
50. 4. Computerized tools for meta-modeling (cont'd)
Conceptbase (4)
• Meta-model illustration
SERG@LTH – May 15, 2012 50
52. 5. A meta-modeling application: model transformation
Transformation framework
• Transformation are expressed as declarative rules defined at the meta-model level
Source: Freddy Allilaire, Frédéric Jouault, Families to Persons - A simple illustration of model-to-model
transformation, ATLAS group, INRIA & University of Nantes, France
SERG@LTH – May 15, 2012 52
53. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (1)
• This is a toy example to transform two models
Transforming this … … into this.
… …
Family March Mr. Jim March
Father: Jim Mrs. Cindy March
Mother: Cindy Mr. Brandon March
Sons: Brandon Mrs. Brenda March
Daughters: Brenda … other Persons
… other Families
SERG@LTH – May 15, 2012 53
54. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (2)
• This is a toy example to transform two models
What is “Families”:
A collection of families. Family March
Father: Jim
Each family has a name and is composed Mother: Cindy
of members: Sons: Brandon
A father Daughters: Brenda
Family Sailor
A mother Father: Peter
Several sons Mother: Jackie
Sons: David, Dylan
Several daughters Daughters: Kelly
Each family member has a first name.
familyFather father
Family 0..1 1 Member
familyMother mother
0..1 1
familySon sons
lastName : String firstName : String
0..1 *
familyDaughter daughters
0..1 *
SERG@LTH – May 15, 2012 54
55. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (3)
• This is a toy example to transform two models
The same model can be described
as BNF syntax
<Families> ::= <One-family> | <Family> ";" < Families>
<Family> ::= "Family :" <lastName> <Father-part> <Mother-part> <Sons-part> <Daughters-part>
<Father-part> ::= "Father: " <firstName> | ""
<Mother-part> ::= "Mother: " <firstName> | ""
<Sons-part> ::= "Sons: " <Sons-list> | ""
<Daughters-part> ::= "Daughters: " <Daughters-list> | ""
<Sons-list> ::= <firstName> | <firstName> "," < Sons-list>
<Daughters-list > ::= <firstName> | <firstName> "," < Daughters-list >
<firstName> ::= [A-Z][a-z]+
<lastName> ::= [A-Z][a-z]+
SERG@LTH – May 15, 2012 55
56. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (4)
• This is a toy example to transform two models
Definition of the source model in
KM3 (EMOF)
package Families {
class Family {
attribute lastName : String;
reference father container : Member oppositeOf familyFather;
reference mother container : Member oppositeOf familyMother;
reference sons[*] container : Member oppositeOf familySon;
reference daughters[*] container : Member oppositeOf familyDaughter;
}
class Member {
attribute firstName : String;
reference familyFather[0-1] : Family oppositeOf father;
reference familyMother[0-1] : Family oppositeOf mother;
reference familySon[0-1] : Family oppositeOf sons;
reference familyDaughter[0-1] : Family oppositeOf daughters;
}
}
package PrimitiveTypes {
datatype String;
}
SERG@LTH – May 15, 2012 56
57. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (5)
• This is a toy example to transform two models
package Persons {
Definition of the target model in
KM3 (EMOF)
abstract class Person {
attribute fullName : String;
Person
}
fullName
class Male extends Person { }
class Female extends Person { }
}
Male Female
package PrimitiveTypes {
datatype String;
}
SERG@LTH – May 15, 2012 57
58. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (5)
• This is a toy example to transform two models
This is a function defined
by the engineer
(definition not shown)
Definition of transformation rules
rule Member2Female { -- Idem
from
s : Families!Member {(s.isFemale())
rule Member2Male
to from
t : Persons!Female Families!Member (not s.isFemale())
s : (
fullName <- s.firstName + ' ' + s.familyName
to
) t : Persons!Male (
} fullName <- s.firstName + ' ' + s.familyName
)
SERG@LTH – May 15, 2012 } 58
59. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (6)
First, create an ATL project
ATL tool interface
Next, define the ATL
transformation
Families:
IN:
Name of the
Name of the
source metamodel
source model in
in the
the transformation
transformation
OUT: Persons:
Name of the target Name of the target
model in the metamodel in the
transformation transformation
SERG@LTH – May 15, 2012 59
60. 5. A meta-modeling application: model transformation (cont'd)
Transformation example (7)
ATL tool interface
Last, apply the transformation meta-program on input data
SERG@LTH – May 15, 2012 60
62. 6. Behavior meta-modeling
Context & problem formulation
• Behavior perspectives are generally missing in software engineering
meta-models
Important knowledge about modeling languages is lacking
Essential for tools designers and method engineers
For a process modeling language, "behavior" perspective inquire
on its executable/operational semantics
Research goal
• How to express the operational semantics for a modeling language?
• How to design and build enactment engines for a given modeling
language?
Maintainability and portability are central issues
SERG@LTH – May 15, 2012 62
63. 6. Behavior meta-modeling (cont'd)
Methodological approach and expected results
• Problem formulation and analysis [INFORSID 2011, ICSOFT 2011]
• An exploratory study based on experimentation with MetaCASE
• A proposal for a new meta-modeling language to capture operational
semantics
Instantiation problem
An MDE approach for defining a generic approach to defining and
enacting a process modeling language
SERG@LTH – May 15, 2012 63
64. 6. Behavior meta-modeling (cont'd)
Methodological approach and expected results (1)
Step 1: structure
meta-model
Step 2: add the engine
architecture
SERG@LTH – May 15, 2012 64
65. 6. Behavior meta-modeling (cont'd)
Methodological approach and expected results (2)
Step 3: define the behavior using an event-oriented modeling language (ongoing work)
SERG@LTH – May 15, 2012 65
66. 6. Behavior meta-modeling (cont'd)
Methodological approach and expected results (3)
Step 4: transform the meta-models into an executable architecture based on the
publish/subscribe pattern (ongoing work)
SERG@LTH – May 15, 2012 66
68. 6. Conclusion
• Models are essential artifacts in IS & SE
• Modeling languages design and development is an active field of research
• No well established and recognized standard for meta-modeling
• Tool support is complicated
• … OMG's MOF and IBM Eclipse emerge as "market" leaders for UML & Java
• MetaEdit: leader for DSM engineering tools
• Conceptbase: most powerful and theoretically sound modeling language
• Semantics for process meta-models still to be defined
• Beyond DSM, few empirical studies on meta-modeling applications
SERG@LTH – May 15, 2012 68
69. References and links
References
• Atkinson, C., Kühne, T.: The Essence of Multilevel Metamodeling. In: Gogolla, M. et Kobryn, C. (éd.) «UML»
2001 — The Unified Modeling Language. Modeling Languages, Concepts, and Tools. LNCS, vol.2185, pp. 19-
33. Springer, (2001).
• Atkinson, C., Kuhne, T.: Model-driven development: a metamodeling foundation. IEEE Software. 20(5), 36
- 41 (2003).
• Henderson-Sellers, B., Gonzalez-Perez, C.: A comparison of four process metamodels and the creation of a
new generic standard. Info. and Software Technology. 47(1), 49-65 (2005).
• Kelly, S., Tolvanen, J.-P.: Domain-specific modeling: enabling full code generation. Wiley-Interscience: IEEE
Computer Society, Hoboken, N.J. (2008).
• Henderson-Sellers, B., González Pérez, C.A.: Metamodelling for software engineering. John Wiley,
Hoboken, NJ (2009).
• Gargantini, A., Riccobene, E., Scandurra, P.: A semantic framework for metamodel-based languages.
Automated Software Engineering. 16(3-4), 415-454 (2009).
• Jeusfeld, M., Jarke, M., Mylopoulos, J.: Metamodeling for method engineering. The MIT Press, (2009).
• Sprinkle, J., Rumpe, B., Vangheluwe, H., Karsai, G.: Metamodelling: State of the Art and Research
Challenges. In: Giese, H., Karsai, G., Lee, E., Rumpe, B., et Schätz, B. (éd.) Model-Based Engineering of
Embedded Real-Time Systems. LNCS, vol.6100, pp. 57-76. Springer, Berlin/Heidelberg (2011).
Links
• MOF homepage: http://www.omg.org/mof/
• ISO/IEC 24744:2007 (Software Engineering -- Metamodel for Development Methodologies):
http://www.iso.org/iso/catalogue_detail.htm?csnumber=38854
• OPEN (Object-oriented Process, Environment and Notation) : http://www.open.org.au/
• Metacase: http://www.metacase.com/
• Conceptbase: http://conceptbase.sourceforge.net/
• Kermeta: http://www.kermeta.org
69