SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Dr. Michael Prasse 1
Let’s Modularize the Data Model Specifications of the
ObjectLens in VisualWorks/Smalltalk
Dr. Michael Prasse
European Smalltalk User Group Conference
Prague, 4. September 2006
Informationstechnik,
die weiterbringt.
Dr. Michael Prasse 2
1. Introduction
Aims of the presentation
• ObjectLens Database Access Layer
• declarative definitions, design patterns, refactoring, product families
• monolithic ⇔ modular design
• adaptation of system components of VisualWorks
Dr. Michael Prasse 3
2. Context
Collogia Unternehmensberatung AG
• management consulting and software development
• > 50 employees
• 3 business fields: SAP consulting, project services, pension management
Pension Management
• VisualWorks since 1997
• Collphir Product Family: application software in the domain of pension schemes
• over 100 man years (including analysis, design, testing, maintenance)
We are not:
• a research organisation
• a framework or software tools vendor
Dr. Michael Prasse 4
Collphir - Software-Standard of management of pension schemes
Dr. Michael Prasse 5
3. ObjectLens
Architecture
GUI
EXDI
Runtime
DatabaseDeclaration
LensSession
LensContainers
LensProxy
LensDatabaseTableLensDatamodel
LensStructureType
LensStructureVariable
LensGlobalDescriptor
LensApplicationModel
1
LensDatabaseTableColumn
LensSQLTransporter
ExternalDatabaseSessionExternalDatabaseConnection
LensObjectRegistry
connection
EmbeddedDetailSpe
LinkedDetailSpecLensAspectPath
Dr. Michael Prasse 6
Conceptual Mapping from Classes to Tables
Mapping
Support
Concept Mapping
calculus level Φ: object calculus → relational calculus (static semantics)
directly class level Φclasses: classes → tables
Each class is unambiguously mapped to one table.
You can’t store objects of different subclasses in the same
table.
directly instance variable level Φinstance variables: variables → columns
simple data types are mapped directly to one column
object references
(1:1 relationship)
are realized as a foreign key relationship
indirectly 1:n and n:m
relationships
additional tables and select-statements
(association classes)
no support inheritance A table contains all instance variables of the class including
inherited variables.
no support polymorphism own support for untyped object references
foreign key = (classID, objectID).
Dr. Michael Prasse 7
Programming Metaphor
programmer
• explicit persistence
• The ObjectLens is interpreted as a persistent collection.
• to make an object persistent: aLensSession add: anObject
• to remove an object from the database: aLensSession remove: anObject
• Database queries can be written in Smalltalk (select:).
internal
• automatic „isDirty“ detection of all persistent objects in the Lens
• flat transactions (begin, rollback, commit)
• proxy objects
¬ Smalltalk syntax can be used for persistent objects.
¬ This reduces the impedance mismatch.
Dr. Michael Prasse 8
4. DataModelSpec
Conception
• declarative description of a LensDataModel
• LiteralArray (Array of Arrays)
• encoding:
LensDataModel>>literalArrayEncoding
• decoding:
LensDataModel>>fromLiteralArrayEncoding:anArray
• using the methods literalArrayEncoding and fromLiteralArrayEncoding: then you can
switch between the data model level and the data model specification level.
¬ You can choose the language level for the specification.
 windowSpec of the GUI-Framework
Dr. Michael Prasse 9
Example
literal array
^#(Class
aspect value ...)
lens literal array
^#(#{Lens.LensDataModel}
#setDatabaseContext: #(...)
#structureTypes: #(
#(#{Lens.LensStructureType}
#memberClass: memberClass
#setVariables: #(
#(#{Lens.LensStructureVariable}
#name: 'angelegtAm'
#column: Database Column
#privateIsMapped: true )
...)
#table: Database Table )
...)
#lensPolicyName: #Mixed
#lensTransactionPolicyName: #PessimisticRR
#validity: #installed )
Dr. Michael Prasse 10
Properties
• One monolithic datamodelSpec describes the data model of an application.
• The data model has to contain all entity classes of the application.
• The lens structure type of a class defines all instance variables of a class including
inherited variables.
• Instance variables of a class can be mapped (persistent) or unmapped (transient).
Dr. Michael Prasse 11
Maintenance Problems
Class hierarchy problems
An instance variable is specified in each LensStructureType of a subclass.
You have to adapt all LensStructureTypes of subclasses:
¬ when you define a new instance variable of a super class.
¬ when you change the specification of an instance variable of a super class
¬ when you rename an instance variable of a superclass
¬ when you change the class hierarchy
An instance variable can be specified differently in several subclasses.
• geschlecht (engl. gender) : Boolean
• geschlecht (engl. gender) : {’m’, ’w’}
Dr. Michael Prasse 12
Example: Changing the class hierarchy
Dr. Michael Prasse 13
Example: Definition of a new class
Dr. Michael Prasse 14
Multiple datamodelSpec Problems
• One monolithic dataModelSpec is used to describe the data model of an application.
• Collphir:
• begin: one application ¬ one dataModelSpec
• today: a product family with common core ¬ multiple dataModelSpecs
• copy  paste an existing dataModelSpec and adapt this to the new require-
ments.
• overlapping parts in all dataModelSpecs concerning the common data basis
• synchronizing several dataModelSpecs
¬ The origin of all these problems is the redundant specification of instance variable
mappings in subclasses and datamodelSpecs.
¬ There is no single source principle for specifications of the ObjectLens.
Dr. Michael Prasse 15
5. Modularization of the ObjectLens
General Ideas
• general aspects: modularization and the use of inheritance
• The datamodelSpec is one aspect of the class and is organized by the class itself.
• We break up the monolithic specification in several pieces.
• Each piece describes the mapping of one class without inherited variables.
• The single class data specifications are the pieces from which the whole data model
specification is constructed.
• Instead of changing a central monolithic definition, we change only the modular defi-
nitions of the concerned classes.
¬ The result is a normal but generated monolithic data model specification.
¬ We change only the definition and construction process.
¬ All other aspects of the ObjectLens are unchanged.
Dr. Michael Prasse 16
Solution
a). We store the mappings in the domain classes.
b). We construct the datamodelSpec from these mapping fragments.
c). We support the common development tools.
d). We support the migration of our existing data model specifications.
Dr. Michael Prasse 17
Data Model Mappings of Classes
dataModelDefinitionSpec
 You should not override this message. 
^ self dataModelDefinition literalArrayEncoding
dataModelDefinition
 You should not override this message. You can adapt primDataModelDefinition
| type |
type := self primDataModelDefinition.
self primLocalDataModelDefinitionChanges: type.
type variables: (List withAll: type variables ).
type resolveStandalone.
^type
• The method primDataModelDefinition provides the standard implementation. It will
usually be automatically generated.
• The method primLocalDataModelDefinitionChanges: gives each class the opportu-
nity to override the inherited definitions. It is created by hand and describes chan-
ges, which should not be overridden by further generation steps.
Dr. Michael Prasse 18
COLPersistentModelprimDataModelDefinition
| type |
type := LensStructureType new.
type memberClass: self.
type table: ((Oracle7Table new) name: self name; owner: 'COLBAV').
type idGeneratorType: #userDefinedId.
^type
primDataModelDefinition
| type |
type := super primDataModelDefinition.
type variables add: #(#{Lens.LensStructureVariable} #name: 'name' #setValueType: #String
#fieldType: #String #column: #(#{Oracle7TableColumn} #name: 'name' #dataType: 'varchar2' #ma-
xColumnConstraint: 100) #generatesAccessor: false #generatesMutator: false #privateIsMapped:
true) decodeAsLiteralArray.
self addSummenspeicherVariableIn: type.
type table name: 'kontoZuordnung' .
^type
primLocalDataModelDefinitionChanges:type
| var |
super primLocalDataModelDefinitionChanges:type.
(type variableNamed: 'speicherBeleg') setValueType: #AtzSummenspeicherBeleg.
Dr. Michael Prasse 19
LensApplication datamodelSpec
dataModelSpecGenerated
| ldm |
(ldm := LensDataModel new)
application: self;
fromLiteralArrayEncoding: (self dataModelSpecForStructureTypeSpecs:
self dataModelStructureTypeSpecs).
self adaptDataModel: ldm.
ldm compile.
^ldm literalArrayEncoding
• The LensDataModel is created by self dataModelSpecForStructureTypeSpecs:
self dataModelStructureTypeSpecs.
• The method adaptDataModel permits adaptations, which are only valid for this spe-
cial application.
Dr. Michael Prasse 20
dataModelStructureTypeSpecs
^ self dataModelStructureTypeSpecsFor: self dataModelClasses
dataModelStructureTypeSpecsFor: classColl
^ (classColl collect:[ :cl | cl dataModelDefinitionSpec]) asArray
dataModelClasses
„Returns a set of all classes which contain to the data model“
dataModelSpecForStructureTypeSpecs: aColl
| res |
res := self dataModelTemplate copy.
res at: 5 put: aColl.
^res
dataModelTemplate
^#(#{Lens.LensDataModel}
#setDatabaseContext:
#(#{Oracle7Context} ... )
#structureTypes: #()
#lensPolicyName: #Mixed
#lensTransactionPolicyName: #PessimisticRR
#validity: #installed )
Dr. Michael Prasse 21
Integration into the Lens Modeling Tools
LensEditor for Class Data Models
LensMainApplication
openLensEditorFor:CollphirMainApplication
with: (Set new add: AtzBeleg; yourself)
Dr. Michael Prasse 22
Lens Mapping Tool for Class Data Models
DataModelDefinitionGenerator new
generateLensSpecsFrom: self ldm
for: selectedClasses
Dr. Michael Prasse 23
Migration Process
I). transformation T
generator := DataModelDefinitionGenerator new
add: AtzMainApplication dataSpec: #dataModelSpec;
add: ZwkMainApplication dataSpec: #dataModelSpec;
yourself.
II). conflict reports
generator report
III).data model classes
generator
generateDataModelClassesFor: AtzMainApplication dataSpec: #dataModelSpec .
IV).generating of all classes
generator generate
generating of a subset of classes
generator generateLensSpecsFrom: ldm
for: (Set new add: COLRente;add: COLAZ03 ;add: COLAZRR ;yourself)
Dr. Michael Prasse 24
Dictionary structure of transformation T
aLensDataModel
aDictionary of class transformations
aDictionary for one class
transformation
transformed
includes
aDictionary of instance variable
transformations
aSet of LensStructureTypes
#type #variables
variable - aSet of LensStructureVariables
includes
Dr. Michael Prasse 25
DataModelDefinitionGenerator - Generation and Migration
• migration of old monolithic dataModelSpecs
• generating class data models in the mapping tool
Data Model Spec Migration
• Computing the conflicts between different definitions of an entity (transformation T).
• conflict solving: two-step strategy
• trivial cases: different max column constraints ¬ weakest condition.
• complicated cases: pair reviews, which mapping should be become the stan-
dard.
Support of different mappings by using the methods primLocalDataModelDefini-
tionChanges and adaptDataModel.
Dr. Michael Prasse 26
Code Generation
• Generation of method dataModelClasses for the application
• Generation of method primDataModelDefinition from the corresponding classDict.
• Simple data mappings are inlined.
• Complicated mappings for foreign key relationships are extracted in separate
methods.
• Code generation uses common Smalltalk techniques.
• Methods:
• for invariant code fragments.
• which provides a string representation for related parts of the mapping like table
name, primary key, or variables.
• a stream to merge this fragments.
• Result: a source string of a Smalltalk method that we compile in the metaclass of the
considered class in the protocol ’lens data model specs’.
Dr. Michael Prasse 27
Testing and VV
Generation of dataModelSpecs
• simple test data for old dataModelSpecs
• simple test data for modular dataModelSpecs (same data)
• comparison of the datamodels
Migration
• reviews (code and dataModel)
• application test
• stepwise introduction
Editing
• development use

Contenu connexe

Similaire à Modular ObjectLens

7 latest-dot-net-interview-questions
7  latest-dot-net-interview-questions7  latest-dot-net-interview-questions
7 latest-dot-net-interview-questionssadiqkhanpathan
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 
TEI ODD based development
TEI ODD based developmentTEI ODD based development
TEI ODD based developmentEduard Drenth
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsLilia Sfaxi
 
Workshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsWorkshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsVisual Engineering
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity FrameworkMahmoud Tolba
 
136 latest dot net interview questions
136  latest dot net interview questions136  latest dot net interview questions
136 latest dot net interview questionssandi4204
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Gwendal Daniel
 
An Introduction to the Jena API
An Introduction to the Jena APIAn Introduction to the Jena API
An Introduction to the Jena APICraig Trim
 
An introduction to the MDA
An introduction to the MDAAn introduction to the MDA
An introduction to the MDALai Ha
 
Data Base Design.pptx
Data Base Design.pptxData Base Design.pptx
Data Base Design.pptxSunilMS21
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxelsagalgao
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patternsamitarcade
 
Rethink Smalltalk
Rethink SmalltalkRethink Smalltalk
Rethink SmalltalkESUG
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 

Similaire à Modular ObjectLens (20)

7 latest-dot-net-interview-questions
7  latest-dot-net-interview-questions7  latest-dot-net-interview-questions
7 latest-dot-net-interview-questions
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
TEI ODD based development
TEI ODD based developmentTEI ODD based development
TEI ODD based development
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Workshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsWorkshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design Patterns
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
136 latest dot net interview questions
136  latest dot net interview questions136  latest dot net interview questions
136 latest dot net interview questions
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
 
An Introduction to the Jena API
An Introduction to the Jena APIAn Introduction to the Jena API
An Introduction to the Jena API
 
An introduction to the MDA
An introduction to the MDAAn introduction to the MDA
An introduction to the MDA
 
Data Base Design.pptx
Data Base Design.pptxData Base Design.pptx
Data Base Design.pptx
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptx
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Objective-C
Objective-CObjective-C
Objective-C
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
 
Rethink Smalltalk
Rethink SmalltalkRethink Smalltalk
Rethink Smalltalk
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 

Plus de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Plus de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Dernier

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncObject Automation
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 

Dernier (20)

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation Inc
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 

Modular ObjectLens

  • 1. Dr. Michael Prasse 1 Let’s Modularize the Data Model Specifications of the ObjectLens in VisualWorks/Smalltalk Dr. Michael Prasse European Smalltalk User Group Conference Prague, 4. September 2006 Informationstechnik, die weiterbringt.
  • 2. Dr. Michael Prasse 2 1. Introduction Aims of the presentation • ObjectLens Database Access Layer • declarative definitions, design patterns, refactoring, product families • monolithic ⇔ modular design • adaptation of system components of VisualWorks
  • 3. Dr. Michael Prasse 3 2. Context Collogia Unternehmensberatung AG • management consulting and software development • > 50 employees • 3 business fields: SAP consulting, project services, pension management Pension Management • VisualWorks since 1997 • Collphir Product Family: application software in the domain of pension schemes • over 100 man years (including analysis, design, testing, maintenance) We are not: • a research organisation • a framework or software tools vendor
  • 4. Dr. Michael Prasse 4 Collphir - Software-Standard of management of pension schemes
  • 5. Dr. Michael Prasse 5 3. ObjectLens Architecture GUI EXDI Runtime DatabaseDeclaration LensSession LensContainers LensProxy LensDatabaseTableLensDatamodel LensStructureType LensStructureVariable LensGlobalDescriptor LensApplicationModel 1 LensDatabaseTableColumn LensSQLTransporter ExternalDatabaseSessionExternalDatabaseConnection LensObjectRegistry connection EmbeddedDetailSpe LinkedDetailSpecLensAspectPath
  • 6. Dr. Michael Prasse 6 Conceptual Mapping from Classes to Tables Mapping Support Concept Mapping calculus level Φ: object calculus → relational calculus (static semantics) directly class level Φclasses: classes → tables Each class is unambiguously mapped to one table. You can’t store objects of different subclasses in the same table. directly instance variable level Φinstance variables: variables → columns simple data types are mapped directly to one column object references (1:1 relationship) are realized as a foreign key relationship indirectly 1:n and n:m relationships additional tables and select-statements (association classes) no support inheritance A table contains all instance variables of the class including inherited variables. no support polymorphism own support for untyped object references foreign key = (classID, objectID).
  • 7. Dr. Michael Prasse 7 Programming Metaphor programmer • explicit persistence • The ObjectLens is interpreted as a persistent collection. • to make an object persistent: aLensSession add: anObject • to remove an object from the database: aLensSession remove: anObject • Database queries can be written in Smalltalk (select:). internal • automatic „isDirty“ detection of all persistent objects in the Lens • flat transactions (begin, rollback, commit) • proxy objects ¬ Smalltalk syntax can be used for persistent objects. ¬ This reduces the impedance mismatch.
  • 8. Dr. Michael Prasse 8 4. DataModelSpec Conception • declarative description of a LensDataModel • LiteralArray (Array of Arrays) • encoding: LensDataModel>>literalArrayEncoding • decoding: LensDataModel>>fromLiteralArrayEncoding:anArray • using the methods literalArrayEncoding and fromLiteralArrayEncoding: then you can switch between the data model level and the data model specification level. ¬ You can choose the language level for the specification. windowSpec of the GUI-Framework
  • 9. Dr. Michael Prasse 9 Example literal array ^#(Class aspect value ...) lens literal array ^#(#{Lens.LensDataModel} #setDatabaseContext: #(...) #structureTypes: #( #(#{Lens.LensStructureType} #memberClass: memberClass #setVariables: #( #(#{Lens.LensStructureVariable} #name: 'angelegtAm' #column: Database Column #privateIsMapped: true ) ...) #table: Database Table ) ...) #lensPolicyName: #Mixed #lensTransactionPolicyName: #PessimisticRR #validity: #installed )
  • 10. Dr. Michael Prasse 10 Properties • One monolithic datamodelSpec describes the data model of an application. • The data model has to contain all entity classes of the application. • The lens structure type of a class defines all instance variables of a class including inherited variables. • Instance variables of a class can be mapped (persistent) or unmapped (transient).
  • 11. Dr. Michael Prasse 11 Maintenance Problems Class hierarchy problems An instance variable is specified in each LensStructureType of a subclass. You have to adapt all LensStructureTypes of subclasses: ¬ when you define a new instance variable of a super class. ¬ when you change the specification of an instance variable of a super class ¬ when you rename an instance variable of a superclass ¬ when you change the class hierarchy An instance variable can be specified differently in several subclasses. • geschlecht (engl. gender) : Boolean • geschlecht (engl. gender) : {’m’, ’w’}
  • 12. Dr. Michael Prasse 12 Example: Changing the class hierarchy
  • 13. Dr. Michael Prasse 13 Example: Definition of a new class
  • 14. Dr. Michael Prasse 14 Multiple datamodelSpec Problems • One monolithic dataModelSpec is used to describe the data model of an application. • Collphir: • begin: one application ¬ one dataModelSpec • today: a product family with common core ¬ multiple dataModelSpecs • copy paste an existing dataModelSpec and adapt this to the new require- ments. • overlapping parts in all dataModelSpecs concerning the common data basis • synchronizing several dataModelSpecs ¬ The origin of all these problems is the redundant specification of instance variable mappings in subclasses and datamodelSpecs. ¬ There is no single source principle for specifications of the ObjectLens.
  • 15. Dr. Michael Prasse 15 5. Modularization of the ObjectLens General Ideas • general aspects: modularization and the use of inheritance • The datamodelSpec is one aspect of the class and is organized by the class itself. • We break up the monolithic specification in several pieces. • Each piece describes the mapping of one class without inherited variables. • The single class data specifications are the pieces from which the whole data model specification is constructed. • Instead of changing a central monolithic definition, we change only the modular defi- nitions of the concerned classes. ¬ The result is a normal but generated monolithic data model specification. ¬ We change only the definition and construction process. ¬ All other aspects of the ObjectLens are unchanged.
  • 16. Dr. Michael Prasse 16 Solution a). We store the mappings in the domain classes. b). We construct the datamodelSpec from these mapping fragments. c). We support the common development tools. d). We support the migration of our existing data model specifications.
  • 17. Dr. Michael Prasse 17 Data Model Mappings of Classes dataModelDefinitionSpec You should not override this message. ^ self dataModelDefinition literalArrayEncoding dataModelDefinition You should not override this message. You can adapt primDataModelDefinition | type | type := self primDataModelDefinition. self primLocalDataModelDefinitionChanges: type. type variables: (List withAll: type variables ). type resolveStandalone. ^type • The method primDataModelDefinition provides the standard implementation. It will usually be automatically generated. • The method primLocalDataModelDefinitionChanges: gives each class the opportu- nity to override the inherited definitions. It is created by hand and describes chan- ges, which should not be overridden by further generation steps.
  • 18. Dr. Michael Prasse 18 COLPersistentModelprimDataModelDefinition | type | type := LensStructureType new. type memberClass: self. type table: ((Oracle7Table new) name: self name; owner: 'COLBAV'). type idGeneratorType: #userDefinedId. ^type primDataModelDefinition | type | type := super primDataModelDefinition. type variables add: #(#{Lens.LensStructureVariable} #name: 'name' #setValueType: #String #fieldType: #String #column: #(#{Oracle7TableColumn} #name: 'name' #dataType: 'varchar2' #ma- xColumnConstraint: 100) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true) decodeAsLiteralArray. self addSummenspeicherVariableIn: type. type table name: 'kontoZuordnung' . ^type primLocalDataModelDefinitionChanges:type | var | super primLocalDataModelDefinitionChanges:type. (type variableNamed: 'speicherBeleg') setValueType: #AtzSummenspeicherBeleg.
  • 19. Dr. Michael Prasse 19 LensApplication datamodelSpec dataModelSpecGenerated | ldm | (ldm := LensDataModel new) application: self; fromLiteralArrayEncoding: (self dataModelSpecForStructureTypeSpecs: self dataModelStructureTypeSpecs). self adaptDataModel: ldm. ldm compile. ^ldm literalArrayEncoding • The LensDataModel is created by self dataModelSpecForStructureTypeSpecs: self dataModelStructureTypeSpecs. • The method adaptDataModel permits adaptations, which are only valid for this spe- cial application.
  • 20. Dr. Michael Prasse 20 dataModelStructureTypeSpecs ^ self dataModelStructureTypeSpecsFor: self dataModelClasses dataModelStructureTypeSpecsFor: classColl ^ (classColl collect:[ :cl | cl dataModelDefinitionSpec]) asArray dataModelClasses „Returns a set of all classes which contain to the data model“ dataModelSpecForStructureTypeSpecs: aColl | res | res := self dataModelTemplate copy. res at: 5 put: aColl. ^res dataModelTemplate ^#(#{Lens.LensDataModel} #setDatabaseContext: #(#{Oracle7Context} ... ) #structureTypes: #() #lensPolicyName: #Mixed #lensTransactionPolicyName: #PessimisticRR #validity: #installed )
  • 21. Dr. Michael Prasse 21 Integration into the Lens Modeling Tools LensEditor for Class Data Models LensMainApplication openLensEditorFor:CollphirMainApplication with: (Set new add: AtzBeleg; yourself)
  • 22. Dr. Michael Prasse 22 Lens Mapping Tool for Class Data Models DataModelDefinitionGenerator new generateLensSpecsFrom: self ldm for: selectedClasses
  • 23. Dr. Michael Prasse 23 Migration Process I). transformation T generator := DataModelDefinitionGenerator new add: AtzMainApplication dataSpec: #dataModelSpec; add: ZwkMainApplication dataSpec: #dataModelSpec; yourself. II). conflict reports generator report III).data model classes generator generateDataModelClassesFor: AtzMainApplication dataSpec: #dataModelSpec . IV).generating of all classes generator generate generating of a subset of classes generator generateLensSpecsFrom: ldm for: (Set new add: COLRente;add: COLAZ03 ;add: COLAZRR ;yourself)
  • 24. Dr. Michael Prasse 24 Dictionary structure of transformation T aLensDataModel aDictionary of class transformations aDictionary for one class transformation transformed includes aDictionary of instance variable transformations aSet of LensStructureTypes #type #variables variable - aSet of LensStructureVariables includes
  • 25. Dr. Michael Prasse 25 DataModelDefinitionGenerator - Generation and Migration • migration of old monolithic dataModelSpecs • generating class data models in the mapping tool Data Model Spec Migration • Computing the conflicts between different definitions of an entity (transformation T). • conflict solving: two-step strategy • trivial cases: different max column constraints ¬ weakest condition. • complicated cases: pair reviews, which mapping should be become the stan- dard. Support of different mappings by using the methods primLocalDataModelDefini- tionChanges and adaptDataModel.
  • 26. Dr. Michael Prasse 26 Code Generation • Generation of method dataModelClasses for the application • Generation of method primDataModelDefinition from the corresponding classDict. • Simple data mappings are inlined. • Complicated mappings for foreign key relationships are extracted in separate methods. • Code generation uses common Smalltalk techniques. • Methods: • for invariant code fragments. • which provides a string representation for related parts of the mapping like table name, primary key, or variables. • a stream to merge this fragments. • Result: a source string of a Smalltalk method that we compile in the metaclass of the considered class in the protocol ’lens data model specs’.
  • 27. Dr. Michael Prasse 27 Testing and VV Generation of dataModelSpecs • simple test data for old dataModelSpecs • simple test data for modular dataModelSpecs (same data) • comparison of the datamodels Migration • reviews (code and dataModel) • application test • stepwise introduction Editing • development use