SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler 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)

Mais conteúdo relacionado

Semelhante a Undefined Classes for Pharo

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
 
Advanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAnil Madhavapeddy
 
OSCON: Advanced Docker developer workflows on Mac OS and Windows
OSCON: Advanced Docker developer workflows on Mac OS and WindowsOSCON: Advanced Docker developer workflows on Mac OS and Windows
OSCON: Advanced Docker developer workflows on Mac OS and WindowsDocker, Inc.
 
Introduction to XPConnect
Introduction to XPConnectIntroduction to XPConnect
Introduction to XPConnectAnant Narayanan
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovypaulbowler
 
1assembly in c#
1assembly in c#1assembly in c#
1assembly in c#Sireesh K
 

Semelhante a Undefined Classes for Pharo (20)

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
 
Advanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
 
OSCON: Advanced Docker developer workflows on Mac OS and Windows
OSCON: Advanced Docker developer workflows on Mac OS and WindowsOSCON: Advanced Docker developer workflows on Mac OS and Windows
OSCON: Advanced Docker developer workflows on Mac OS and Windows
 
Docker Dojo
Docker DojoDocker Dojo
Docker Dojo
 
Introduction to XPConnect
Introduction to XPConnectIntroduction to XPConnect
Introduction to XPConnect
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
 
1assembly in c#
1assembly in c#1assembly in c#
1assembly in c#
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 

Mais de Guille Polito

Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesRun-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesGuille Polito
 
PADR - Engineering for Reseach
PADR - Engineering for ReseachPADR - Engineering for Reseach
PADR - Engineering for ReseachGuille Polito
 
Understanding the Pharo dev Process
Understanding the Pharo dev ProcessUnderstanding the Pharo dev Process
Understanding the Pharo dev ProcessGuille Polito
 
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Guille Polito
 
Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Guille Polito
 
Virtual Smalltalk Images - IWST - ESUG 2013
Virtual Smalltalk Images - IWST - ESUG 2013Virtual Smalltalk Images - IWST - ESUG 2013
Virtual Smalltalk Images - IWST - ESUG 2013Guille Polito
 
Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Guille Polito
 
Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Guille Polito
 
DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011Guille Polito
 

Mais de Guille Polito (9)

Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesRun-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
 
PADR - Engineering for Reseach
PADR - Engineering for ReseachPADR - Engineering for Reseach
PADR - Engineering for Reseach
 
Understanding the Pharo dev Process
Understanding the Pharo dev ProcessUnderstanding the Pharo dev Process
Understanding the Pharo dev Process
 
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
 
Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013
 
Virtual Smalltalk Images - IWST - ESUG 2013
Virtual Smalltalk Images - IWST - ESUG 2013Virtual Smalltalk Images - IWST - ESUG 2013
Virtual Smalltalk Images - IWST - ESUG 2013
 
Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Where am I in my Phd - October 2012
Where am I in my Phd - October 2012
 
Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012
 
DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011
 

Último

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Último (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 

Undefined Classes for Pharo

  • 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)