An introductory lecture on Context-Oriented Programming, part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium. This particular lecture was made by Dr. Sebastian Gonzalez in close collaboration with Prof. Kim Mens.
Презентація з фізики для учнів 10 класу з теми "Механічні властивості твердих тіл" містить основні теоретичні відомості з даної теми, приклади розв'язаних задач та задачі для самостійного опрацювання.
ТПЛМ 1131 Інформаційні потоки в логістиці. О.М.Горяїнов (2009)Oleksiy Goryayinov
Презентація з дисципліни «Логістика» (для менеджерів). Наведено матеріал «13.1 Інформаційні потоки в логістиці» (причини зростання ролі інформаційних потоків, класифікація інформаційних потоків, машинозчитуваний штриховий код, сканування штрихових кодів, європейська система кодування та
інше)
Automated deployment of data collection policies over heterogeneous shared se...Cyril Cecchinel
Smart buildings and smart cities rely on interconnected sensor networks that collect data about their environment to support various applications. Developing and deploying the data collection architectures of these systems is a challenging problem. The specificities of the sensor platforms compel software engineers to work at a low level. This make this activity tedious, producing code that badly exploit the network architecture, and hampering reuse of data collection policies. Moreover, several data collection programs cannot be guaranteed to be deployable on a shared infrastructure. We present an automated approach that supports (i) the definition of data collection policies at a higher level of abstraction, (ii) the representation of the diverse platforms and the network topology, and (iii) the automatic composition and deployment of the policies on top of heterogeneous sensing infrastructures following different strategies. The approach is tooled and has been assessed on both realistic and simulated deployments.
Презентація з фізики для учнів 10 класу з теми "Механічні властивості твердих тіл" містить основні теоретичні відомості з даної теми, приклади розв'язаних задач та задачі для самостійного опрацювання.
ТПЛМ 1131 Інформаційні потоки в логістиці. О.М.Горяїнов (2009)Oleksiy Goryayinov
Презентація з дисципліни «Логістика» (для менеджерів). Наведено матеріал «13.1 Інформаційні потоки в логістиці» (причини зростання ролі інформаційних потоків, класифікація інформаційних потоків, машинозчитуваний штриховий код, сканування штрихових кодів, європейська система кодування та
інше)
Automated deployment of data collection policies over heterogeneous shared se...Cyril Cecchinel
Smart buildings and smart cities rely on interconnected sensor networks that collect data about their environment to support various applications. Developing and deploying the data collection architectures of these systems is a challenging problem. The specificities of the sensor platforms compel software engineers to work at a low level. This make this activity tedious, producing code that badly exploit the network architecture, and hampering reuse of data collection policies. Moreover, several data collection programs cannot be guaranteed to be deployable on a shared infrastructure. We present an automated approach that supports (i) the definition of data collection policies at a higher level of abstraction, (ii) the representation of the diverse platforms and the network topology, and (iii) the automatic composition and deployment of the policies on top of heterogeneous sensing infrastructures following different strategies. The approach is tooled and has been assessed on both realistic and simulated deployments.
MobiCloud: Towards Cloud Mobile Hybrid Application Generation using Semantica...Amit Sheth
Ajith Ranabahu, Amit Sheth, Ashwin Manjunatha, and Krishnaprasad Thirunarayan, 'Towards Cloud Mobile Hybrid Application Generation using Semantically Enriched Domain Specific Languages', International Workshop on Mobile Computing and Clouds (MobiCloud 2010), Santa Clara, CA,October 28, 2010.
Paper: http://knoesis.org/library/resource.php?id=865
Project: http://knoesis.wright.edu/research/srl/projects/mobi-cloud/
Cloud Operations and Analytics: Improving Distributed Systems Reliability usi...Jorge Cardoso
Lecture given at the Technical University of Munich, 12 December 2016, on Cloud Operations and Analytics: Improving Distributed Systems Reliability using Fault Injection.
Towards application development for the internet of thingsPankesh Patel
Application development in the Internet of Things (IoT) is challenging because it involves dealing with a wide range of related issues such as lack of separation of concerns, and lack of high-level of abstractions to address both the large scale and heterogeneity. Moreover, stakeholders involved in the application development have to address issues that can be attributed to different life-cycles phases. when developing applications. First, the application logic has to be analyzed and then separated into a set of distributed tasks for an underlying network. Then, the tasks have to be implemented for the specific hardware. Apart from handling these issues, they have
to deal with other aspects of life-cycle such as changes in application requirements and deployed devices.
Several approaches have been proposed in the closely related fields of wireless sensor network, ubiquitous and pervasive
computing, and software engineering in general to address the above challenges. However, existing approaches only cover limited subsets of the above mentioned challenges when applied to the IoT. This work proposes an integrated approach for addressing the above mentioned challenges. The main contributions of this work are: (1) a development methodology that separates IoT application development into different concerns and provides a conceptual framework to develop an application, (2) a development framework that implements the development methodology to support actions of stakeholders. The development framework provides a set of modeling languages to specify each development concern and abstracts
the scale and heterogeneity related complexity. It integrates code generation, task-mapping, and linking techniques
to provide automation. Code generation supports the application development phase by producing a programming
framework that allows stakeholders to focus on the application logic, while our mapping and linking techniques together support the deployment phase by producing device-specific code to result in a distributed system collaboratively hosted by individual devices. Our evaluation based on two realistic scenarios shows that the use of our approach improves the productivity of stakeholders involved in the application development.
Thesis presentation: Middleware for Ubicomp - A Model Driven Development Appr...Till Riedel
With computers that will be interwoven into almost every industrial product like its nervous system (Steinbuch, 1966) we are already approaching what Weiser (1991) called Ubiquitous Computing, in terms of quantity, degree of embedding of computing systems in our life and work environment.
This thesis investigates model driven software development (MDSD) approach as a tool for contextual adaption of ubiquitous systems. Ubiquitous Systems (i.e. the embedded devices) are subject to changes that affect the execution of software. The systems are very heterogeneous and and the designer has to take a diverse set of plattforms and ressource constrained hardware into consideration.
By implementing a model driven development techniques for core problems of ubiquitous computing, namely distributed execution and heterogeneous communication in ubiquitous systems the work demonstrates that Model Driven Software Development of Ubiquitous Systems maybe used to solve the inherent contradiction between top-down and bottom-up development of networked embedded systems.
Radio amateurs provide a pool of technically competent personnel that contribute to information engineering and communications and other technical professions in countries in which it is an established hobby; countries such as Japan and the USA. In the Asia-Pacific region, while Japan has more radio amateurs than any other country, governments of the lesser developed countries tend to ignore amateur radio as a source of the indigenous personnel needed to help provide the benefits of 21st century technology. This paper first addresses the problem of educating good systems engineers by suggesting that potential students be preselected from pools of candidates who show characteristics deemed desirable in systems engineers. The paper then shows that one source of partially trained personnel maybe found among the technical members of the amateur radio community and similar technical hobbies. The paper then discusses some of the technical achievements of amateur radio followed by the twelve engineering roles of amateur radio in the manner of (Sheard 1996) and proposes that there is enough similarity between amateur radio’s technical activities and the role of systems engineering so that amateur radio can provide a source for students with experience in systems engineering activities. The last section of the paper then mentions some amateur radio failures that systems engineering should have prevented and concludes with a discussion on recruiting young systems engineers via amateur radio clubs, some synergy between INCOSE and amateur radio clubs and suggestions for future research
These slides, covering the topics of Software Maintenance and Evolution, are introductory slides to the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium
Software Reuse and Object-Oriented Programmingkim.mens
These slides on Software Reuse and Object-Oriented Programming are part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium
These slides on Object-Oriented Design Heuristics are part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium.
This presentation on Object-Oriented Application Frameworks is part of a larger course LINGI2252 on Software Maintenance and Evolution, given at UCL university in Belgium.
Towards a Context-Oriented Software Implementation Frameworkkim.mens
Context-aware systems must manage the dynamic selection, activation, and execution of feature variants according to changing contexts, detected from data gathered from their surrounding execution environment. Many context-oriented programming languages focus only on the implementation level by providing appropriate language abstractions for implementing behavioural variations that can adapt dynamically to changing contexts. They often ignore or presuppose the existence of mechanisms to deal with earlier aspects such as the gathering of sensory input and context discovery. In this presentation we discuss a layered software architecture that reconciles all these aspects in a single implementation framework, which can be customised by application programmers into actual context-aware applications. This framework and a simulator to test applications build using this framework we recently implemented in Ruby and Ruby on Rails.
Towards a Taxonomy of Context-Aware Software Variabilty Approacheskim.mens
Modern software systems demand more and more smart capabilities depending on their context of use, as well as the ability to dynamically adapt these capabilities according to sensed context changes. This requires appropriate techniques for modelling, representing and handling context-aware software variability. While traditional variability modelling approaches like feature orientation and software product lines are evolving to address the increased dynamicity and context specificity required for this new generation of software systems, new paradigms such as context-oriented programming have emerged. Although developed independently, since they address similar issues, many similarities exist between these approaches. The purpose of this work is to define, categorise and compare key concepts shared by these approaches.
Such a taxonomy is a first step towards a better understanding of the differences and similarities between different approaches for managing context-aware software variability, and to achieve a cross-fertilisation between them.
An introductory lecture on context-oriented programming, part of a full course on Programming Paradigms at UCL university in Belgium, focussing on reflection and meta programming techniques in a variety of languages. This particular lecture was made by Sebastian Gonzalez in close collaboration with Kim Mens.
An introduction to the basics of reflection and meta programming, part of a full lecture on programming paradigms at UCL university in Belgium, with reflection and meta programming as theme. (Further lectures focus more in depth on reflection and meta programming in a variety of programming languages such as Smalltalk, Ruby and Java.) Slides created collaboratively by Kim Mens and Roel Wuyts.
After a previous introductory lecture on the basics of reflection in Java, in this lecture we take a closer look at some more advanced reflective features of the language such as dynamic proxies, call stack introspection and instrumentation. This lecture is part of a full course on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
An introduction to the basics of reflection in the object-oriented programming language Java, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
An introduction to some advanced language features of the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme. This lecture looks into the Ruby features of higher-order programming (lambdas), singleton methods, mixin modules, reflection and metaprogramming.
A quick introduction to the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
A quick introduction to the object-oriented programming language Smalltalk, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
A gentle and intuitive introduction to reflection and meta programming, part of a full lecture on programming paradigms at UCL university in Belgium, with reflection and meta programming as theme. (Further lectures focus more in depth on reflection and meta programming in a variety of languages such as Smalltalk, Ruby and Java.)
Managing the Evolution of Information Systems with Intensional Views and Rela...kim.mens
Like any software system, information systems suffer from structural inconsistencies that may arise during system evolution. Appropriate tools are needed to encode the structural regularities the system should adhere to, and to check conformance of the system against those regularities upon evolution. Taking inspiration from the intensional views approach to document and verify structural regularities in source code, we developed a similar tool to document and verify structural regularities in large databases. Regularities are expressed by the user at a high level in a graphical user interface, and then translated into relational algebra in order to check the regularities over the data. Discovered inconsistencies are presented back to the user in appropriate high-level data views. As a case study, the developed tool was successfully applied to a safety critical information system deployed at a large Belgian university. It is used by the rescue services to accurately locate users based on the location of their IP phones from which an emergency call was made.
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)kim.mens
Usage Contracts (or uContracts for short) offer a simple unit-testing like way for letting programmers document and check conformance to structural source-code regularities, based on a “contract” metaphor. They provide immediate feedback to developers during coding. Essentially, they can be seen as an embedded DSL which remains close to the host programming language and with a tight but not coercive integration with the host IDE, to avoid adoption issues.
This work was conducted by Angela Lozano, Andy Kellens and Kim Mens.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
1.
CONTEXT-ORIENTED PROGRAMMING
LINGI2252 – PROF. KIM MENS
* Slides based on joint research with Dr. Sebastian Gonzalez, Dr. Nicolas Cardozo & others
*
(These slides are part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium)
3. Traditional Computer Systems
“Traditionally, hardware and software were input-
output systems that took input explicitly given to
them by a human, and acted upon that input
alone to produce an explicit output.
Now, this view is seen as too restrictive. …”
Henry Lieberman & Ted Selker
system
input output
3
Out of Context: Computer Systems That Adapt To, and Learn From, Context.
IBM Systems Journal,Vol 39, Nos 3&4, p.617-631, 2000 [Lieberman&Selker2000]
4. Context-Aware Systems
“… Smart computers, intelligent agent software,
and digital devices of the future operate on data
that is not explicitly given to them, data that they
observe or gather for themselves.These operations
may be dependent on time, place, weather, user
preferences, or the history of interaction.
In other words: context.”
Henry Lieberman & Ted Selker
4
Out of Context: Computer Systems That Adapt To, and Learn From, Context.
IBM Systems Journal,Vol 39, Nos 3&4, p.617-631, 2000 [Lieberman&Selker2000]
5. Evolution Of Hardware 5
fixed (1980)
mainframes
servers
desktops
consoles
portable (1990)
laptops
netbooks
subnotebooks
mobile (2000)
handhelds
tablets
smartphones
‣ CPU load
‣ available memory (RAM)
‣ available storage (HD)
‣ date and time
‣ connected peripherals
‣ network peers
‣ touch screen
‣ geographical location
‣ GPS signal quality
‣ accelerometer
‣ wi-fi signal quality
‣ battery power
‣ camera
‣ microphone
‣ light sensor
+
+
…
6. text (1970)
BSD
SunOS
MS DOS
GNU/Linux
graphical (1980)
Mac OS
Amiga OS
Windows
KDE, GNOME
web (1990)
static
dynamic
web 2.0
mashups
mobile (2000)
Symbian OS
Windows CE
iOS
Android
Evolution Of Software 6
‣ available libraries
‣ available hardware services
‣ available network services
‣ user task
‣ user expertise
‣ user preferences
‣ user privileges
‣ task urgency
‣ operation modes
‣ logging
‣ debugging
‣ degraded
‣ free trial
‣ partial failure
‣ domain specific
‣ [3D] wireframe / solid view
‣ [Maps] satellite / schematic
‣ ...
8. Need For Context-Aware Computing
“Computer systems will increasingly need to be
sensitive to their context to serve their users better.”
Eli Rohn
8
Predicting Context Aware Computing Performance.
Ubiquity, p.1-17, Feb. 2003 [Rohn2003]
9. Context-Aware Systems
Idea appeared ~ late 1980s; increasingly studied since ~ 2000.
9
3. The general characteristics of the articles
Fig. 2. Classification of articles by publication year.
Table 3
Classification
Journal artic
IEEE Pervasi
Personal and
IEEE Interne
Wireless Per
IEEE Intellige
Mobile Netw
IEEE Transac
The Others
Expert Syste
Computer Co
Journal of Sy
Pervasive an
World Wide
IEEE Wireles
Interacting w
Total
J.-y. Hong et al. / Expert Systems with Applications 36
Jong-yi Hong, Eui-ho Suh, Sung-Jin Kim
Context-Aware Systems:A literature review and classification.
Expert Systems with Applications 36, 2009 [Hong&al2009]
10. Context-Aware Systems
Studied from a variety of research angles [Hong&al2009]:
‣ conceptual: guidelines, frameworks, algorithms, context
reasoning and context data management
‣ networks: network protocols, sensor networks, …
‣ middleware for distributed context-aware applications
‣ applications: studies and
development of dedicated
context-aware applications
(e.g., a smart tour guide)
‣ user-interface technology
and usability studies
10
systems Ranganathan, Campbell, Ravi, and Mahaja
(2002), Sumi and Mase (2000), Sumi and N
Chen (2007)
M-commerce Anagnostopoulos, Tsounis, and Hadjiefthy
Frank, and Hansen (2003), Broens, Haltere
Santoro (2006), Kwon (2003), Kwon and S
Mitteregger (2007), Mandato, Kovacs, Hoh
(2005), Skov and Høegh (2006), Stylianos,
Broens (2007), Wohltorf, Cissée, and Riege
Web service Blake, Kahan, and Nowlan (2007), Debaty,
(2004), Kanter (2003), Kwon (2006b), Kwo
Pearce (2003)
Table 9
References of user infrastructure layer.
Classification criteria References
User infrastructure Interface Alexander and Matth
(2005), Hong, Dickso
Salovaara, and Lopez
(2003), Rehman, Staj
Usability Barnard, Yi, Jacko, an
11. Focusses on the programming angle:
Enabling context-aware software adaptability through a
programming language engineering approach:
‣ dedicated programming languages to express
context-driven behaviour adaptation
‣ contexts and behavioural variations to context
as first class language citizens
Context-Oriented Programming 11
12. COP
… through a programming
language engineering approach
enables context-driven
behaviour adaptability …
13. Some Definitions
“A software system is context-aware
if it can extract, interpret and use context information
and adapt its functionality to the current context of use.”
[Rohn2003]
“Context is everything
but the explicit input and output to a system.”
[Lieberman&Selker2000]
“A context-oriented software system is
a context-aware system that has an explicit representation
of context and contextual variations as first class citizens.”
[my definition]
13
14. Enabling Context-Driven Behaviour Adaptability
How to build software systems that can adapt their
behaviour dynamically …
… according to detected context changes in their
surrounding environment ?
One possible approach :
context-oriented programming
a programming language engineering approach
15. Applications should become more aware of their execution context,
and should adapt dynamically to such context to provide services
that match their clients’ needs to the best extent possible.
environmental properties
humidity, light, noise, lighting
network peers & services
projector, GPS, storage
internal state
load, time, battery
spatial state
position, orientation,
movement
location semantics
nearby objects & facilities
users
expertise, preferences
Context Is Key 15
16. take advantage of room projector for presentation
peer service
decrease playback quality when battery power is low
internal state
user task
show parking spots and gas stations (only) when driving
environmental conditions
give more detailed indications when visibility is low
disable phone ringtone in quiet places
location semantics
Adaptation Examples 16
17. So Why Aren’t We There Yet? 17
Richard Gabriel, 2006
Software systems today are produced
according to a manufacturing model:
a finished product is constructed at the
factory and shipped to its final
destination where it is expected to act
like any other machine —reliable but
oblivious to its surroundings and its own
welfare.
18. we still program this...
using the
programming models
conceived for this....
(2010) (1980)
Mindset Mismatch 18
19. Current programming techniques and design principles invite
programmers to think in a way that is mostly oblivious of the physical,
technical and human environment in which the software will be used.
Many chances of delivering improved services are thus missed.
?
?
?
?
?
?
Current Mindset 19
programming in isolation
20. programming with context
A new paradigm is needed that helps overcoming this limiting vision
by putting programmers in the right state of mind to build
dynamically adaptable applications from the ground up.
Needed Mindset 20
27. default
phone user
phone environment
phone status
class phone {
method receive ( call ) {
if ( ) then
else if ( ) then
else if ( ) then
else
}
Paradigmatic Shortcomings 27
conditional statements
Adaptable
Tangled
Scattered
Fixed
No reuse
Complex logic
29. Paradigmatic Shortcomings 29
Software rigidness
The variability points of the application are hard-
coded in its architecture. It is difficult to add new
variants non-invasively.
Lack of modularity
Tight coupling between core business logic and
infrastructural code to manage the variants makes the
software difficult to maintain and evolve.
Mindset mismatch
Programming tools make programmers oblivious of
the context in which their applications will run.
Programmers are not put in the right state of mind to
build adaptable software.
General Symptoms (Recap)
30. Hypothesis 30
current programming tools
adaptive systems
we need to reengineer our tools
A major obstacle for adaptability is the unavailability of appropriate
context-aware programming languages and related tool sets.
31. Side Comment 31
programming abstractions matter
tool 1: C#
using System;
public class Program
{
static long Factorial(long number)
{
if(number <= 1)
return 1;
else
return number * Factorial(number - 1);
}
static int Main(string[] args) {
Console.WriteLine(Factorial(5));
return 0;
}
}
tool 2: Ruby
def fact(n)
n <= 1 ? 1 : n * fact(n - 1)
end
fact(5)
n! = {1
n(n-1)!
if n = 0
if n > 0
maintainability
domain: math
32. Side Comment
A high-level language frees a program from
much of its accidental complexity; it eliminates
a whole level of complexity that was never
inherent in the program at all.
programming language engineering
32
Develop programming tools that reduce accidental complexity
in the expression of context-driven behaviour adaptation
Frederick Brooks, 1987
essential complexity ≠
accidental complexity
33. What?
context-driven
software adaptability through
dedicated language abstractions
and composition mechanisms
2008 20132010
Subjective-CAmbience
Context Traits
“Our ambition is to provide languages, formalisms, models and tools to support the
development of software systems that can dynamically adapt their behaviour to the current
execution context, to provide the most appropriate behaviour according to that context.”
34. Some Context-Oriented Programming Languages34
S. GONZALEZ, K. MENS,A. CADIZ.
Context-Oriented Programming with the Ambient Object System.
Journal of Universal Computer Science, 14(20):3307–3332, 2008.
S. GONZALEZ, N. CARDOZO, K. MENS,A. CADIZ, J-C. LIBBRECHT, J. GOFFAUX.
Subjective-C: Bringing Context to Mobile Platform Programming. International
Conference on Software Language Engineering 2010.
S. GONZALEZ, K. MENS, M. COLACIOIU,W. CAZZOLA.
Context Traits: dynamic behaviour adaptation through run-time trait recomposition.
International conference on Aspect-Oriented Software Development 2013.
Subjective-CAmbience
Context Traits
2008 20132010
35. Some Context-Oriented Programming Languages35
Subjective-C
2010 * cited by 59 according to
Google Scholar on 14.12.2016
*
S. GONZALEZ, K. MENS,A. CADIZ.
Context-Oriented Programming with the Ambient Object System.
Journal of Universal Computer Science, 14(20):3307–3332, 2008.
S. GONZALEZ, N. CARDOZO, K. MENS,A. CADIZ, J-C. LIBBRECHT, J. GOFFAUX.
Subjective-C: Bringing Context to Mobile Platform Programming. International
Conference on Software Language Engineering 2010.
S. GONZALEZ, K. MENS, M. COLACIOIU,W. CAZZOLA.
Context Traits: dynamic behaviour adaptation through run-time trait recomposition.
International conference on Aspect-Oriented Software Development 2013.
36. Context-Driven System Architecture 36
external context
effect
context
information
ActuatorsSensors
arbitrated
context
changes
World
Context
Discovery
Context
Management
Active
Context
internal
Application
Behaviour
37. Contexts As Situation Reifiers 37
no semantics
computationally
accessible data
Battery charge = 220 mAh
Idle cycles = 100 MHz
User agent = “Mozilla/5.0...”
Z axis = 0.03
action can be taken
well-defined
situations
Context
Discovery
contexts are reified situations
for which adapted application behaviour can be defined
Low battery charge
High CPU load
Firefox
Landscape orientation
LowBattery = new Context();
window.addEventListener(‘batterystatus’,
function (battery) {
if (battery.level < 30)
LowBattery.activate();
else
LowBattery.deactivate(); });
… in JavaScript
Context
Discovery
39. Standard Widget Spec
UILabel class
drawTextInRect:
Draws the receiver’s text in the specified rectangle.
- (void)drawTextInRect:(CGRect)rect
Parameters
rect
The rectangle in which to draw the text.
Discussion
You should not call this method directly. This method
should only be overridden by subclasses that want to
modify the default drawing behavior for the label’s text.
Availability
Available in iOS 2.0 and later.
Declared In
UILabel.h
39
40. Main Idea 40
@implementation UILabel (color)
@contexts Landscape
- (void)drawTextInRect:(CGRect)rect {
self.textColor = [UIColor greenColor];
return @resend();
}
@end
Open classes
Objective-C
COP
Subjective-C
✓ Adaptation of any existing component
✓ No access to original source code needed
✓ Adaptations can be cleanly modularised
Application
Behaviour
Label
43. Summary 43
✓ Clean application logic
✓ Clean modularisation of adaptations
✓ Context reification and management
✓ Run-time behaviour adaptation of any component (incl. 3rd party)
✓ No need for recompilation or access to original source code
✓ Maximises adaptation points while avoiding architectural burden
✓ Scoped adaptations
language abstractions for adaptation to context … with sound technical underpinnings
@context Landscape
-id behaviour {
// context-specific logic
} Objects
Open Classes
Reflection
Subjective Programming
Context-Oriented Programming
Subjective-C
45. Case Study: On-Board Car System 45
N. CARDOZO, K. MENS, S. GONZALEZ, P.-Y. ORBAN,W. DE MEUTER. Features on Demand.
International Workshop onVariability Modelling of Software-Intensive Systems, 2014.
Context Traits
46. Case Study: On-Board Car System 46
Context Traits
P.-Y. ORBAN. Using Context-Oriented Programming for Building
Adaptive Feature-Oriented Software for Car On-Board Systems.
Master thesis in Computer Science, Université catholique de Louvain, 2013
47. Case Study: On-Board Car System 47
Context Traits
location = EU
Display speed reading using
the metric system units
Context-specific features
48. Case Study: On-Board Car System 48
location = EU
Context changes trigger behavioural adaptation
location = UK
49. Case Study: On-Board Car System 49
location = EU location = UK
Display speed reading using
the metric system units
Display speed reading using
the imperial system units
Context TraitsImperialSystem = Trait({
var CONV_RATIO = 0.621371192;
getSpeed: function(msg) {
_val = this.proceed();
Math.round _val * CONV_RATIO; }
getHtml: function() {
display.setGaugeDisplay(this.proceed().replace("km/h", "mph")); }
});
51. Method Pre-Dispatch 51
Whenever a context is (de)activated
For every class c and selector s the context adapts,
find all active* methods
M(c, s)={ m1, m2, m3, ..., mn }
Reorder them according to specificity
m1 < m2 < m3 < ... < mn
and deploy the first one m1
‣ m1 is the most specific implementation for the current context
‣ resend invokes the remaining methods in order
‣ mn is (usually) the default implementation
* methods defined for contexts that are currently active
52. Method Dispatch 52
Whenever a message is sent
(to receiver r, with selector s and arguments a)
Find all active* methods that match the message
M(r,s,a) = { m1, m2, m3, ..., mn }
Reorder them according to specificity
m1 < m2 < m3 < ... < mn
and invoke the first one m1
‣ m1 is the most specific implementation for the current context
‣ resend invokes the remaining methods in order
‣ mn is (usually) the default implementation
* methods defined for contexts that are currently active
54. Method Pre-Dispatch 54
Is the method order always defined?
‣ Could there be no applicable methods?
➡ default implementation
‣ Could there be non-comparable methods?
➡ the order should be total
➡ if not, we’re in trouble
M(r,s,a)={ m1, m2, m3, ..., mn }
M(c, s)={ m1, m2, m3, ..., mn }
59. Programming For Context-Driven Adaptability59
✓Definition of context
✓Reifies the circumstances in which the software executes
✓Frame of reference to define adaptations
✓Behaviour adaptability
✓Language abstractions
✓Modularity of adaptations
✓Context discovery
✓Context management
➡ Consistency management
Summary
60. Conclusion : Mind The Context ! 60
Richard Gabriel, 2006
We need to use softer, more dynamic
architectures that support adding or
replacing modules after deployment
and architectures where objects can
be repaired in situ, methods
changed / added, internal state
restructured, and object hierarchies
rewired. We also need new types of
languages to describe the architecture
of our systems.
61. Additional Reading 61
N. CARDOZO, S. GONZALEZ, K. MENS, R.VAN DER STRAETEN, J.VALLEJOS,T. D’HONDT. Semantics for Consistent
Activation in Context-Oriented Systems. Information and Software Technology, 58:71-94, 2015.
N. CARDOZO, K. MENS, S. GONZALEZ, P.-Y. ORBAN,W. DE MEUTER. Features on Demand. International Workshop on
Variability Modelling of Software-Intensive Systems, 2014.
N. CARDOZO, S. GONZALEZ, K. MENS, R.VAN DER STRAETEN,T. D’HONDT. Modeling and Analyzing Self-adaptive
Systems with Context Petri Nets. Symposium on Theoretical Aspects of Software Engineering, 2013.
S. GONZALEZ, K. MENS, M. COLACIOIU,W. CAZZOLA. Context Traits: dynamic behaviour adaptation through run-time
trait recomposition. International conference on Aspect-Oriented Software Development, 2013.
E. BAINOMUGISHA,A. CADIZ, P. COSTANZA,W. DE MEUTER, S. GONZALEZ, K. MENS, J.VALLEJOS,T.VAN CUTSEM.
Language Engineering for Mobile Software. Chapter of the Handbook of Research on Mobile Software Engineering:
Design, Implementation and Emergent Applications, IGI Global, 2012.
N. CARDOZO, S. GUNTHER, K. MENS,T. D’HONDT. Feature-Oriented Programming and Context-Oriented
Programming: Comparing Paradigm Characteristics by Example Implementations. International Conference on Software
Engineering Advances, 2011.
S. GONZALEZ, N. CARDOZO, K. MENS,A. CADIZ, J-C. LIBBRECHT, J. GOFFAUX. Subjective-C: Bringing Context to
Mobile Platform Programming. International Conference on Software Language Engineering, 2010.
J.VALLEJOS, S. GONZALEZ, P. COSTANZA,W. DE MEUTER,T. D’HONDT, K. MENS. Predicated Generic Functions:
Enabling Context-Dependent Method Dispatch. International Conference on Software Composition, 2010.
S. GONZALEZ, K. MENS,A. CADIZ. Context-Oriented Programming with the Ambient Object System. Journal of
Universal Computer Science, 14(20):3307–3332, 2008.
S. GONZALEZ, K. MENS, P. HEYMANS. Highly Dynamic Behaviour Adaptability through Prototypes with Subjective
Multimethods. Symposium on Dynamic Languages, 2007.
62.
63. CONTEXT-ORIENTED PROGRAMMING
POSSIBLE QUESTIONS
✦ What is the main difference between traditional software systems and context-aware
systems?
✦ Explain, in your own words, what problems context-oriented programming tries to solve.
✦ Explain, in your own words, what context-oriented programming is.
✦ Two different techniques exist for implementing dynamic adaptation of software behaviour
to context: method dispatch and method pre-dispatch. Briefly explain and compare these
two techniques.
✦ One particular technique for implementing dynamic adaptation of software behaviour to
context is that of method pre-dispatch. Explain that technique in detail and illustrate it with
a concrete example.