Post on 11-Jan-2016
1
Dynamic Component Composition for Functionality Adaptation in Pervasive
EnvironmentsN. Belaramani, C.L. Wang, and F.C.M. Lau
The Systems Research Group
Department of Computer Science & Information Systems
The University of Hong Kong
2
Overview Mobile & Pervasive Environments
Undeniable emerging trend
Main Requirement in Mobile & Pervasive Computing: Software must be able to adapt dynamically
Functionality Adaptation One of the most versatile adaptation techniques Makes software very dynamic
Our Solution: Dynamic Component Composition
Software is assembled at run-time
Facet Model & Sparkle System Illustrates the feasibility of dynamic component composition in a mobile pervasive
environment
3
Pervasive Environments Advances in Wireless technology
Bluetooth1-2Mpbs
Wireless Lans54Mbps GPRS
114kbps
4
Pervasive Environments Gadgets with wireless connectivity
5
Pervasive Environments Lots of mobile devices
6
Pervasive Environments Lots of Users
Worldwide Mobile Terminal Sales 2001 – 412 Million2002 – 425 Million2003 – 475 Million2004 – 501 Million2005 – 545 Miliion
(Source: Gartner Dataquest Jan 2003)
Worldwide PDA Shipments2001 – 13 Million2002 – 14 Million2003 – 17 Million
(Source: Gartner Dataquest July 2002)
7
Pervasive Environments The Dream:
Pervasive Computing should enable uses to carry out
Computing Anytime Anywhere from Any Device
8
Pervasive Environments Still not Completely a Reality
Why? Software architecture is not yet ready
Main Characteristic Heterogeneity and Run-time Change
Device Configurations Network Infrastructure Environmental Factors User Preferences
Main focus for software: Ability to ADAPT
9
Adaptation It is the means to change a run-time characteristic in
response to a trigger Change a certain property, parameter or metric
Data Adaptation Network Level Adaptation Energy Adaptation Migration Adaptation Functionality Adaptation
10
Functionality Adaptation Computing provides users means to carry out certain tasks
Applications are essentially groups of functionalities which enable users fulfill these tasks.
Functionality Adaptation Adapting the way these functionalities are carried out Changing the execution of the application Most versatile adaptation technique
Example, In cases of bad network conditions, only subject of emails are
downloaded, rather than the whole messages when viewing inbox If less memory is available, a more memory efficient, but requiring
more processing time, algorithm can be used.
11
Dynamic Component Composition Applications are made of Components
Brought in from the network, and linked at run-time when they are required
Unlinked and discarded after use.
“GET-USE-THROW”
Application
Components
12
Dynamic Component Composition Applications are made of Components
Brought in from the network, and linked at run-time when they are required
Unlinked and discarded after use.
“GET-USE-THROW”Components
13
Dynamic Component Composition Applications are made of Components
Brought in from the network, and linked at run-time when they are required
Unlinked and discarded after use.
“GET-USE-THROW”Components
14
Dynamic Component Composition “Unlimited” Functionality
Discarding unwanted components frees up resources to bring in other components
Size of the application is not a concern
Intuitive support for functionality adaptation Components suitable for the run-time environment are
brought in Applications are dynamically extensible and adaptable
15
Sparkle Mobile Computing System
Facet Query
Facet Retreival
Service Providers
Facet Servers
Co-operative CachingIntelligen
t Proxies
Computational Grid
Execution Servers
Delegation/ Mobiie code
Peer-to-Peer Interaction
Clients
16
Sparkle Mobile Computing System Utilizes Dynamic Component Composition in a
Mobile Environment
Applications are made of components – Facets
Each facet fulfills certain functionality
Facets brought in at run-time, executed, then discarded
17
Facet Model Functionality
single well-defined task in an application E.g. blurring an image, matrix multiplication
Given a set of inputs, it determines what changes are made and the outputs attained
Contract which specifies Set of input & output parameters Description of what is carried out Pre-conditions and Post-conditions Side effects
In our model, it is identified by a funcID
18
Facet Model Separation of functionality from Data and UI
Facets Pure functional units Downloaded to client devices on demand Implement single functionality
single publicly callable method No residual state
Functionality provided by a facet is independent of any previous invocations
Makes it throwable & replaceable at run-time
19
Facets Made up of 2 parts
Shadow specifies properties of the facet
General info: facetID, vendor, version Functionality info: funcID Resource requirements: memory, processing, etc Dependencies XML based
Code Segment Executable code to achieve the functionality Does not keep any permanent state
20
Facet Request Facet Specification sent to proxy
Functionality, funcID Other criteria such as vendor, version Resource Conditions
Memory, processing power, network conditions
Proxy identifies a suitable facet and sends it to the client matches the criteria with the shadows of the facets available Finds a facet suitable to run under specified resource
constraints
21
Facet Dependencies Facets may call upon other facets to achieve their
functionality Note: Functionalities have no dependencies
At run-time, different conditions may lead to different execution trees
p q r
x
i j k i j k
s t
A B A
Cg
fe
x
i j k p q r i j k
x ym n
A B A
FD E
IHG
22
Facet Dependencies During execution, facets which are no longer active
can be thrown
p q r
x
i j k i j k
s t
A B A
C
Execution point
Active Facet - currently running
Inactive Facet-already executed completely
Facet whichHas not yet beenBrought in/loaded
23
Containers Application-like abstraction
Interacts with the user through the UI
Provides a place to store run-time state
Provides Specifications of the root facets
Check Mail Send MessagePrint Message
Trash Message
Change Font
Facet Spec. 1
Facet Spec. 2
Facet Spec. 3
Facet Spec. 4
Facet Spec. 5
Application Functionalities
Storage Area
Pluggable UI
24
Sparkle Client System
Java Virtual Machine
Host Operating System
Facets and Containers
Client System Central Manager
LMCS
Discovery Manager
NetworkHandler
FacetCache
Facet
Resource Manager
Facet Specificatio
n
Find network entity
Location of
Proxy or Peer
SendReques
t
Facet
Migrate
Migration Informatio
nFace
t
Facet
Unload
Facet
GetInfo
Discard Facet
Proxy
Peer
ResourceInformatio
n
Loaded
Facet
Facet Loader
Load Facet
Throw Facet
25
Testbed Client System
Compaq iPAQ PocketPC H3870 CPU: 206MHz Intel StrongARM, 32-bit RISC Memory: 32MB RAM + 32MB Flash OS: Familiar Linux v0.5.2 JVM Blackdown-1.3.1-RC1
Proxy Ordinary PC
CPU: Intel Pentium II MMX 300MHz Memory: 128MB RAM OS: RedHat Linux 7.1 Web Server: Apache 1.3.19-5 PPP Deamon: ppd version 2.4.0
Serial Connection 115.200kbps
26
Timing Analysis
0
2
4
6
8
10
12
14
16
18
0 10 20 30 40 50 60 70
Facet J ar Size (KB)Ti
me
(s)
CheckCache CreateRequest GetFrNetwork CacheFacet
loadFacet CreateInstance Misc TotalTime
Timing breakdown of sending a specification to the client system and receiving an loaded facet and a ready to use instance
Range of facets sizes: JAR: 1KB to 69KB Code Size: 1KB to 500KB
Largest time consumers Getting facets from network
Transmission rate: ~ 80kbps Latency: ~ 2.3 s
Loading the received bytes into JVM and creating instance
Depends on JVM implementation & processing power
27
Effect of References We look into the effect of references on performance
Strong references Facets are never discarded Takes more memory
Soft references Discarded by GC
Weak references Discarded by GC
No references Facets in “garbage” as
soon as it is used Saves memory
Result: Not much difference
between strong and soft ref. Weak ref and no ref. have poor performance Not much difference between the different memory configurations
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
Per
cen
tag
e o
f To
tal
Req
ues
ts
StrongRef. 4MB
StrongRef.16MB
Soft Ref.4MB
Soft Ref.16MB
WeakRef. 4MB
WeakRef.
16MB
No Ref.4MB
No Ref.16MB
Already Loaded From Cache From Network
28
Effect of Caching Investigate if the number of entries of cache has an effect on
performance Soft references were used, heap size 4MB As cache size increases, less requests are directed to the network,
increasing performance
0%10%20%30%
40%50%60%70%
80%90%
100%
Perc
en
tag
e o
f To
tal
Req
uests
NoCache
2 Entry 4 Entry 8 Entry 16 Entry
Already Loaded From Cache From Network
0
50
100
150
200
250
300
350
400
Tim
e T
aken (
s)No
Cache2 Entry 4 Entry 8 Entry 16 Entry
29
Image Processing Application To illustrate the feasibility of developing a real-world
application utilizing the facet model
(1) Image Viewer
(2) Menu
(3) Image rendering
(4) Negative
(5) Sizing
33
Summary Main Requirement in Mobile Computing:
Software must be able to adapt dynamically to change and variation
Functionality Adaptation One of the most versatile adaptation techniques Makes software very dynamic
Our Solution: Dynamic Component Composition
Software is assembled at run-time
Facet Model & Sparkle System Illustrates the feasibility of dynamic component composition in a
mobile environment
34
Contributions Employing Functionality Adaptation (FA) in Pervasive
Computing
Proposed Dynamic Component Composition as a solution to achieve FA
Defined the Facet Model
Illustrated the feasibility and applicability of the facet model
35
Related Publications N. Belaramani, C.L. Wang, and F.C.M. Lau, “Dynamic
Component Composition for Functionality Adaptation in Pervasive Environments”, 9th IEEE International Workshop on Future Trends of Distributed Computing Systems (FTDCS 2003), San Juan, Puerto Rico, May 2003.
V.W.M. Kwan, F.C.M. Lau, and Cho-Li Wang, “Functionality Adaptation: A Context-Aware Service Code Adaptation for Pervasive Computing Environments,” 2003 IEEE/WIC International Conference on Web Intelligence (WI 2003), Halifax, Canada, October 2003.
36
The End
More information :
http://www.csis.hku.hk/~clwang/projects/sparkle.html