Towards Self-Adaptive Software Dipl.-Inf. Andreas Rasche Hasso-Plattner-Institute University of Potsdam.

Slides:



Advertisements
Similar presentations
Network II.5 simulator ..
Advertisements

Architecture-based Evolution of Software Systems José Luiz Fiadeiro Architecture-based Evolution of Software Systems Luís Andrade João Gouveia Georgios.
Performance Testing - Kanwalpreet Singh.
A LEGO-like Lightweight Component Architecture for Organic Computing Thomas Schöbel-Theuer, Universität Stuttgart
Building Secure Distributed Systems The CIF model : Component Information Flow Lilia Sfaxi DCS Days - 26/03/2009.
Packet Switching COM1337/3501 Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter 3.
A Component Based Programming Framework for Autonomic Applications Hua Liu, Manish Parashar, and Salim Hariri ICAC ‘04 John Otto Wi06 CS 395/495 Autonomic.
PAGIS: An Architecture for Programming on the Grid Andrew Wendelborn Distributed & High Performance Computing Group Department of Computer Science, University.
1 Towards Pervasive Connectivity in Mobile Computing Frank Siegemund European Microsoft Innovation Center November 2006.
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
AP 04/03 Dynamic (Re-) Configuration as Safeguard Mechanism in dynamically changing environments DCL Distributed Control Lab™ at HPI.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Technical Architectures
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Introduction To System Analysis and Design
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Software Frameworks for Acquisition and Control European PhD – 2009 Horácio Fernandes.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
© Copyright Eliyahu Brutman Programming Techniques Course.
Dynamic Reconfiguration of Component-based Real-time Software Words February 2005 Sedona, Arizona, USA Andreas Rasche, Andreas Polze and Martin.
An Introduction to Software Visualization Dr. Jonathan I. Maletic Software DevelopMent Laboratory Department of Computer Science Kent State University.
Page 1 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Chapter 4 Component Models and Technology.
The middleware that makes real time integration a reality.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
1 FM Overview of Adaptation. 2 FM RAPIDware: Component-Based Design of Adaptive and Dependable Middleware Project Investigators: Philip McKinley, Kurt.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
VIRTUALISATION OF HADOOP CLUSTERS Dr G Sudha Sadasivam Assistant Professor Department of CSE PSGCT.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
A Simplified Approach to Web Service Development Peter Kelly Paul Coddington Andrew Wendelborn.
1 Secure Distributed Objects for Grid Applications Laurent Baduel, Arnaud Contes, Denis Caromel OASIS team ProActive
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
INSTALLING MICROSOFT EXCHANGE SERVER 2003 CLUSTERS AND FRONT-END AND BACK ‑ END SERVERS Chapter 4.
A Lightweight Platform for Integration of Resource Limited Devices into Pervasive Grids Stavros Isaiadis and Vladimir Getov University of Westminster
Active Monitoring in GRID environments using Mobile Agent technology Orazio Tomarchio Andrea Calvagna Dipartimento di Ingegneria Informatica e delle Telecomunicazioni.
Introduction to MDA (Model Driven Architecture) CYT.
Supporting Heterogeneous Users in Collaborative Virtual Environments using AOP CoopIS 2001 September 5-7, Trento, Italy M. Pinto, M. Amor, L. Fuentes,
Magnetic Field Measurement System as Part of a Software Family Jerzy M. Nogiec Joe DiMarco Fermilab.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
JavaBeans Components. To understand JavaBeans…  Proficient experience with the Java language required  Knowledge of classes and interfaces  Object-Oriented.
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
Information Management NTU Interprocess Communication and Middleware.
Introduction To System Analysis and Design
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
Chapter 14 Part II: Architectural Adaptation BY: AARON MCKAY.
Selected Topics in Software Engineering - Distributed Software Development.
Exploiting Partially Reconfigurable FPGAs for Situation-Based Reconfiguration in Wireless Sensor Networks Rafael Garcia, Dr. Ann Gordon-Ross, Dr. Alan.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Performance evaluation of component-based software systems Seminar of Component Engineering course Rofideh hadighi 7 Jan 2010.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Tuscany: a SOA framework Jeffrey Guo Accelrys, Inc.
Transparent Mobility of Distributed Objects using.NET Cristóbal Costa, Nour Ali, Carlos Millan, Jose A. Carsí 4th International Conference in Central Europe.
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © 2006 GridCOMP Grids Programming with components. An.
Introducing Allors Applications, Tools & Platform.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
End-to-End Efficiency (E 3 ) Integrating Project of the EC 7 th Framework Programme General View of the E3 Prototyping Environment for Cognitive and Self-x.
ProActive components and legacy code Matthieu MOREL.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
SelfCon Foil no 1 Variability in Self-Adaptive Systems.
Survey of Tools to Support Safe Adaptation with Validation Alain Esteva-Ramirez School of Computing and Information Sciences Florida International University.
Lorenz: Visitor Beans: An Aspect-Oriented Pattern Aspect-oriented pattern: describes a solution to a tangling problem in a particular context.
.NET Mobile Application Development XML Web Services.
UML (Unified Modeling Language)
Software, IEE Proceedings, Vol.152, Num.3, June 2005,Page(s): Prasanthi.S March, Java-based component framework for dynamic reconfiguration.
Object-Oriented Analysis and Design
OO Methodology OO Architecture.
Chapter 7 –Implementation Issues
Design Yaodong Bi.
Presentation transcript:

Towards Self-Adaptive Software Dipl.-Inf. Andreas Rasche Hasso-Plattner-Institute University of Potsdam

Outline Why Self-Adaptive Software ? Approaches for Adaptive Software – A History Development of adaptive applications using Adapt.Net  Basic Building Blocks  Dynamic Reconfiguration Algorithms  Runtime State Transfer: Migration & Updates  On-demand deployment  Tool Support for application creation

The term adaptation Adaptation - “the process of adapting to something (such as environmental conditions)”  Origin: L. Adaptare = to fit Adaptive – “possessing an ability to change to suit different conditions” Self-Adaptive – Automatic Adaptation without manual intervention

Dynamic World needs Adaptation Mobility  Location Awareness  Power Awareness, Battery Life CPU frequency scaling  Changing Communication Network Properties  Offline-/Online Computation  Display Complexity  Reaction to failures

Variety of Communication Networks & Dynamically Changing Properties GSM, UMTS, WLAN, Bluetooth, Satellite Communication, IrDA Quality of Service Parameter depend on  Geographic Position, Environmental conditions (reflection, distance to base station, countryside)  Moving users (Doppler Effect)  Utilisation (number of users / cell)

Adaptation: How to integrate ? Hard-wired integration into the application  Problem: Application concurrency Application Transparent Adaptation: CODA  Legacy applications run unmodified Application Aware: Collaboration of application and operating system/middleware [Noble et. al. 97]

Adaptivity: Quality Measurements Agility: Speed and accuracy of detection and reaction to changes in resource availability  Resource demand different agility: Network Bandwidth vs. Battery Power Fidelity: Application Data Quality delivered to users compared to maximum available  Video data: frame rate, image quality of frames  Spatial data (topografical maps) : resolution, feature size  Adaptivity: Trade-offs among fidelity dimensions

Adaptation: Building Blocks Observation Monitoring React on Changes Environment - Network, CPU, Battery Component properties Component behavior Reconfiguration Parameter Architecture Data Profiles - Map Conditions to According Configurations Adaptation

Adaptive Control Systems 50s – 60s : Gain scheduling controller Self-adjustment of controller parameters Open-loop adaptation scheme [Sastry and Bodson “Adaptive Control: Stability, Convergence, and Robustness”, 1994]

Adaptive Control Systems cont. Closed-loop adaptation Self-tuning controller (Kalman `58) [Sastry and Bodson “Adaptive Control: Stability, Convergence, and Robustness”, 1994]

The Adapt.Net Framework Dynamic reconfiguration of component-based applications Runtime Deployment Tool-support for building self-adaptive applications Building alternative configurations: architectural patterns Runtime Updates and Migration Monitoring infrastructure: environmental properties, component parameter, component state Choosing configrations: Adaptation Profiles

Application Model Based on a work of J. Magee, J. Kramer, M. Wermelinger Components: Interconnected computational entities  Provide interfaces : in-ports  Require other components: out-ports Components connected by connectors No cycles in application topology graph A transaction virtually combines a number of bidirectional interactions between components  completes in bounded time  Initiator is informed about completion A transaction T1 is dependent on a subsequent transaction T2 (T1/T2) if its completion depends on the completion of this transaction

XML-Based Configuration Description “A Configuration of a component-based application denotes the set of its parameterized components and the connections among them.” Configuration Description:  List of components  Component attributes  Component ports  Connectors

Configuration Infrastructure Configuration Manager XML- Configuration Description IConfigure Monitoring Adaptation Profile Adaptation Engine

Reconfiguration Algorithm 1. Loading of new components 2. Bringing application into reconfigurable state Application consistency must be preserved during reconfiguration Blocking all connections: Wait for all on-going transactions to complete; don’t allow initialization of new ones Blocking must be ordered due to dependent transactions 3. Transferring state of migrated/updated components 4. Setting changed component parameters 5. Reconnecting components (create connectors) 6. Restarting component processing 7. Removing old components

Dynamic Reconfiguration A B C compression=30 A D C B Configuration 1 Configuration 2

Dynamic Reconfiguration A B C compression=30 Configuration Manager Configuration 2 XML- Description 1 D 2 Create new Component 3 Calculate Connections to block Read

Dynamic Reconfiguration A B Configuration Manager Configuration 2 XML- Description 1 D Read C compression=30

Dynamic Reconfiguration A B Configuration Manager Configuration 2 XML- Description 1 D Read C compression=30 Block Connection 4 5 Block new connections Wait for on-going to complete 6 Reconfigurable State

Dynamic Reconfiguration A B Configuration Manager Configuration 2 XML- Description 1 D Read C compression=30 7 Reconnect A 7 Connect D

Dynamic Reconfiguration A B Configuration Manager Configuration 2 XML- Description 1 D Read C compression=30 8 Restart processing

Blocking a Connection Component Code calls  TransactionBegin: If(blocked) Wait(block_semaphore); processing=true; Wait(proc_semaphore);  TransactionEnd: processing=false; Release(proc_semaphore) Configuration interface  BlockConnection blocked=true; Wait(block_semaphore) if(processing) Wait(proc_semaphore) Release(proc_semaphore)  Start of Configuration interface blocked=false; Release(block_semaphore); int a = 3; int b = 5; Transaction.Begin(); b = calc.Add(1,b); a = calc.Sub(a,b); Transaction.End();

Configurable Components Each component has to implement a configuration hook IConfigure:  Start component processing  Block connections  Set properties  Connect/disconnect out-going ports  Initialization / Finalization Implementation for IConfigure can be generated  Integrated into graphical development tool of Adapt.Net

Configurable Components + AOP Aspect-Oriented Programming (AOP) Separation of Concerns Component configuration is a separate concern Usage of Loom.Net static aspect weaver Based on Communation between functional component and configurtion code via.NET Reflection

public class ConfiguredFilter:Filter,IConfigure { void SetProperty(string name, string val){ cval = Convert(val); this.GetField(name).SetValue(cval) } void Connect(string port, obj target){ this.GetField(port).SetValue(obj); } void BlockConnection(string conn){ mutex.Aquire(); } void StartProcessing(){ mutex.Release(); } Configurable Components public class Filter{ [AdaptNet.Property] int compression; [AdaptNet.Connection] IViewer viewer; public void Send(byte[] data) { Transaction.Begin(viewer); viewer.Send(data); Transaction.End(viewer); }

Configurable Components Loom.Net Aspect Code using AdaptNet; [Serializable] class Configurable/*[CLASSNAME]*/:/*[CLASSNAME]*/, IConfigure {... public bool SetProperty(string name, string attvalue) { FieldInfo _field = this.GetType().GetField(name); _field.SetValue(this,Convert.ChangeType(attvalue, GetFieldofThis(name).FieldType,null)); return true; }... }

Configuration Annotations public class Counter : MarshalByRefObject { [Property] // Configuration Hook private long step; private long count = 0; // State public void Reset() { count = 0; } public void Increase() { count += step; } public long GetCount() { return count; } public class CounterClient { [Connection] private Counter counter = null; public void Main() { while(true) { Transaction.Begin("counter"); counter.Increase(); Console.WriteLine("Counter Value :" + counter.GetCount()); Transaction.End("counter"); Thread.Sleep(1000); }

CoFRA Infrastructure

Component Type Loaders Component configurators hide implementation details of component instances during runtime Available Component Type Loaders manage components life cycle : loading, initialization, deletion, finalization Existing Component Type Loaders and component start  Simple Object Created using new language construct .NET Remoting Object Registration of Remote Service  Process Component Type CreateProcess and Registration of Management Service Interface  Java-based CORBA Object Initialization of CORBA runtime, object creation and registration

Connector Architecture Connector between components exchangeable during runtime Connector establishment implemented in IConfigure.Connect method.NET Remoting Connector .NET-.NET Local Call Connector  Between simple Objects IIOP Connector  CORBA -.NET and CORBA-CORBA Planned connector patterns:  Tupelspace connector for online/offline configurations  Webservice connector to integrate available functionality  Gridservice connector to exploit available computing grids

The Component Configurator - abstracting away CORBA, Java, and.NET

Adaptation Profiles

Architectural Patterns for Adaptive Applications Voter Pattern  Compare output of 3 objects supporting the same interface Safe update pattern  Update a running object to a new version Load balancer pattern Migration pattern  Migrate an object from one host to another Filter, Compression, Encryption Pattern Simplex Pattern  Used in Foucault’s Pendulum

Grafical Support for Pattern Integration

Pendulum Experiment Control Configurations USB-Driver Event Queuing Safety Controller User Program Event Duplicator User Program Configuration 1 : safety controller Configuration 2 : user program (cold standby) Configuration 3 : user program (warm standby) USB Safety Controller Safety Controller

Reconfiguration and State

Reconfiguration and State - Overview

Component Updates: An Algorithm Bring components into reconfigurable state Traversal of whole object graph Member-wise investigation of nodes using Reflection Investigation of each node for update Update specified via assembly mapping:  Specification of updated assemblies State transfer via member-wise close

Component State Transfer - I class People { public string Name; public People[] friends; public IAnimal animal; } enum Color{gray, black, white}; class Animal { string name; Color color; People[] likes; } People[ ] People1 People2 people3 People „Andre“ friends animal People „Christiane“ friends animal People „Torsten“ friends animal Animal „Wuffi“ Color:black likes Animal „Blacki“ Color:black likes root

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 People root

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal.dll V 1.0: Animal.dll V 2.0 No Update here

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 friends „Torsten“ animal object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); }

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 animal Animal animal

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 Animal V2

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 Animal V2 „Blacki“ Color:black „Blacki“

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal Animal „Blacki“ Color:black likes root Animal > Animal1.dll V 2.0 Animal V2 Color:black likes „Blacki“ Color:black

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal root Animal > Animal1.dll V 2.0 Animal V2 Animal „Blacki“ Color:black likes Color:black „Blacki“ Color:black likes GC People root

Component Update State Transfer - II object UpdateObjectGraph(object node, Type type, Hashtable updateMapping) { Type newType = GetUpdate(type,updateMapping); if(newType!=null) object updatedNode = FormatterServices.GetUninitializedObject(newType); foreach(FieldInfo _field in type.GetFields()) { if(LeafNode(_field.GetValue(node),_field.GetValue(node).GetType()) { if(updatedNode!=null) _updatedField.SetValue(updatedNode,_field.GetValue(node)); } else if(updatedNode!=null) { _updatedField.SetValue(updatedNode,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } else { _field.SetValue(node,UpdateObjectGraph(_field.GetValue(node),_field.GetValue(node).GetType())); } People „Torsten“ friends animal root Animal > Animal1.dll V 2.0 Animal V2 Animal „Blacki“ Color:black likes Color:black „Blacki“ Color:black likes GC Running in new version now

Component Update State Transfer III Cycle recognition – visited nodes: bool firstTime; long id = idGenerator.GetId(node,out firstTime); if(!firstTime) return visitedNodes[id]; Save updated nodes in visited nodes list Investigation of all arrays  Traverse all reference type members  Create new version in case of base-type update  Copy content of updated arrays

Component Update: Delegates Funtion pointers in.NET Traverse all targets of delegates Multicast delegates contain multiple delegates Updating multicast delegates:  Extract all delegates from multicast delegate  Create new versions: Delegate.CreateDelegate  Combine to new multicast delegate public abstract class Delegate { private System.Type target_type; private object m_target; private string method_name; private int method_ptr; }