SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Nicolás Cardozo1 Kim Mens2
1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia
2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium
kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co
@ncardoz
Programming language
implementations for context-
oriented self-adaptive systems
INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION
Journal of Information and Software Technology
Volume 143, March 2022
Nicolás Cardozo1 Kim Mens2
1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia
2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium
kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co
@ncardoz
Programming language
implementations for context-
oriented self-adaptive systems
3
Adaptation
system behavior
3
Adaptation
system behavior
context
3
Adaptation
system behavior
context
self
3
Adaptation
system behavior
context
self
internal
system
Adaptation
3
Adaptation
system behavior
context
self
external
MAPE-K
system
Adaptor
Adaptation
internal
system
Adaptation
4
External adaptation engines
Internal adaptation engines
• Inflexible
• Tightly couple with the system implementation
• Modular
• Customizable
• Reusable
Adaptation
5
Internal adaptation engines
smart
open
resilient
extensible
highly-available
customizable
modular
fi
ne-grained
concise
understandable
Adaptation
6
Context-oriented programming
@implementation Poi
NSString *name;
-(NSString*) name {
return [NSString stringWithFormat:@"INIT_ERROR-%@", @"name"];
}
@end
6
Context-oriented programming
@implementation Poi
NSString *name;
-(NSString*) name {
NSString *query = [NSString stringWithFormat:@"SELECT name FROM Poi WITH
language = %@ AND id_poi = %d", @"en", [self poiId ]];
NSArray *res = [[NSArray alloc] initWithArray:[[self dbManager]
|loadDataFromDB:query]];
return [res objectAtIndex:0];
}
@end
6
Context-oriented programming
@implementation Poi
NSString *name;
-(NSString*) name {
return [NSString stringWithFormat:@"INIT_ERROR-%@", @"name"];
}
@end
7
Context-oriented programming
Contexts as first-class
entities of the system
Behavioral variations
as fine-grained
(partial) statements
isolated from the
system
activation and
deactivation
mechanisms to
compose and
withdraw system
behavior
@context English @contexts English
-(NSString*) name {
…
}
@activate(English)
@deactivate(English)
8
Context-dependent method dispatch
(defmethod display-poi-info (poi)
(print “basic poi info”))
Use dispatch mechanisms to direct messages to the
appropriate implementation according to the context
Ambience - [Gonzalez et al. JUC 2008]
8
Context-dependent method dispatch
Use dispatch mechanisms to direct messages to the
appropriate implementation according to the context
(with-context (@wifi)
)
(defmethod display-poi-info (poi)
(format t “~a n
Description: ~a ”
(name poi)
(detail-description poi))
Ambience - [Gonzalez et al. JUC 2008]
8
Context-dependent method dispatch
Use dispatch mechanisms to direct messages to the
appropriate implementation according to the context
(with-context (@wifi)
)
(defgeneric display-poi-info (poi)
...)
Ambience - [Gonzalez et al. JUC 2008]
8
Context-dependent method dispatch
Use dispatch mechanisms to direct messages to the
appropriate implementation according to the context
(with-context (@wifi)
)
(defmethod display-poi-info (poi)
(print “basic poi info”))
(defgeneric display-poi-info (poi)
...)
amos::send
Ambience - [Gonzalez et al. JUC 2008]
8
Context-dependent method dispatch
Use dispatch mechanisms to direct messages to the
appropriate implementation according to the context
(with-context (@wifi)
)
(defmethod display-poi-info (@wifi poi)
(format t “~a n
Description: ~a”
(name poi)
(detail-description poi))
(defgeneric display-poi-info (poi)
...) amos::send
amos::prepend-slot
(activate @wifi)
Ambience - [Gonzalez et al. JUC 2008]
9
Method replacement mechanisms
At the MOP level, switch method implementations between base
and adaptive behavior
void displayPOI (POI poi) {
NSString *res = @“%@ ”
NSLog(res, poi.description);
}
Subjective-C - [Gonzalez et al. SLE 2010]
9
Method replacement mechanisms
At the MOP level, switch method implementations between base
and adaptive behavior
void displayPOI (POI poi) {
NSString *res = @“%@ ”
NSLog(res, poi.description);
}
displayPOI NSString *res = @“%@”
NSLog(res, poi.description);
SEL
IMP
Subjective-C - [Gonzalez et al. SLE 2010]
9
Method replacement mechanisms
At the MOP level, switch method implementations between base
and adaptive behavior
void displayPOI (POI poi) {
NSString *res = @“%@ ”
NSLog(res, poi.description);
}
displayPOI
NSString *res = @“%@ n Description:
%@ ”
NSLog(res, poi.name,
poi.longDescription());
NSString *res = @“%@”
NSLog(res, poi.description);
@contexts Wifi
void displayPOI (POI poi) {
NSString *res = @“%@ n Description: %@ ”
NSLog(res, poi.name, poi.longDescription());
}
SEL
IMP
Subjective-C - [Gonzalez et al. SLE 2010]
9
Method replacement mechanisms
At the MOP level, switch method implementations between base
and adaptive behavior
void displayPOI (POI poi) {
NSString *res = @“%@ ”
NSLog(res, poi.description);
}
displayPOI NSString *res = @“%@ n Description:
%@ ”
NSLog(res, poi.name,
poi.longDescription());
NSString *res = @“%@”
NSLog(res, poi.description);
@contexts Wifi
void displayPOI (POI poi) {
NSString *res = @“%@ n Description: %@ ”
NSLog(res, poi.name, poi.longDescription());
}
@activate(Wifi)
SEL
IMP
Subjective-C - [Gonzalez et al. SLE 2010]
10
Fine-grained composition
Fine-grained module to be composed as appropriate for
specific situations
POI
- description
- displayPOI
- name
Context Traits - [Gonzalez et al. AOSD 2013]
10
Fine-grained composition
Fine-grained module to be composed as appropriate for
specific situations
POI
- description
- displayPOI
- name
Wi
fi
<<trait>>
- description
- displayPOI
Wifi.activate()
Context Traits - [Gonzalez et al. AOSD 2013]
10
Fine-grained composition
Fine-grained module to be composed as appropriate for
specific situations
POI
- description
- displayPOI
- name
Wi
fi
<<trait>>
- description
- displayPOI
+
POI
- description
- displayPOI
- name
=
Wifi.activate()
Context Traits - [Gonzalez et al. AOSD 2013]
11
Evaluation
1. Expressiveness
2. Modularity
3. Performance of adaptation selection
12
Modularity evaluation
Ambience
(LOC 793)
Common Lisp
(LOC 734)
Subjective-C
(LOC 3011)
Objective-C
(LOC 3265)
Context Traits
(LOC 1242)
ECMAScript
(LOC 1320)
0 25 50 75 100
17.73
3.14
6.95
4.22
23.84
10.97
29.62
35.91
19.69
17.48
54.22
50.32
52.65
60.95
73.35
78.31
21.93
38.71
Application Logic Adaptation Logic Adaptation Management
12
Modularity evaluation
Ambience
(LOC 793)
Common Lisp
(LOC 734)
Subjective-C
(LOC 3011)
Objective-C
(LOC 3265)
Context Traits
(LOC 1242)
ECMAScript
(LOC 1320)
0 25 50 75 100
17.73
3.14
6.95
4.22
23.84
10.97
29.62
35.91
19.69
17.48
54.22
50.32
52.65
60.95
73.35
78.31
21.93
38.71
Application Logic Adaptation Logic Adaptation Management
Reduction in both the adaptation logic (~10%) and
(more substantially) its management (>40%)
13
Performance evaluation
log
time
(in
milliseconds)
0.010
1.000
100.000
10000.000
1000000.000
Number of contexts
10 50 100 500 1000 2500 5000 10000
ifs
strategy
ambience
log
time
(in
milliseconds)
0.100
1.000
10.000
100.000
1000.000
Number of contexts
10 50 100 500 1000 2500 5000
ifs
strategy
context traits
log
time
(in
milliseconds)
0.0100000
1.0000000
100.0000000
10000.0000000
Number of contexts
10 50 100 500 1000 2500 5000 10000 25000 50000
ifs
strategy
subjective-c
13
Performance evaluation
log
time
(in
milliseconds)
0.010
1.000
100.000
10000.000
1000000.000
Number of contexts
10 50 100 500 1000 2500 5000 10000
ifs
strategy
ambience
log
time
(in
milliseconds)
0.100
1.000
10.000
100.000
1000.000
Number of contexts
10 50 100 500 1000 2500 5000
ifs
strategy
context traits
log
time
(in
milliseconds)
0.0100000
1.0000000
100.0000000
10000.0000000
Number of contexts
10 50 100 500 1000 2500 5000 10000 25000 50000
ifs
strategy
subjective-c
Adaptation activations impact the use of adaptations,
upon message sends, or context changes
14
Conclusion
External adaptation engines
Internal adaptation engines
• Modular
• Customizable
• Reusable
• Smart
• Open
• Resilient
• Extensible
• Highly-available
• Customizable
• Modular
• Fine-grained
• Concise
• Understandable
@FLAGlab in all media channels
Journal of Information and Software Technology
Volume 143, March 2022
Programming language
implementations for context-oriented
self-adaptive systems
Nicolás Cardozo1 Kim Mens2
1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia
2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium
kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co @ncardoz

Contenu connexe

Similaire à [JIST] Programming language implementations for context-oriented self-adaptive systems

ScriptRock Robotics Testing
ScriptRock Robotics TestingScriptRock Robotics Testing
ScriptRock Robotics Testing
CloudCheckr
 
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
iCOMMUNITY
 
Computernetworkingkurosech9 091011003335-phpapp01
Computernetworkingkurosech9 091011003335-phpapp01Computernetworkingkurosech9 091011003335-phpapp01
Computernetworkingkurosech9 091011003335-phpapp01
AislanSoares
 
EEDC - Apache Pig
EEDC - Apache PigEEDC - Apache Pig
EEDC - Apache Pig
javicid
 

Similaire à [JIST] Programming language implementations for context-oriented self-adaptive systems (20)

React native
React nativeReact native
React native
 
Model executability within the GEMOC Studio
Model executability within the GEMOC StudioModel executability within the GEMOC Studio
Model executability within the GEMOC Studio
 
Agile and compliant firewall ACL configuration management for DevOps
Agile and compliant firewall ACL configuration management for DevOpsAgile and compliant firewall ACL configuration management for DevOps
Agile and compliant firewall ACL configuration management for DevOps
 
Reifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specificationsReifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specifications
 
ScriptRock Robotics Testing
ScriptRock Robotics TestingScriptRock Robotics Testing
ScriptRock Robotics Testing
 
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB.local Austin 2018: MongoDB Ops Manager + KubernetesMongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
 
An Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable AutomationAn Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable Automation
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Prometheus – a next-gen Monitoring System
Prometheus – a next-gen Monitoring SystemPrometheus – a next-gen Monitoring System
Prometheus – a next-gen Monitoring System
 
Resume sandeep chakraborty
Resume sandeep chakrabortyResume sandeep chakraborty
Resume sandeep chakraborty
 
20100512 Workflow Ramage
20100512 Workflow Ramage20100512 Workflow Ramage
20100512 Workflow Ramage
 
Self-Tuning and Managing Services
Self-Tuning and Managing ServicesSelf-Tuning and Managing Services
Self-Tuning and Managing Services
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
Building Your Robot using AWS Robomaker
Building Your Robot using AWS RobomakerBuilding Your Robot using AWS Robomaker
Building Your Robot using AWS Robomaker
 
Machine learning, WTF!?
Machine learning, WTF!? Machine learning, WTF!?
Machine learning, WTF!?
 
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
Emergent Middleware to Support Interoperability in Mobile Collaborative Appli...
 
Neomades crosscompilation
Neomades crosscompilationNeomades crosscompilation
Neomades crosscompilation
 
Computernetworkingkurosech9 091011003335-phpapp01
Computernetworkingkurosech9 091011003335-phpapp01Computernetworkingkurosech9 091011003335-phpapp01
Computernetworkingkurosech9 091011003335-phpapp01
 
MobiCloud: Towards Cloud Mobile Hybrid Application Generation using Semantica...
MobiCloud: Towards Cloud Mobile Hybrid Application Generation using Semantica...MobiCloud: Towards Cloud Mobile Hybrid Application Generation using Semantica...
MobiCloud: Towards Cloud Mobile Hybrid Application Generation using Semantica...
 
EEDC - Apache Pig
EEDC - Apache PigEEDC - Apache Pig
EEDC - Apache Pig
 

Plus de Universidad de los Andes

An expressive and modular layer activation mechanism for Context-Oriented Pro...
An expressive and modular layer activation mechanism for Context-Oriented Pro...An expressive and modular layer activation mechanism for Context-Oriented Pro...
An expressive and modular layer activation mechanism for Context-Oriented Pro...
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 Projects
Universidad 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 Apps
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
 

Plus de Universidad de los Andes (18)

An expressive and modular layer activation mechanism for Context-Oriented Pro...
An expressive and modular layer activation mechanism for Context-Oriented Pro...An expressive and modular layer activation mechanism for Context-Oriented Pro...
An expressive and modular layer activation mechanism for Context-Oriented Pro...
 
[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
 
[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
 

Dernier

Dernier (20)

Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 

[JIST] Programming language implementations for context-oriented self-adaptive systems

  • 1. Nicolás Cardozo1 Kim Mens2 1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia 2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co @ncardoz Programming language implementations for context- oriented self-adaptive systems INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION
  • 2. Journal of Information and Software Technology Volume 143, March 2022 Nicolás Cardozo1 Kim Mens2 1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia 2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co @ncardoz Programming language implementations for context- oriented self-adaptive systems
  • 8. 4 External adaptation engines Internal adaptation engines • Inflexible • Tightly couple with the system implementation • Modular • Customizable • Reusable Adaptation
  • 10. 6 Context-oriented programming @implementation Poi NSString *name; -(NSString*) name { return [NSString stringWithFormat:@"INIT_ERROR-%@", @"name"]; } @end
  • 11. 6 Context-oriented programming @implementation Poi NSString *name; -(NSString*) name { NSString *query = [NSString stringWithFormat:@"SELECT name FROM Poi WITH language = %@ AND id_poi = %d", @"en", [self poiId ]]; NSArray *res = [[NSArray alloc] initWithArray:[[self dbManager] |loadDataFromDB:query]]; return [res objectAtIndex:0]; } @end
  • 12. 6 Context-oriented programming @implementation Poi NSString *name; -(NSString*) name { return [NSString stringWithFormat:@"INIT_ERROR-%@", @"name"]; } @end
  • 13. 7 Context-oriented programming Contexts as first-class entities of the system Behavioral variations as fine-grained (partial) statements isolated from the system activation and deactivation mechanisms to compose and withdraw system behavior @context English @contexts English -(NSString*) name { … } @activate(English) @deactivate(English)
  • 14. 8 Context-dependent method dispatch (defmethod display-poi-info (poi) (print “basic poi info”)) Use dispatch mechanisms to direct messages to the appropriate implementation according to the context Ambience - [Gonzalez et al. JUC 2008]
  • 15. 8 Context-dependent method dispatch Use dispatch mechanisms to direct messages to the appropriate implementation according to the context (with-context (@wifi) ) (defmethod display-poi-info (poi) (format t “~a n Description: ~a ” (name poi) (detail-description poi)) Ambience - [Gonzalez et al. JUC 2008]
  • 16. 8 Context-dependent method dispatch Use dispatch mechanisms to direct messages to the appropriate implementation according to the context (with-context (@wifi) ) (defgeneric display-poi-info (poi) ...) Ambience - [Gonzalez et al. JUC 2008]
  • 17. 8 Context-dependent method dispatch Use dispatch mechanisms to direct messages to the appropriate implementation according to the context (with-context (@wifi) ) (defmethod display-poi-info (poi) (print “basic poi info”)) (defgeneric display-poi-info (poi) ...) amos::send Ambience - [Gonzalez et al. JUC 2008]
  • 18. 8 Context-dependent method dispatch Use dispatch mechanisms to direct messages to the appropriate implementation according to the context (with-context (@wifi) ) (defmethod display-poi-info (@wifi poi) (format t “~a n Description: ~a” (name poi) (detail-description poi)) (defgeneric display-poi-info (poi) ...) amos::send amos::prepend-slot (activate @wifi) Ambience - [Gonzalez et al. JUC 2008]
  • 19. 9 Method replacement mechanisms At the MOP level, switch method implementations between base and adaptive behavior void displayPOI (POI poi) { NSString *res = @“%@ ” NSLog(res, poi.description); } Subjective-C - [Gonzalez et al. SLE 2010]
  • 20. 9 Method replacement mechanisms At the MOP level, switch method implementations between base and adaptive behavior void displayPOI (POI poi) { NSString *res = @“%@ ” NSLog(res, poi.description); } displayPOI NSString *res = @“%@” NSLog(res, poi.description); SEL IMP Subjective-C - [Gonzalez et al. SLE 2010]
  • 21. 9 Method replacement mechanisms At the MOP level, switch method implementations between base and adaptive behavior void displayPOI (POI poi) { NSString *res = @“%@ ” NSLog(res, poi.description); } displayPOI NSString *res = @“%@ n Description: %@ ” NSLog(res, poi.name, poi.longDescription()); NSString *res = @“%@” NSLog(res, poi.description); @contexts Wifi void displayPOI (POI poi) { NSString *res = @“%@ n Description: %@ ” NSLog(res, poi.name, poi.longDescription()); } SEL IMP Subjective-C - [Gonzalez et al. SLE 2010]
  • 22. 9 Method replacement mechanisms At the MOP level, switch method implementations between base and adaptive behavior void displayPOI (POI poi) { NSString *res = @“%@ ” NSLog(res, poi.description); } displayPOI NSString *res = @“%@ n Description: %@ ” NSLog(res, poi.name, poi.longDescription()); NSString *res = @“%@” NSLog(res, poi.description); @contexts Wifi void displayPOI (POI poi) { NSString *res = @“%@ n Description: %@ ” NSLog(res, poi.name, poi.longDescription()); } @activate(Wifi) SEL IMP Subjective-C - [Gonzalez et al. SLE 2010]
  • 23. 10 Fine-grained composition Fine-grained module to be composed as appropriate for specific situations POI - description - displayPOI - name Context Traits - [Gonzalez et al. AOSD 2013]
  • 24. 10 Fine-grained composition Fine-grained module to be composed as appropriate for specific situations POI - description - displayPOI - name Wi fi <<trait>> - description - displayPOI Wifi.activate() Context Traits - [Gonzalez et al. AOSD 2013]
  • 25. 10 Fine-grained composition Fine-grained module to be composed as appropriate for specific situations POI - description - displayPOI - name Wi fi <<trait>> - description - displayPOI + POI - description - displayPOI - name = Wifi.activate() Context Traits - [Gonzalez et al. AOSD 2013]
  • 26. 11 Evaluation 1. Expressiveness 2. Modularity 3. Performance of adaptation selection
  • 27. 12 Modularity evaluation Ambience (LOC 793) Common Lisp (LOC 734) Subjective-C (LOC 3011) Objective-C (LOC 3265) Context Traits (LOC 1242) ECMAScript (LOC 1320) 0 25 50 75 100 17.73 3.14 6.95 4.22 23.84 10.97 29.62 35.91 19.69 17.48 54.22 50.32 52.65 60.95 73.35 78.31 21.93 38.71 Application Logic Adaptation Logic Adaptation Management
  • 28. 12 Modularity evaluation Ambience (LOC 793) Common Lisp (LOC 734) Subjective-C (LOC 3011) Objective-C (LOC 3265) Context Traits (LOC 1242) ECMAScript (LOC 1320) 0 25 50 75 100 17.73 3.14 6.95 4.22 23.84 10.97 29.62 35.91 19.69 17.48 54.22 50.32 52.65 60.95 73.35 78.31 21.93 38.71 Application Logic Adaptation Logic Adaptation Management Reduction in both the adaptation logic (~10%) and (more substantially) its management (>40%)
  • 29. 13 Performance evaluation log time (in milliseconds) 0.010 1.000 100.000 10000.000 1000000.000 Number of contexts 10 50 100 500 1000 2500 5000 10000 ifs strategy ambience log time (in milliseconds) 0.100 1.000 10.000 100.000 1000.000 Number of contexts 10 50 100 500 1000 2500 5000 ifs strategy context traits log time (in milliseconds) 0.0100000 1.0000000 100.0000000 10000.0000000 Number of contexts 10 50 100 500 1000 2500 5000 10000 25000 50000 ifs strategy subjective-c
  • 30. 13 Performance evaluation log time (in milliseconds) 0.010 1.000 100.000 10000.000 1000000.000 Number of contexts 10 50 100 500 1000 2500 5000 10000 ifs strategy ambience log time (in milliseconds) 0.100 1.000 10.000 100.000 1000.000 Number of contexts 10 50 100 500 1000 2500 5000 ifs strategy context traits log time (in milliseconds) 0.0100000 1.0000000 100.0000000 10000.0000000 Number of contexts 10 50 100 500 1000 2500 5000 10000 25000 50000 ifs strategy subjective-c Adaptation activations impact the use of adaptations, upon message sends, or context changes
  • 31. 14 Conclusion External adaptation engines Internal adaptation engines • Modular • Customizable • Reusable • Smart • Open • Resilient • Extensible • Highly-available • Customizable • Modular • Fine-grained • Concise • Understandable
  • 32. @FLAGlab in all media channels Journal of Information and Software Technology Volume 143, March 2022 Programming language implementations for context-oriented self-adaptive systems Nicolás Cardozo1 Kim Mens2 1Systems and Computing Engineering department - Universidad de los Andes, Bogotá - Colombia 2ICTEAM - UCLouvain, Louvain-la-Neuve - Belgium kim.mens@uclouvain.be, n.cardozo@uniandes.edu.co @ncardoz