SlideShare a Scribd company logo
1 of 19
Download to read offline
First-Class

Undefined Classes

for Pharo
From Alternative Designs to a Unified Practical Solution
Guille Polito, Luc Fabresse, Stéphane Ducasse
@guillepolito
Context
Package
Dependency
Object
Platform
workingDirectory
Windows
workingDirectory
Platform
workingDirectory
Unix
call:library:
FFI
Platform >> workingDirectory
^ self subclassResponsibility
Windows >> workingDirectory
^ FFI call: ’_getcwd’ library: LibC
Unix >> workingDirectory
^ FFI call: ’getcwd’ library: LibC
Problem Overview
Load
Error!
Package
Platform
workingDirectory
Windows
workingDirectory
Platform
workingDirectory
Unix
Problem Statement
• Loading code with unresolved class references
happens when:
• Migrating code to new Pharo versions
• Loading code with unknown or cyclic dependencies
Problem of Tools
Undefined Classes
• First-class entity representing non-existing classes to load:
• subclasses with unknown superclasses
• methods extending unknown classes
• Single and uniform mechanism for all tools
Design 1
Object
Class
UndefinedClass UndefinedClass
class
Windows
Windows class
Unix Unix class
Shared for all non-existent classes (name lost, …)
A unique UndefinedClass class
Design 2
One instance of UndefinedClass per undefined class
Object Class
UndefinedClass
Windows
Windows class
WindowsFFI WindowsFFI class
Platform
FFI
UndefinedClass
class
Class class
Complex and tools issue that must deal with
UndefinedClass instances in addition to Classes and Traits
Design 3
One subclass of UndefinedClass per undefined class
Object
Class
UndefinedClass
UndefinedClass
class
Windows Windows class
WindowsFFI WindowsFFI class
Platform Platform class
FFI FFI class
UndefinedClass will behave as a normal defined class (can
be instantiated? …)
Design selection for Pharo
Ensuring Loading Correctness
• Only one UndefinedClass subclass per missing
class (identity)
• UndefinedClass subclass automatic migration, and
destruction when loading the actual class
• System uniformity i.e., all code loading mechanism
relies on our system
UndefinedClasses MOP
• an UndefinedClass cannot be instantiated
• UndefinedClass>>doesNotUnderstand: throws a
notifying error
• prevent misunderstanding with sub-instances
Tools Integration
• Monticello
• create undefined classes at load time if needed
• create the extended class as UndefinedClasses if
non-existing
• CodeImporter
• parse class definition expressions and create
undefined superclasses if needed
• create the extended class as UndefinedClasses if
non-existing
UndefinedClasses
in action
Migrating Old Code
• Seaside 2.8 (2011)
• subclasses of PackageInfo (removed in Pharo 4)
• extension methods in BlockContext (removed ~Pharo 2)
and ContextPart (renamed Context in Pharo 4)
ConfigurationOfSeaside28 load
• Omni Browser (2015)
• subclasses + extension methods of undefined classes
• class-side initialize with references to undefined classes
ConfigurationOfOmniBrowser project lastVersion load
Loading Order
• Loading Seaside 3 and its 59 monticello packages
dependencies in a random order
Seaside3LoadingTest>> testLoadingSeasidePackagesInRandomOrder
| maxNbOfUndefinedClasses |
self assert: UndefinedClass allSubclasses isEmpty.
maxNbOfUndefinedClasses := self loadSeasidePackagesInRandomOrder.
self assert: maxNbOfUndefinedClasses > 0.
self assert: UndefinedClass allSubclasses isEmpty.
self executeInitializeClassMethodsInCorrectOrder.
self assertAllSeasideUnitTestsAreGreen.
Conclusion
• An UndefinedClass
• is a first-class entity representing one missing class
• stores all information (name, extension methods, …)
• can be subclassed and referenced
• is destroyed when loading actual class definition after
introducing all infos in the real class
• has a specific MOP
• is compliant with tools (MC, CodeImporter)
Future Work
• Integration of Undefined Classes into Pharo 7.0
• Towards a module system:
• when loading a module, class references inside a
module may not be resolved until we bound them
Conclusion
• An UndefinedClass
• is a first-class entity representing one missing class
• stores all information (name, extension methods, …)
• can be subclassed and referenced
• is destroyed when loading actual class definition after
introducing all infos in the real class
• has a specific MOP
• is compliant with tools (MC, CodeImporter)

More Related Content

What's hot

core java programming
core java programmingcore java programming
core java programmingAnnu Raj
 
Tips and Tricks for Testing Lambda Expressions in Android
Tips and Tricks for Testing Lambda Expressions in AndroidTips and Tricks for Testing Lambda Expressions in Android
Tips and Tricks for Testing Lambda Expressions in AndroidDavid Carver
 
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...DevClub_lv
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....AboutYouGmbH
 
Process program9 cm604.5
Process program9 cm604.5Process program9 cm604.5
Process program9 cm604.5myrajendra
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript FundamentalsSunny Sharma
 
Typescript 101 introduction
Typescript 101   introductionTypescript 101   introduction
Typescript 101 introductionBob German
 
Creating Windows Runtime Components
Creating Windows Runtime Components Creating Windows Runtime Components
Creating Windows Runtime Components Mirco Vanini
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviWinston Levi
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understandingmametter
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Logging and Exception
Logging and ExceptionLogging and Exception
Logging and ExceptionAzeem Mumtaz
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. Adform ResearchVasil Remeniuk
 

What's hot (20)

Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 
core java programming
core java programmingcore java programming
core java programming
 
Tips and Tricks for Testing Lambda Expressions in Android
Tips and Tricks for Testing Lambda Expressions in AndroidTips and Tricks for Testing Lambda Expressions in Android
Tips and Tricks for Testing Lambda Expressions in Android
 
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
 
Process program9 cm604.5
Process program9 cm604.5Process program9 cm604.5
Process program9 cm604.5
 
Getting started with typescript
Getting started with typescriptGetting started with typescript
Getting started with typescript
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript Fundamentals
 
Typescript 101 introduction
Typescript 101   introductionTypescript 101   introduction
Typescript 101 introduction
 
Creating Windows Runtime Components
Creating Windows Runtime Components Creating Windows Runtime Components
Creating Windows Runtime Components
 
testing ppt
testing ppttesting ppt
testing ppt
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston Levi
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
TypeScript intro
TypeScript introTypeScript intro
TypeScript intro
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Logging and Exception
Logging and ExceptionLogging and Exception
Logging and Exception
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. Adform Research
 

Similar to First-Class Undefined Classes for Pharo, From Alternative Designs to a Unified Practical Solution

Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right wayChristian Varela
 
Plone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, BelgiumPlone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, BelgiumAndreas Jung
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedbackNicolas Degardin
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific FilesystemVanessa S
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with condaTravis Oliphant
 
Docker Global Hack Day #3
Docker Global Hack Day #3 Docker Global Hack Day #3
Docker Global Hack Day #3 Docker, Inc.
 
Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Paul Jones
 
Towards easy program migration using language virtualization
 Towards easy program migration using language virtualization Towards easy program migration using language virtualization
Towards easy program migration using language virtualizationESUG
 
Building Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdfBuilding Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdfSuraj Deshmukh
 
VM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesVM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesCodefresh
 
Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)Paul Jones
 
3.1.d manual bash script guide lsstv 2.0r11
3.1.d manual bash script guide lsstv 2.0r113.1.d manual bash script guide lsstv 2.0r11
3.1.d manual bash script guide lsstv 2.0r11Acácio Oliveira
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016Codemotion
 
Building Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projectBuilding Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projecttwcoimbatore
 
j-chap1-Basics.ppt
j-chap1-Basics.pptj-chap1-Basics.ppt
j-chap1-Basics.pptSmitaBorkar9
 

Similar to First-Class Undefined Classes for Pharo, From Alternative Designs to a Unified Practical Solution (20)

Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 
Plone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, BelgiumPlone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, Belgium
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedback
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific Filesystem
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
 
Docker Global Hack Day #3
Docker Global Hack Day #3 Docker Global Hack Day #3
Docker Global Hack Day #3
 
Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)
 
Towards easy program migration using language virtualization
 Towards easy program migration using language virtualization Towards easy program migration using language virtualization
Towards easy program migration using language virtualization
 
Building Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdfBuilding Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdf
 
VM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesVM vs Docker-Based Pipelines
VM vs Docker-Based Pipelines
 
Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)
 
3.1.d manual bash script guide lsstv 2.0r11
3.1.d manual bash script guide lsstv 2.0r113.1.d manual bash script guide lsstv 2.0r11
3.1.d manual bash script guide lsstv 2.0r11
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016
To ∞ (~65K) and beyond! - Sebastiano Gottardo - Codemotion Milan 2016
 
Building Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projectBuilding Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto project
 
cms.ppt
cms.pptcms.ppt
cms.ppt
 
Composer
ComposerComposer
Composer
 
j-chap1-Basics.ppt
j-chap1-Basics.pptj-chap1-Basics.ppt
j-chap1-Basics.ppt
 
Pos 433 pos433
Pos 433 pos433Pos 433 pos433
Pos 433 pos433
 

More from 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
 

More from 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
 

Recently uploaded

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 

Recently uploaded (20)

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

First-Class Undefined Classes for Pharo, From Alternative Designs to a Unified Practical Solution

  • 1. First-Class
 Undefined Classes
 for Pharo From Alternative Designs to a Unified Practical Solution Guille Polito, Luc Fabresse, Stéphane Ducasse @guillepolito
  • 2. Context Package Dependency Object Platform workingDirectory Windows workingDirectory Platform workingDirectory Unix call:library: FFI Platform >> workingDirectory ^ self subclassResponsibility Windows >> workingDirectory ^ FFI call: ’_getcwd’ library: LibC Unix >> workingDirectory ^ FFI call: ’getcwd’ library: LibC
  • 4. Problem Statement • Loading code with unresolved class references happens when: • Migrating code to new Pharo versions • Loading code with unknown or cyclic dependencies
  • 6. Undefined Classes • First-class entity representing non-existing classes to load: • subclasses with unknown superclasses • methods extending unknown classes • Single and uniform mechanism for all tools
  • 7. Design 1 Object Class UndefinedClass UndefinedClass class Windows Windows class Unix Unix class Shared for all non-existent classes (name lost, …) A unique UndefinedClass class
  • 8. Design 2 One instance of UndefinedClass per undefined class Object Class UndefinedClass Windows Windows class WindowsFFI WindowsFFI class Platform FFI UndefinedClass class Class class Complex and tools issue that must deal with UndefinedClass instances in addition to Classes and Traits
  • 9. Design 3 One subclass of UndefinedClass per undefined class Object Class UndefinedClass UndefinedClass class Windows Windows class WindowsFFI WindowsFFI class Platform Platform class FFI FFI class UndefinedClass will behave as a normal defined class (can be instantiated? …)
  • 11. Ensuring Loading Correctness • Only one UndefinedClass subclass per missing class (identity) • UndefinedClass subclass automatic migration, and destruction when loading the actual class • System uniformity i.e., all code loading mechanism relies on our system
  • 12. UndefinedClasses MOP • an UndefinedClass cannot be instantiated • UndefinedClass>>doesNotUnderstand: throws a notifying error • prevent misunderstanding with sub-instances
  • 13. Tools Integration • Monticello • create undefined classes at load time if needed • create the extended class as UndefinedClasses if non-existing • CodeImporter • parse class definition expressions and create undefined superclasses if needed • create the extended class as UndefinedClasses if non-existing
  • 15. Migrating Old Code • Seaside 2.8 (2011) • subclasses of PackageInfo (removed in Pharo 4) • extension methods in BlockContext (removed ~Pharo 2) and ContextPart (renamed Context in Pharo 4) ConfigurationOfSeaside28 load • Omni Browser (2015) • subclasses + extension methods of undefined classes • class-side initialize with references to undefined classes ConfigurationOfOmniBrowser project lastVersion load
  • 16. Loading Order • Loading Seaside 3 and its 59 monticello packages dependencies in a random order Seaside3LoadingTest>> testLoadingSeasidePackagesInRandomOrder | maxNbOfUndefinedClasses | self assert: UndefinedClass allSubclasses isEmpty. maxNbOfUndefinedClasses := self loadSeasidePackagesInRandomOrder. self assert: maxNbOfUndefinedClasses > 0. self assert: UndefinedClass allSubclasses isEmpty. self executeInitializeClassMethodsInCorrectOrder. self assertAllSeasideUnitTestsAreGreen.
  • 17. Conclusion • An UndefinedClass • is a first-class entity representing one missing class • stores all information (name, extension methods, …) • can be subclassed and referenced • is destroyed when loading actual class definition after introducing all infos in the real class • has a specific MOP • is compliant with tools (MC, CodeImporter)
  • 18. Future Work • Integration of Undefined Classes into Pharo 7.0 • Towards a module system: • when loading a module, class references inside a module may not be resolved until we bound them
  • 19. Conclusion • An UndefinedClass • is a first-class entity representing one missing class • stores all information (name, extension methods, …) • can be subclassed and referenced • is destroyed when loading actual class definition after introducing all infos in the real class • has a specific MOP • is compliant with tools (MC, CodeImporter)