SlideShare a Scribd company logo
1 of 49
Download to read offline
Paul Leger, Universidad Católica del Norte, Chile
(pleger@ucn.cl / http://pleger.cl)
Nicolás Cardozo, Universidad de los Andes, Colombia
(n.cardozo@uniandes.edu.co)
Hidehiko Masuhara,Tokyo Institute of Technology, Japan
(masuhara@acm.org)
Journal First: Information & Software Technology (2023)
An Expressive and Modular Layer Activation
Mechanism for Context-Oriented Programming
INTRODUCTION
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
MOTIVATION FOR
CONTEXT-ORIENTED PROGRAMMING (COP)
Same application but
different modes of
execution
Landscape
Portrait
3
Method
draw
Impl 1
Impl 2
Impl 3
Impl 5
Impl 4
Impl 6
MOTIVATION FOR
CONTEXT-ORIENTED PROGRAMMING (COP)
Same application but
different modes of
execution
Landscape
Portrait
Maintainability 3
Method
draw
Impl 1
Impl 2
Impl 3
Impl 5
Impl 4
Impl 6
MOTIVATION FOR
CONTEXT-ORIENTED PROGRAMMING (COP)
Same application but
different modes of
execution
Landscape
Portrait
COP
(2005)
Maintainability 3
CONTEXT-ORIENTED PROGRAMING (COP)
Portrait Landscape
Two different modes that are
activated when the phone is rotated
These modes can be
contexts
4
CONTEXT-ORIENTED PROGRAMING (COP)
Portrait Landscape
Two different modes that are
activated when the phone is rotated
These modes can be
contexts
4
CONTEXT-ORIENTED PROGRAMING (COP)
Portrait Landscape
Two different modes that are
activated when the phone is rotated
Layers (contexts)
These modes can be
contexts
4
CONTEXT-ORIENTED PROGRAMING (COP)
Portrait Landscape
Two different modes that are
activated when the phone is rotated
Phone is
rotated The landscape layer is activated
i.e., draw behavior is modified
Phone is
rotated
Layers (contexts)
These modes can be
contexts
time
4
ACTIVATION MECHANISMS
How is a layer activated?
When the screen angle
changes
5
ACTIVATION MECHANISMS
activate landscape if
(screen.angle > 45);
When a particular state
changes
(Lambic-2012)
Implicit
How is a layer activated?
When the screen angle
changes
5
ACTIVATION MECHANISMS
activate landscape if
(screen.angle > 45);
When a particular state
changes
(Lambic-2012)
Implicit
How is a layer activated?
When the screen angle
changes
NOTE: They are other activation mechanisms
5
PROBLEM
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
WE CAN CURRENTLY OBSERVE AN IMPLICIT DEPENDENCY BETWEEN …
… base code and layers
(angle)
activate landscape if
(screen.angle > THRESHOLD);
Implicit
7
WE CAN CURRENTLY OBSERVE AN IMPLICIT DEPENDENCY BETWEEN …
… base code and layers
(angle)
So what ….
Problems in … Reuse? Evolution?
activate landscape if
(screen.angle > THRESHOLD);
Implicit
7
IMPLICIT DEPENDENCY PROBLEMS: REUSE
Smartphone Layers
8
IMPLICIT DEPENDENCY PROBLEMS: REUSE
Smartphone Tablet
(a new scenario)
Layers
How about angles in other
format, even worse,
if it does not exist!
8
IMPLICIT DEPENDENCY PROBLEMS: EVOLUTION
Smartphone Layers
Base code changed
A layer needs to be modified to satisfy
the new requirements of base code
9
FIXED SCOPE STRATEGY FOR LAYERS
Most
Videogames
with landscape support
Layers
10
FIXED SCOPE STRATEGY FOR LAYERS
A layer needs a scope
to know where it should be applied or not
Most
Videogames
with landscape support
A videogame
that needs always
a portrait view
Layers
10
PROPOSAL
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
EMA: EXPRESSIVE AND MODULAR ACTIVATION
MECHANISM
Base
code
Interface Layer
EMA promotes the reuse of layers through:
1. separating layers and base code
2. customizing the scope to any layer deployment
exposes
Reads
12
EMA: EXPRESSIVE AND MODULAR ACTIVATION
MECHANISM
Base
code
Interface Layer
EMA promotes the reuse of layers through:
1. separating layers and base code
2. customizing the scope to any layer deployment
Explicit dependency
exposes
Reads
12
EMA: EXPRESSIVE AND MODULAR ACTIVATION
MECHANISM
Base
code
Interface Layer
EMA promotes the reuse of layers through:
1. separating layers and base code
2. customizing the scope to any layer deployment
Explicit dependency
Scope
Specific scope
strategy per Layer
Customizable scope
strategy per layer
exposes
Reads
12
SEPARATION OF LAYERS AND BASE CODE: REUSE
Smartphone Layers
Interface
13
rotation
SEPARATION OF LAYERS AND BASE CODE: REUSE
Smartphone Tablet
Layers
The interface can support
expressions which gives more
flexibility
Interface
Interface
13
rotation
SEPARATION OF LAYERS AND BASE CODE: EVOLUTION
Smartphone Layers
Developers can update the base
code without modifying the layer 14
rotation
SEPARATION OF LAYERS AND BASE CODE: EVOLUTION
Smartphone Tablet
Layers
Developers can update the base
code without modifying the layer
You can still reuse with a Tablet 14
rotation
ACTIVATION MECHANISMS: IMPERATIVE, EVENT-BASED, AND IMPLICIT
if (screen.angle > THRESHOLD) {
//applying layer on base code
with(landscape) {
playerView.draw();
}
}
Using a construct, a programmer
explicitly activates a layer
(ContextJ-2011)
Imperative
on(* playerView.draw()) &&
when(screen.angle > THRESHOLD){
with(landscape);
}
When specific some
events happen
(Jcop-2011)
Event-Based
activate landscape if
(screen.angle > THRESHOLD);
When a condition
changes
(Lambic-2011)
Implicit
How is a layer activated?
15
CUSTOMIZABLE SCOPE STRATEGY
EMA provides an API to expressively define
the scope strategy required by layers 16
FLEXIBLE LAYER SCOPING
RotationCondition = () => rotation > THRESHOLD
Implicit
17
FLEXIBLE LAYER SCOPING
RotationCondition = () => rotation > THRESHOLD
Implicit
EMA.activate(allOf(RotationCondition))
EMA.activate(allOf(RotationCondition), screen)
EMA.activate(atMostOne(RotationCondition), Screen)
EMA Activation for a single object
instance, for all applicable objects
Activation for all objects of a class,
for at most one of the instances
that satisfy the condition
17
VALIDATION
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
EMAjs:
A WORKING IMPLEMENTATION FOR JAVASCRIPT
JavaScript Object definitions
19
EMAjs:
A WORKING IMPLEMENTATION FOR JAVASCRIPT
JavaScript Object definitions
Layer is defined with
the activation condition
19
EMAjs:
A WORKING IMPLEMENTATION FOR JAVASCRIPT
JavaScript Object definitions
Layer is defined with
the activation condition
An object exposes their fields to
layers (as an Interface)
19
EMAjs:
A WORKING IMPLEMENTATION FOR JAVASCRIPT
JavaScript Object definitions
Layer is defined with
the activation condition
An object exposes their fields to
layers (as an Interface)
19
Developers define how the base
code should changed
A VALIDATION CASE: HOME AUTOMATION SYSTEM
20
A VALIDATION CASE: HOME AUTOMATION SYSTEM
20
A VALIDATION CASE: HOME AUTOMATION SYSTEM
Only ringing at
the room where the princess is
(COP) 20
A VALIDATION CASE: HOME AUTOMATION SYSTEM
BASE
COP
EMA
ADAPTATION ADAP. ADMIN
OOP
Only ringing at
the room where the princess is
(COP)
Using EMAjs, base code is more modular
than proposals with OOP and COP
20
RELATED WORK
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
RELATED WORK
22
RELATED WORK
22
RELATED WORK
Since 2005, we can find proposals related to COP
Most of them with fixed semantics for layer activations and scoping
22
First work for layer interfaces and customizable scope
CONCLUSIONS
RELATED
WORK
CONCLUSION
VALIDATION:
EMAjs
PROPOSAL: EMA
INTRO:
COP, Layers &
Activation
Mechanisms
PROBLEM:
Coupling &
Fixed Scope in
Layers
CONCLUSION
• We propose Expressive and Modular Activation (EMA) mechanism for
Context-Oriented Programming (COP) to enhance the reuse of layers
• EMAjs is a WORKING implementation for JavaScript (on GitHub)
GitHub of EMAjs Paper
24
CONCLUSION
• We propose Expressive and Modular Activation (EMA) mechanism for
Context-Oriented Programming (COP) to enhance the reuse of layers
• EMAjs is a WORKING implementation for JavaScript (on GitHub)
GitHub of EMAjs Paper
24
@FLAGlab in all media channels
Journal of Information and Software Technology
Volume 156, April 2023
Programming language
implementations for context-oriented
self-adaptive systems
Paul Leger1 Nicolás Cardozo2 Hidehiko Masuhara3
1Systems and Computing Engineering department - Universidad católica del Norte, Coquimbo - Chile
2Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia
3Department of Mathematical and Computing Science - Tokyo Institute of Technology, Tokyo - Japan
pleger@ucn.cl, n.cardozo@uniandes.edu.co, masuhara@is.titech.ac.jp @ncardoz

More Related Content

Similar to An expressive and modular layer activation mechanism for Context-Oriented Programming

Friends let real friends use MySQL 8.0
Friends let real friends use MySQL 8.0Friends let real friends use MySQL 8.0
Friends let real friends use MySQL 8.0SaverioM
 
Re:code, frp vs async await ( Peter Ovchinnikov )
Re:code, frp vs async await ( Peter Ovchinnikov )Re:code, frp vs async await ( Peter Ovchinnikov )
Re:code, frp vs async await ( Peter Ovchinnikov )Iryna Datsyshyn
 
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
Open Kode, Airplay And The New Reality Of Write Once Run AnywhereOpen Kode, Airplay And The New Reality Of Write Once Run Anywhere
Open Kode, Airplay And The New Reality Of Write Once Run Anywhereguest991eb3
 
nilesh-Mtech-presentation
nilesh-Mtech-presentationnilesh-Mtech-presentation
nilesh-Mtech-presentationNilesh Heda
 
EclipseCon Eu 2015 - Breathe life into your Designer!
EclipseCon Eu 2015 - Breathe life into your Designer!EclipseCon Eu 2015 - Breathe life into your Designer!
EclipseCon Eu 2015 - Breathe life into your Designer!melbats
 
Lecture 07 virtual machine i
Lecture 07 virtual machine iLecture 07 virtual machine i
Lecture 07 virtual machine i鍾誠 陳鍾誠
 
65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdfAhmedEmadElGhetany
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?Pin-Ying Tu
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
Design the implementation of CDEx Robust DC Motor.
Design the implementation of CDEx Robust DC Motor.Design the implementation of CDEx Robust DC Motor.
Design the implementation of CDEx Robust DC Motor.Ankita Tiwari
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Embarcados
 
Find all hazards in this circuit. Redesign the circuit as a three-le.pdf
Find all hazards in this circuit.  Redesign the circuit as a three-le.pdfFind all hazards in this circuit.  Redesign the circuit as a three-le.pdf
Find all hazards in this circuit. Redesign the circuit as a three-le.pdfArrowdeepak
 
MX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ PresentationMX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ PresentationGautam Manoharan
 
Developing applications using Embedded Rich Client Platform (eRCP)
Developing applications using Embedded Rich Client Platform (eRCP)Developing applications using Embedded Rich Client Platform (eRCP)
Developing applications using Embedded Rich Client Platform (eRCP)Gorkem Ercan
 

Similar to An expressive and modular layer activation mechanism for Context-Oriented Programming (20)

3rd 3DDRESD: SysGen
3rd 3DDRESD: SysGen3rd 3DDRESD: SysGen
3rd 3DDRESD: SysGen
 
Friends let real friends use MySQL 8.0
Friends let real friends use MySQL 8.0Friends let real friends use MySQL 8.0
Friends let real friends use MySQL 8.0
 
Re:code, frp vs async await ( Peter Ovchinnikov )
Re:code, frp vs async await ( Peter Ovchinnikov )Re:code, frp vs async await ( Peter Ovchinnikov )
Re:code, frp vs async await ( Peter Ovchinnikov )
 
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
Open Kode, Airplay And The New Reality Of Write Once Run AnywhereOpen Kode, Airplay And The New Reality Of Write Once Run Anywhere
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
 
nilesh-Mtech-presentation
nilesh-Mtech-presentationnilesh-Mtech-presentation
nilesh-Mtech-presentation
 
EclipseCon Eu 2015 - Breathe life into your Designer!
EclipseCon Eu 2015 - Breathe life into your Designer!EclipseCon Eu 2015 - Breathe life into your Designer!
EclipseCon Eu 2015 - Breathe life into your Designer!
 
Lecture 07 virtual machine i
Lecture 07 virtual machine iLecture 07 virtual machine i
Lecture 07 virtual machine i
 
65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf
 
slides-students-C03.pdf
slides-students-C03.pdfslides-students-C03.pdf
slides-students-C03.pdf
 
Wcre12c.ppt
Wcre12c.pptWcre12c.ppt
Wcre12c.ppt
 
Xpediter kanbay
Xpediter kanbayXpediter kanbay
Xpediter kanbay
 
Introduction to 2D/3D Graphics
Introduction to 2D/3D GraphicsIntroduction to 2D/3D Graphics
Introduction to 2D/3D Graphics
 
Modul PLC Programming.pdf
Modul PLC Programming.pdfModul PLC Programming.pdf
Modul PLC Programming.pdf
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
Design the implementation of CDEx Robust DC Motor.
Design the implementation of CDEx Robust DC Motor.Design the implementation of CDEx Robust DC Motor.
Design the implementation of CDEx Robust DC Motor.
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
 
Find all hazards in this circuit. Redesign the circuit as a three-le.pdf
Find all hazards in this circuit.  Redesign the circuit as a three-le.pdfFind all hazards in this circuit.  Redesign the circuit as a three-le.pdf
Find all hazards in this circuit. Redesign the circuit as a three-le.pdf
 
MX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ PresentationMX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ Presentation
 
Developing applications using Embedded Rich Client Platform (eRCP)
Developing applications using Embedded Rich Client Platform (eRCP)Developing applications using Embedded Rich Client Platform (eRCP)
Developing applications using Embedded Rich Client Platform (eRCP)
 

More from Universidad de los Andes

[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs
[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs
[FTfJP23] Points-to Analysis for Context-oriented Javascript ProgramsUniversidad de los Andes
 
[JIST] Programming language implementations for context-oriented self-adaptiv...
[JIST] Programming language implementations for context-oriented self-adaptiv...[JIST] Programming language implementations for context-oriented self-adaptiv...
[JIST] Programming language implementations for context-oriented self-adaptiv...Universidad de los Andes
 
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning ProjectsUniversidad de los Andes
 
[CIbSE2023] Cross-language clone detection for Mobile Apps
[CIbSE2023] Cross-language clone detection for Mobile Apps[CIbSE2023] Cross-language clone detection for Mobile Apps
[CIbSE2023] Cross-language clone detection for Mobile AppsUniversidad de los Andes
 
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...Universidad de los Andes
 
[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing AlgorithmsUniversidad de los Andes
 
Generating Adaptations from the System Execution using Reinforcement Learning...
Generating Adaptations from the System Execution using Reinforcement Learning...Generating Adaptations from the System Execution using Reinforcement Learning...
Generating Adaptations from the System Execution using Reinforcement Learning...Universidad de los Andes
 
Language Abstractions and Techniques for Developing Collective Adaptive Syste...
Language Abstractions and Techniques for Developing Collective Adaptive Syste...Language Abstractions and Techniques for Developing Collective Adaptive Syste...
Language Abstractions and Techniques for Developing Collective Adaptive Syste...Universidad de los Andes
 
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary study
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary studyDoes Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary study
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary studyUniversidad de los Andes
 
Learning run-time composition of interacting adaptations
Learning run-time composition of interacting adaptationsLearning run-time composition of interacting adaptations
Learning run-time composition of interacting adaptationsUniversidad de los Andes
 
CQL: declarative language for context activation
CQL: declarative language for context activationCQL: declarative language for context activation
CQL: declarative language for context activationUniversidad de los Andes
 
Generating software adaptations using machine learning
Generating software adaptations using machine learningGenerating software adaptations using machine learning
Generating software adaptations using machine learningUniversidad de los Andes
 
[Bachelor_project] Asignación de exámenes finales
[Bachelor_project] Asignación de exámenes finales[Bachelor_project] Asignación de exámenes finales
[Bachelor_project] Asignación de exámenes finalesUniversidad de los Andes
 
Programming language techniques for adaptive software
Programming language techniques for adaptive softwareProgramming language techniques for adaptive software
Programming language techniques for adaptive softwareUniversidad de los Andes
 
Peace COrP: Learning to solve conflicts between contexts
Peace COrP: Learning to solve conflicts between contextsPeace COrP: Learning to solve conflicts between contexts
Peace COrP: Learning to solve conflicts between contextsUniversidad de los Andes
 

More from Universidad de los Andes (18)

[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs
[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs
[FTfJP23] Points-to Analysis for Context-oriented Javascript Programs
 
[JIST] Programming language implementations for context-oriented self-adaptiv...
[JIST] Programming language implementations for context-oriented self-adaptiv...[JIST] Programming language implementations for context-oriented self-adaptiv...
[JIST] Programming language implementations for context-oriented self-adaptiv...
 
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects
[CAIN'23] Prevalence of Code Smells in Reinforcement Learning Projects
 
[CIbSE2023] Cross-language clone detection for Mobile Apps
[CIbSE2023] Cross-language clone detection for Mobile Apps[CIbSE2023] Cross-language clone detection for Mobile Apps
[CIbSE2023] Cross-language clone detection for Mobile Apps
 
Keeping Up! with LaTeX
Keeping Up! with LaTeXKeeping Up! with LaTeX
Keeping Up! with LaTeX
 
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...
[JPDC,JCC@LMN22] Ad hoc systems Management and specification with distributed...
 
[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms
 
Generating Adaptations from the System Execution using Reinforcement Learning...
Generating Adaptations from the System Execution using Reinforcement Learning...Generating Adaptations from the System Execution using Reinforcement Learning...
Generating Adaptations from the System Execution using Reinforcement Learning...
 
Language Abstractions and Techniques for Developing Collective Adaptive Syste...
Language Abstractions and Techniques for Developing Collective Adaptive Syste...Language Abstractions and Techniques for Developing Collective Adaptive Syste...
Language Abstractions and Techniques for Developing Collective Adaptive Syste...
 
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary study
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary studyDoes Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary study
Does Neuron Coverage Matter for Deep Reinforcement Learning? A preliminary study
 
Learning run-time composition of interacting adaptations
Learning run-time composition of interacting adaptationsLearning run-time composition of interacting adaptations
Learning run-time composition of interacting adaptations
 
Distributed context Petri nets
Distributed context Petri netsDistributed context Petri nets
Distributed context Petri nets
 
CQL: declarative language for context activation
CQL: declarative language for context activationCQL: declarative language for context activation
CQL: declarative language for context activation
 
Generating software adaptations using machine learning
Generating software adaptations using machine learningGenerating software adaptations using machine learning
Generating software adaptations using machine learning
 
[Bachelor_project] Asignación de exámenes finales
[Bachelor_project] Asignación de exámenes finales[Bachelor_project] Asignación de exámenes finales
[Bachelor_project] Asignación de exámenes finales
 
Programming language techniques for adaptive software
Programming language techniques for adaptive softwareProgramming language techniques for adaptive software
Programming language techniques for adaptive software
 
Peace COrP: Learning to solve conflicts between contexts
Peace COrP: Learning to solve conflicts between contextsPeace COrP: Learning to solve conflicts between contexts
Peace COrP: Learning to solve conflicts between contexts
 
Emergent Software Services
Emergent Software ServicesEmergent Software Services
Emergent Software Services
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

An expressive and modular layer activation mechanism for Context-Oriented Programming

  • 1. Paul Leger, Universidad Católica del Norte, Chile (pleger@ucn.cl / http://pleger.cl) Nicolás Cardozo, Universidad de los Andes, Colombia (n.cardozo@uniandes.edu.co) Hidehiko Masuhara,Tokyo Institute of Technology, Japan (masuhara@acm.org) Journal First: Information & Software Technology (2023) An Expressive and Modular Layer Activation Mechanism for Context-Oriented Programming
  • 2. INTRODUCTION RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 3. MOTIVATION FOR CONTEXT-ORIENTED PROGRAMMING (COP) Same application but different modes of execution Landscape Portrait 3
  • 4. Method draw Impl 1 Impl 2 Impl 3 Impl 5 Impl 4 Impl 6 MOTIVATION FOR CONTEXT-ORIENTED PROGRAMMING (COP) Same application but different modes of execution Landscape Portrait Maintainability 3
  • 5. Method draw Impl 1 Impl 2 Impl 3 Impl 5 Impl 4 Impl 6 MOTIVATION FOR CONTEXT-ORIENTED PROGRAMMING (COP) Same application but different modes of execution Landscape Portrait COP (2005) Maintainability 3
  • 6. CONTEXT-ORIENTED PROGRAMING (COP) Portrait Landscape Two different modes that are activated when the phone is rotated These modes can be contexts 4
  • 7. CONTEXT-ORIENTED PROGRAMING (COP) Portrait Landscape Two different modes that are activated when the phone is rotated These modes can be contexts 4
  • 8. CONTEXT-ORIENTED PROGRAMING (COP) Portrait Landscape Two different modes that are activated when the phone is rotated Layers (contexts) These modes can be contexts 4
  • 9. CONTEXT-ORIENTED PROGRAMING (COP) Portrait Landscape Two different modes that are activated when the phone is rotated Phone is rotated The landscape layer is activated i.e., draw behavior is modified Phone is rotated Layers (contexts) These modes can be contexts time 4
  • 10. ACTIVATION MECHANISMS How is a layer activated? When the screen angle changes 5
  • 11. ACTIVATION MECHANISMS activate landscape if (screen.angle > 45); When a particular state changes (Lambic-2012) Implicit How is a layer activated? When the screen angle changes 5
  • 12. ACTIVATION MECHANISMS activate landscape if (screen.angle > 45); When a particular state changes (Lambic-2012) Implicit How is a layer activated? When the screen angle changes NOTE: They are other activation mechanisms 5
  • 13. PROBLEM RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 14. WE CAN CURRENTLY OBSERVE AN IMPLICIT DEPENDENCY BETWEEN … … base code and layers (angle) activate landscape if (screen.angle > THRESHOLD); Implicit 7
  • 15. WE CAN CURRENTLY OBSERVE AN IMPLICIT DEPENDENCY BETWEEN … … base code and layers (angle) So what …. Problems in … Reuse? Evolution? activate landscape if (screen.angle > THRESHOLD); Implicit 7
  • 16. IMPLICIT DEPENDENCY PROBLEMS: REUSE Smartphone Layers 8
  • 17. IMPLICIT DEPENDENCY PROBLEMS: REUSE Smartphone Tablet (a new scenario) Layers How about angles in other format, even worse, if it does not exist! 8
  • 18. IMPLICIT DEPENDENCY PROBLEMS: EVOLUTION Smartphone Layers Base code changed A layer needs to be modified to satisfy the new requirements of base code 9
  • 19. FIXED SCOPE STRATEGY FOR LAYERS Most Videogames with landscape support Layers 10
  • 20. FIXED SCOPE STRATEGY FOR LAYERS A layer needs a scope to know where it should be applied or not Most Videogames with landscape support A videogame that needs always a portrait view Layers 10
  • 21. PROPOSAL RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 22. EMA: EXPRESSIVE AND MODULAR ACTIVATION MECHANISM Base code Interface Layer EMA promotes the reuse of layers through: 1. separating layers and base code 2. customizing the scope to any layer deployment exposes Reads 12
  • 23. EMA: EXPRESSIVE AND MODULAR ACTIVATION MECHANISM Base code Interface Layer EMA promotes the reuse of layers through: 1. separating layers and base code 2. customizing the scope to any layer deployment Explicit dependency exposes Reads 12
  • 24. EMA: EXPRESSIVE AND MODULAR ACTIVATION MECHANISM Base code Interface Layer EMA promotes the reuse of layers through: 1. separating layers and base code 2. customizing the scope to any layer deployment Explicit dependency Scope Specific scope strategy per Layer Customizable scope strategy per layer exposes Reads 12
  • 25. SEPARATION OF LAYERS AND BASE CODE: REUSE Smartphone Layers Interface 13 rotation
  • 26. SEPARATION OF LAYERS AND BASE CODE: REUSE Smartphone Tablet Layers The interface can support expressions which gives more flexibility Interface Interface 13 rotation
  • 27. SEPARATION OF LAYERS AND BASE CODE: EVOLUTION Smartphone Layers Developers can update the base code without modifying the layer 14 rotation
  • 28. SEPARATION OF LAYERS AND BASE CODE: EVOLUTION Smartphone Tablet Layers Developers can update the base code without modifying the layer You can still reuse with a Tablet 14 rotation
  • 29. ACTIVATION MECHANISMS: IMPERATIVE, EVENT-BASED, AND IMPLICIT if (screen.angle > THRESHOLD) { //applying layer on base code with(landscape) { playerView.draw(); } } Using a construct, a programmer explicitly activates a layer (ContextJ-2011) Imperative on(* playerView.draw()) && when(screen.angle > THRESHOLD){ with(landscape); } When specific some events happen (Jcop-2011) Event-Based activate landscape if (screen.angle > THRESHOLD); When a condition changes (Lambic-2011) Implicit How is a layer activated? 15
  • 30. CUSTOMIZABLE SCOPE STRATEGY EMA provides an API to expressively define the scope strategy required by layers 16
  • 31. FLEXIBLE LAYER SCOPING RotationCondition = () => rotation > THRESHOLD Implicit 17
  • 32. FLEXIBLE LAYER SCOPING RotationCondition = () => rotation > THRESHOLD Implicit EMA.activate(allOf(RotationCondition)) EMA.activate(allOf(RotationCondition), screen) EMA.activate(atMostOne(RotationCondition), Screen) EMA Activation for a single object instance, for all applicable objects Activation for all objects of a class, for at most one of the instances that satisfy the condition 17
  • 33. VALIDATION RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 34. EMAjs: A WORKING IMPLEMENTATION FOR JAVASCRIPT JavaScript Object definitions 19
  • 35. EMAjs: A WORKING IMPLEMENTATION FOR JAVASCRIPT JavaScript Object definitions Layer is defined with the activation condition 19
  • 36. EMAjs: A WORKING IMPLEMENTATION FOR JAVASCRIPT JavaScript Object definitions Layer is defined with the activation condition An object exposes their fields to layers (as an Interface) 19
  • 37. EMAjs: A WORKING IMPLEMENTATION FOR JAVASCRIPT JavaScript Object definitions Layer is defined with the activation condition An object exposes their fields to layers (as an Interface) 19 Developers define how the base code should changed
  • 38. A VALIDATION CASE: HOME AUTOMATION SYSTEM 20
  • 39. A VALIDATION CASE: HOME AUTOMATION SYSTEM 20
  • 40. A VALIDATION CASE: HOME AUTOMATION SYSTEM Only ringing at the room where the princess is (COP) 20
  • 41. A VALIDATION CASE: HOME AUTOMATION SYSTEM BASE COP EMA ADAPTATION ADAP. ADMIN OOP Only ringing at the room where the princess is (COP) Using EMAjs, base code is more modular than proposals with OOP and COP 20
  • 42. RELATED WORK RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 45. RELATED WORK Since 2005, we can find proposals related to COP Most of them with fixed semantics for layer activations and scoping 22 First work for layer interfaces and customizable scope
  • 46. CONCLUSIONS RELATED WORK CONCLUSION VALIDATION: EMAjs PROPOSAL: EMA INTRO: COP, Layers & Activation Mechanisms PROBLEM: Coupling & Fixed Scope in Layers
  • 47. CONCLUSION • We propose Expressive and Modular Activation (EMA) mechanism for Context-Oriented Programming (COP) to enhance the reuse of layers • EMAjs is a WORKING implementation for JavaScript (on GitHub) GitHub of EMAjs Paper 24
  • 48. CONCLUSION • We propose Expressive and Modular Activation (EMA) mechanism for Context-Oriented Programming (COP) to enhance the reuse of layers • EMAjs is a WORKING implementation for JavaScript (on GitHub) GitHub of EMAjs Paper 24
  • 49. @FLAGlab in all media channels Journal of Information and Software Technology Volume 156, April 2023 Programming language implementations for context-oriented self-adaptive systems Paul Leger1 Nicolás Cardozo2 Hidehiko Masuhara3 1Systems and Computing Engineering department - Universidad católica del Norte, Coquimbo - Chile 2Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia 3Department of Mathematical and Computing Science - Tokyo Institute of Technology, Tokyo - Japan pleger@ucn.cl, n.cardozo@uniandes.edu.co, masuhara@is.titech.ac.jp @ncardoz