Suche senden
Hochladen
Context-Oriented Programming: Beyond Layers
•
0 gefällt mir
•
419 views
E
ESUG
Folgen
Context-Oriented Programming: Beyond Layers. Martin v. Löwis. ESUG 2007, Lugano
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 21
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Reflection
Reflection
Marcus Denker
SNAPL Network Verification
SNAPL Network Verification
aurojit
Architectural patterns part 4
Architectural patterns part 4
assinha
Architectural patterns part 3
Architectural patterns part 3
assinha
Mule mel 2
Mule mel 2
kunal vishe
Active Object
Active Object
melbournepatterns
Mule mel 1
Mule mel 1
kunal vishe
Demo: Reflectivity
Demo: Reflectivity
Marcus Denker
Empfohlen
Reflection
Reflection
Marcus Denker
SNAPL Network Verification
SNAPL Network Verification
aurojit
Architectural patterns part 4
Architectural patterns part 4
assinha
Architectural patterns part 3
Architectural patterns part 3
assinha
Mule mel 2
Mule mel 2
kunal vishe
Active Object
Active Object
melbournepatterns
Mule mel 1
Mule mel 1
kunal vishe
Demo: Reflectivity
Demo: Reflectivity
Marcus Denker
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
assinha
Project Reactor By Example
Project Reactor By Example
Denny Abraham Cheriyan
Vert.x Event Driven Non Blocking Reactive Toolkit
Vert.x Event Driven Non Blocking Reactive Toolkit
Brian S. Paskin
ITFT_Inter process communication
ITFT_Inter process communication
Sneh Prabha
Active Object Design Pattern
Active Object Design Pattern
jeremiahdjordan
Multi-Process JavaScript Architectures
Multi-Process JavaScript Architectures
Mark Trostler
Reactive Programming In Java Using: Project Reactor
Reactive Programming In Java Using: Project Reactor
Knoldus Inc.
Advanced Application Architecture Symfony Live Berlin 2018
Advanced Application Architecture Symfony Live Berlin 2018
Matthias Noback
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Srikanth Reddy Pallerla
Design patterns
Design patterns
Ahmed Kamel Taha
Introduction to reactive programming
Introduction to reactive programming
Leapfrog Technology Inc.
Build Libraries That People Love To use
Build Libraries That People Love To use
Dennis Doomen
Reflectivity Demo
Reflectivity Demo
Marcus Denker
Reactive programming
Reactive programming
saykopatt
Reactive programming with rx java
Reactive programming with rx java
CongTrung Vnit
Vulnerability Chaining; it’s all connected
Vulnerability Chaining; it’s all connected
Toby Kohlenberg
Reactive programming and RxJS
Reactive programming and RxJS
Ravi Mone
Concurrency
Concurrency
Sri Prasanna
Reactive programming intro
Reactive programming intro
Ahmed Ehab AbdulAziz
ProMan(Project Management in python language using KIVY platform)
ProMan(Project Management in python language using KIVY platform)
manojsonkar
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
Ralf Laemmel
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
Ted Leung
Weitere ähnliche Inhalte
Was ist angesagt?
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
assinha
Project Reactor By Example
Project Reactor By Example
Denny Abraham Cheriyan
Vert.x Event Driven Non Blocking Reactive Toolkit
Vert.x Event Driven Non Blocking Reactive Toolkit
Brian S. Paskin
ITFT_Inter process communication
ITFT_Inter process communication
Sneh Prabha
Active Object Design Pattern
Active Object Design Pattern
jeremiahdjordan
Multi-Process JavaScript Architectures
Multi-Process JavaScript Architectures
Mark Trostler
Reactive Programming In Java Using: Project Reactor
Reactive Programming In Java Using: Project Reactor
Knoldus Inc.
Advanced Application Architecture Symfony Live Berlin 2018
Advanced Application Architecture Symfony Live Berlin 2018
Matthias Noback
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Srikanth Reddy Pallerla
Design patterns
Design patterns
Ahmed Kamel Taha
Introduction to reactive programming
Introduction to reactive programming
Leapfrog Technology Inc.
Build Libraries That People Love To use
Build Libraries That People Love To use
Dennis Doomen
Reflectivity Demo
Reflectivity Demo
Marcus Denker
Reactive programming
Reactive programming
saykopatt
Reactive programming with rx java
Reactive programming with rx java
CongTrung Vnit
Vulnerability Chaining; it’s all connected
Vulnerability Chaining; it’s all connected
Toby Kohlenberg
Reactive programming and RxJS
Reactive programming and RxJS
Ravi Mone
Concurrency
Concurrency
Sri Prasanna
Reactive programming intro
Reactive programming intro
Ahmed Ehab AbdulAziz
ProMan(Project Management in python language using KIVY platform)
ProMan(Project Management in python language using KIVY platform)
manojsonkar
Was ist angesagt?
(20)
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
Project Reactor By Example
Project Reactor By Example
Vert.x Event Driven Non Blocking Reactive Toolkit
Vert.x Event Driven Non Blocking Reactive Toolkit
ITFT_Inter process communication
ITFT_Inter process communication
Active Object Design Pattern
Active Object Design Pattern
Multi-Process JavaScript Architectures
Multi-Process JavaScript Architectures
Reactive Programming In Java Using: Project Reactor
Reactive Programming In Java Using: Project Reactor
Advanced Application Architecture Symfony Live Berlin 2018
Advanced Application Architecture Symfony Live Berlin 2018
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Design patterns
Design patterns
Introduction to reactive programming
Introduction to reactive programming
Build Libraries That People Love To use
Build Libraries That People Love To use
Reflectivity Demo
Reflectivity Demo
Reactive programming
Reactive programming
Reactive programming with rx java
Reactive programming with rx java
Vulnerability Chaining; it’s all connected
Vulnerability Chaining; it’s all connected
Reactive programming and RxJS
Reactive programming and RxJS
Concurrency
Concurrency
Reactive programming intro
Reactive programming intro
ProMan(Project Management in python language using KIVY platform)
ProMan(Project Management in python language using KIVY platform)
Andere mochten auch
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
Ralf Laemmel
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
Ted Leung
Aspect oriented architecture
Aspect oriented architecture
tigneb
Produce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented Programming
PostSharp Technologies
Aspect Oriented Programming
Aspect Oriented Programming
Rodger Oates
Aspect-Oriented Programming
Aspect-Oriented Programming
Andrey Bratukhin
Architecture Description Languages
Architecture Description Languages
Henry Muccini
Aspect Oriented Programming
Aspect Oriented Programming
Rajesh Ganesan
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Yan Cui
Introduction to Aspect Oriented Programming
Introduction to Aspect Oriented Programming
Yan Cui
Software Architecture: Architecture Description Languages
Software Architecture: Architecture Description Languages
Henry Muccini
Aspect Oriented Programming
Aspect Oriented Programming
Anumod Kumar
Andere mochten auch
(12)
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
Aspect-oriented programming with AspectJ (as part of the the PTT lecture)
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
Aspect oriented architecture
Aspect oriented architecture
Produce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented Programming
Aspect Oriented Programming
Aspect Oriented Programming
Aspect-Oriented Programming
Aspect-Oriented Programming
Architecture Description Languages
Architecture Description Languages
Aspect Oriented Programming
Aspect Oriented Programming
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming
Introduction to Aspect Oriented Programming
Software Architecture: Architecture Description Languages
Software Architecture: Architecture Description Languages
Aspect Oriented Programming
Aspect Oriented Programming
Ähnlich wie Context-Oriented Programming: Beyond Layers
Mantis Code Deployment Process
Mantis Code Deployment Process
Jen Wei Lee
Open shift and docker - october,2014
Open shift and docker - october,2014
Hojoong Kim
WebDev Crash Course
WebDev Crash Course
Cesar Martinez
Orchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCA
Arthur Berezin
Refactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_Workshop
Max Kleiner
Advanced web application architecture - Talk
Advanced web application architecture - Talk
Matthias Noback
The Meteor Framework
The Meteor Framework
Damien Magoni
Web Technology Fundamentals
Web Technology Fundamentals
sunmitraeducation
Mini-Training: NancyFX
Mini-Training: NancyFX
Betclic Everest Group Tech Team
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
Cloudera, Inc.
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
Cloudera, Inc.
Elements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
They why behind php frameworks
They why behind php frameworks
Kirk Madera
Server-side JS with NodeJS
Server-side JS with NodeJS
Lilia Sfaxi
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Dennis Doomen
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you pain
Dennis Doomen
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsi krishna
OVS-LinuxCon 2013.pdf
OVS-LinuxCon 2013.pdf
DanielHanganu2
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
Ähnlich wie Context-Oriented Programming: Beyond Layers
(20)
Mantis Code Deployment Process
Mantis Code Deployment Process
Open shift and docker - october,2014
Open shift and docker - october,2014
WebDev Crash Course
WebDev Crash Course
Orchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCA
Refactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_Workshop
Advanced web application architecture - Talk
Advanced web application architecture - Talk
The Meteor Framework
The Meteor Framework
Web Technology Fundamentals
Web Technology Fundamentals
Mini-Training: NancyFX
Mini-Training: NancyFX
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
Elements for an iOS Backend
Elements for an iOS Backend
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
They why behind php frameworks
They why behind php frameworks
Server-side JS with NodeJS
Server-side JS with NodeJS
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you pain
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
OVS-LinuxCon 2013.pdf
OVS-LinuxCon 2013.pdf
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
Mehr von ESUG
Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
Technical documentation support in Pharo
Technical documentation support in Pharo
ESUG
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
Garbage Collector Tuning
Garbage Collector Tuning
ESUG
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
thisContext in the Debugger
thisContext in the Debugger
ESUG
Websockets for Fencing Score
Websockets for Fencing Score
ESUG
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
Mehr von ESUG
(20)
Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
Technical documentation support in Pharo
Technical documentation support in Pharo
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
Garbage Collector Tuning
Garbage Collector Tuning
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
thisContext in the Debugger
thisContext in the Debugger
Websockets for Fencing Score
Websockets for Fencing Score
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
Kürzlich hochgeladen
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Antenna Manufacturer Coco
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Kürzlich hochgeladen
(20)
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Context-Oriented Programming: Beyond Layers
1.
©2007Martinv.Löwis Context-Oriented Programming: Beyond Layers Martin
v. Löwis Marcus Denker Oscar Nierstrasz
2.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Agenda • Context-dependent Behavior • Method Layers (PyContext example) • Implicit Layer Activation • Case Studies • Context Variables • Implementation Notes 2
3.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Context Dependencies • Programs need to be aware of the context in which they operate – what is the state of the environment – what user is accessing the system – what mode is the program to be executed in • Example: current user – different roles may cause completely different code to be executed (e.g. administrator may be offered different facilities) • can be modeled through method layers – different users acting in the same role access different data • modeling through method layers is not adequate • Example: dependency of program output on output device – In OO system, rendering algorithm spreads over methods of different classes 3
4.
©2007Martinv.Löwis Layers
5.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Method Layers • addition of a few concepts to object-oriented programming • layer: group of classes and methods to be used together in dynamic scope of execution • layered class: collection of partial definitions of a class, for different layers – layered methods: definitions of methods for specific layers – layered slots: definition of instance attributes for specific layers • (explicit) layer activation: specification of code block that runs in the context of a layer – inside the block, each sent message selects the method defined for that layer – nested activation: need to consider multiple layers in sequence 5
6.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Example: User-Agent Header • Web browsers sent User-Agent header to indicate client software (e.g. MSIE, Firefox, Safari, etc.) – "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" • Web servers sometimes have different behavior depending on User-Agent header • Problem: automated web client might need to claim to operate as a specific user agent 6 Client HTTP Library HTTP ServerHTTP Request User-Agent
7.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Example: User-Agent Header (2) • Assumption: client consists of multiple modules, each using different software layers to access underlying HTTP libraries – explicitly specifying User-Agent to the library is not possible • Assumption: client is multi-threaded; different threads may need to operate in different contexts – setting User-Agent as a global variable is not possible • HTTP libraries in Python: – httplib: direct access to protocol – urllib: unifying library for http, ftp, ... 7
8.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis PyContext: Using Method Layers • with statement: automatic enter/leave semantics from useragent import HTTPUserAgent with HTTPUserAgent("WebCOP"): print "Using useragent layer" get1() get2() • Importing useragent module automatically defines the layer and the layered methods • Disabling layers from layers import Disabled with Disabled(Layer): code 8
9.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Defining Layers • Inherit from class Layer – Class can have arbitrary methods, instance variables, etc class HTTPUserAgent(layers.Layer): def __init__(self, agent): self.agent = agent 9
10.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Defining Layered Methods • Inherit a class (with arbitrary name) from both the layer and the class to augment • Define methods with the same name as the original methods – Each method has automatic second parameter "context" (after self, before explicit method parameters) • Decorate each method with either before, after, or instead • Context: Object indicating the layer activation – .layer: reference to the layer object – .result: result of the original method (for after-methods) – .proceed: callable object denoting the continuation to the original method (or the next layer) 10
11.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis class HTTPConnection(HTTPUserAgent, httplib.HTTPConnection): # Always add a User-Agent header @before def endheaders(self, context): with layers.Disabled(HTTPUserAgent): self.putheader("User-Agent", context.layer.agent) # suppress other User-Agent headers added @instead def putheader(self, context, header, value): if header.lower() == 'user-agent': return return context.proceed(header, value) 11
12.
©2007Martinv.Löwis Implicit Activation
13.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Implicit Activation • Problem: explicit activation still needs to identify point in code where context might change or where context will be relevant • Objective: allow addition of layers which get activated "automatically" – specifically, when a condition on the environment changes • Design issues: – how can the system tell whether a condition becomes true? • each layer implements an active method – when should the active method be evaluated? • each time a layered method is executed whose meaning depends on whether the layer is active or not 13
14.
©2007Martinv.Löwis Case Studies
15.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Objective • We tried to evaluate what aspects of context are common in application programs today • Issue: how can we find code that depends on context? – Starting point: assume caller and callee are designed to run within the same context – Starting point: look for traditional examples of context • Selected case studies: large Python applications/libraries – Django: web application framework – Roundup: bug tracker – SCons: automated build tool 15
16.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Results • Web applications (Django, Roundup) need to support concept of "current" request, including authenticated user, session data, target URL, etc. • SCons keeps track of context in "environment": information about the current build goal • These things were often referred to as "context", or showed up as pass-through parameters in methods – Searching for "context" revealed further context-dependent code fragments – Searching for pass-through parameters not easily possible with pure text searching; subject for further study • Context information often not used to select different pieces of code, but merely as lookup keys in associative arrays 16
17.
©2007Martinv.Löwis Dynamic Variables
18.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Motivation • case study results lead to identification of additional concept for context-oriented programming: Dynamic Variables • in order to avoid pass-through parameters, a variable holding context should be set in a caller, and then read in a nested callee – similar to dynamic variables in functional languages – requires careful usage, to avoid old problems with dynamic variables (unintentional access due to naming collisions) • require explicit read and write operations 18
19.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Dynamic Variables in PyContext • Example: current HTTP session 1. Declare dynamic variable _session = Variable() 2. Obtain current variable (e.g. through helper function) def current_session(): return _session.get() 3. Setup variable from dynamically-read context def process_request(request): session = lookup_session(request) with _session.set(session): dispatch_request(request) 19
20.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Implementation Notes • Method layers: – Dynamically replace methods with wrappers • Dynamic variables: 1. perform stack walk: O(stack-depth) 2. use thread-local storage: O(1) 20
21.
Context-oriented Programming: Beyond
Layers ©2007Martinv.Löwis Summary • current applications (in particular webapps) show high degree of context-awareness • context-dependency is not made explicit in the code • layers are a first step to making context explicit • rehabilitation of dynamic variables necessary to support common cases of context 21
Jetzt herunterladen