Download presentation
Presentation is loading. Please wait.
Published byManoela Covalski Prada Modified over 6 years ago
1
TRAP.NET: A Realization of Transparent Shaping in .NET
S. Masoud Sadjadi and Fernando Trigoso Good morning. The title of the that I am presenting today is TRAP.NET: A realization of transparent shaping in .NET. Transparent shaping is a model that allows to existing applications to become adaptable without manual modification to their source code, this is important to achieve separation of concerns which makes better and easier to maintain software. .NET is a Microsoft platform that offers vast pre-coded solutions, class libraries and the runtime to ease in the development of new Windows applications. New windows applications have been and are coded targeting .NET. Being Microsoft a major player in the computing industry we decided this platform was important enough to base our work on. TRAP.NET is the tool that we developed after doing research in the means of applying the transparent shaping concepts for the .NET platform. TRAP.NET is a successful implementation as it allows existing applications to become adaptable without the need to manually modify its source code. It also provides the facilities to add new behavior (by uploading new code) at startup or load time. Florida International University Miami, Florida, U.S.A.
2
TRAP.NET: A Realization of Transparent Shaping in .NET
Outline Motivation Background TRAP.NET Overview Demo Conclusion and Future Work To begin I will present the motivation for this work and the specific contributions of this thesis. Then I will provide a background of the technologies and models used to support our work. After the background section I will present TRAP.NET’s overview and inner workings to show how our contributions were achieved. After we understand TRAP.NET I will proceed to classify it according to its adaptation capabilities. Once we have understood the theory behind TRAP.NET I will provide a demonstration of its features. At the end I will provide some conclusions, recognize future work and then we can proceed to some questions and comments which can be provided at any time during the presentation. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
3
Why Dynamic Adaptation?
Pervasive computing Promises access to information: anywhere at anytime. Adaptation required to changes in the mobile/wireless environments. Critical systems Promises systems with high fault tolerance Adaptation required to respond to unanticipated faults. Grid computing Promises a dependable virtual supercomputer that solves long-running scientific applications. Adaptation required to respond to the dynamic changes in availability of distributed resources. Let’s imagine a world where software systems do not have to stop every time there is a need to adapt it to new requirements or changes in its execution environment. This ideal will be extremely beneficial to critical computing applications which can be found in pervasive, autonomic and grid computing. Pervasive computing promises availability of resources at all times, such as wireless networks which are becoming increasingly important. Autonomic computing which targets critical systems capable of self-management. And grid computing which performs computations using large-scale resources across different networks for long-time running systems, specially scientific applications which may take days or weeks to execute. All of these systems have one commonality, they cannot afford to stop all the time. New conditions arise as these systems are used and their environment changes. Therefore all of these systems need to adapt to new conditions and need to be able to receive new algorithms and data structures to replace existing functionality or to add new functionality in order to achieve its goals of uninterrupted service. Unfortunately, developing software that can be adaptable is not an easy task. Adaptability adds an extra concern to developing software. On top of developing the business logic of the application, the developer would have to also develop facilities to support adaptation. This makes software development more complex. Complexity, as we all know, if possible, should be avoided. This is were TRAP.NET comes into play. It adds this adaptability concern without manually modifying the source code of applications, which means that the business logic code is not contaminated by other factors. TRAP.NET enables the development of adaptable applications from existing ones in .NET and provides facilities to add new behavior at startup or load time. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
4
TRAP.NET: A Realization of Transparent Shaping in .NET
Background Software adaptation Compositional adaptation Transparent Shaping TRAP Related work .NET Support Runtime Reflection Attributes In the next slides I will present some background concepts used in the development of TRAP.NET. I begin describing compositional adaptation which is WHAT WE ARE TRYING TO ACHIEVE. Compositional adaptation allows the exchange of algorithms or components at runtime so a program can better fit its environment. Transparent shaping provides a model to easily achieve compositional adaptation. I conclude the background section describing the .NET facilities that we used to provide an implementation of transparent shaping in .NET Parameter adaptation: Modifies program variables to alter behavior; Does not allow new algorithms or components; Cannot adapt new strategies Compositional adaptation: Exchanges components; Allows new algorithms; Can adapt to unforeseen circumstances 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
5
Software Adaptation [6]
Parameter adaptation Modifies program variables to alter behavior Does not allow new algorithms or components Cannot adapt new strategies Compositional adaptation Exchanges components Allows new algorithms Can adapt to unforeseen circumstances 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
6
Transparent Shaping [1]
First Step Adapt-ready program produced Compile, startup or load time Interception: weaves hooks Second Step At runtime Redirection: hooks used to adapt behavior Adapt-ready program using transformation techniques, I will provide more details about these transformation techniques in the following slides. An adapt-ready program is a program whose behavior is initially equivalent to the original program except for the fact that it can be adapted at startup and/or run time. Hooks are interceptors that support insertion of removal of adaptive code. They are placed inside the program code itself, inside its supporting middleware, or inside the system platform. TRAP.NET places them inside the program code itself. Adapting behavior is implemented by intercepting and redirecting the control flow of a running program. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
7
TRAP.NET: A Realization of Transparent Shaping in .NET
Related Work TRAP/J [1] Java: offers structural reflection only Use wrapper classes and Aspect/J Can only adapt classes by sub-classing TRAP/C++ [2] C++: offers no reflection Similar implementation than TRAP/J TRAP/BPEL [3] For BPEL processes and Web Services TRAP/J and TRAP/C++ have similar implementations, TRAP/J was developed first and TRAP/C++ was developed following the same implementation of TRAP/J. TRAP/C++ was even more complicated to develop than TRAP/J since C++ does not offer reflection facilities. TRAP.NET benefits from the fact that .NET offers both structural and behavioral reflection. Also, it adapts methods which represent behavior. Classes do not represent behavior, they represent objects. In compositional adaptation we want to change the behavior of already existing objects. There is no generation of wrapper classes, only generation of small pieces of code required to support adaptation inside adapt-ready methods 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
8
TRAP.NET: A Realization of Transparent Shaping in .NET
Background Compositional Adaptation Transparent Shaping TRAP Related work .NET Support Runtime Reflection Attributes Compositional adaptation is what we are trying to achieve. Transparent shaping provides a solution to develop adaptable applications transparently. Now, we will discuss the infrastructure used to support the development of TRAP.NET. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
9
TRAP.NET: A Realization of Transparent Shaping in .NET
CIL, CLR and TRAP.NET [4] TRAP.NET works with CIL for language independence Source code cycle from higher level language to machine code. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
10
.NET Reflection and Attributes
Metadata is data about the program .NET Reflection Encapsulates metadata Structural and behavioral reflection CIL and Metadata bundled together In module or assembly file TRAP.NET uses both Attributes to label adapt-ready methods When a .NET compiler produces code in CIL, it also produces the corresponding metadata. Metadata is “data about data;” in the programming context is data about the program. .NET Reflection is the component that provides class libraries to access the metadata of .NET applications. .NET Reflection is a component that provides classes that encapsulate information or data about the implementation of an application. Therefore, it contains classes to describe assemblies, modules, types, members, etc. of an application. CIL and Metadata bundled together, next slide will better illustrate this concept. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
11
TRAP.NET: A Realization of Transparent Shaping in .NET
Outline Motivation Background TRAP.NET Overview Demo Conclusion and Future Work So far I have talked about the motivation of this work, the contributions of this thesis and the background. A couple of things to remember before we move forward is that we are trying to provide compositional adaptation to existing applications following the transparent shaping model. In our case, the transparent shaping model is implemented in .NET using: the intermediate language support for language independence, the reflection facilities to discover structure and modify behavior of applications and attributes to label functionality that can be adaptable. Now I will describe TRAP.NET. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
12
TRAP.NET: A Realization of Transparent Shaping in .NET
Step 1: Generation of an adapt-ready application Step 2: Static and Dynamic adaptation Static adaptation Algorithmic decision delayed until load time According to deployed environment Dynamic adaptation Components can be replaced during run time No need to halt or restart application Following the transparent shaping approach, TRAP.NET provides adaptation without manually modifying the source code of the application. Moreover, it implements the two-step approach proposed by the transparent shaping model to achieve dynamic adaptation. The first step happens at compile, startup or load time; while the second step occurs at run time. I start this section describing the first step, then I will move on to the second step. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
13
TRAP.NET: A Realization of Transparent Shaping in .NET
Step 1 Generation of adapt-ready applications Staging using attributes Generation process Intersection and redirection of control flow We just described the process of generating adapt-ready applications, now we will describe how static and dynamic adaptation is achieved at runtime. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
14
TRAP.NET: A Realization of Transparent Shaping in .NET
This slide shows the steps required to adapt an application using TRAP.NET. It also shows how our contributions fit in the big schema of things. [It was Dr. Clarke’s idea to have this flowchart so people always know where they are]. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
15
TRAP.NET: A Realization of Transparent Shaping in .NET
Staging Development time Reference to TRAP.NET class library TRAP.NET and application unified at compile time To successfully compile the application with the new adapt-ready attribute, the user needs to add a reference to the TRAP.NET class library. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
16
TRAP.NET: A Realization of Transparent Shaping in .NET
This slide shows the steps required to adapt an application using TRAP.NET. It also shows how our contributions fit in the big schema of things. [It was Dr. Clarke’s idea to have this flowchart so people always know where they are]. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
17
TRAP.NET: A Realization of Transparent Shaping in .NET
Generation Process TRAP.NET Generator 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
18
Adapt-Ready Method Generation
Original implementation wrapped in an if-then-else statement Interception Redirection If the method is adapted (interception), that means that new functionality has been received, then we invoke the dynamic method of that new functionality (redirection), the dynamic method is a component provided by .NET Reflection and allows creation of method on the fly without the need of creating a dynamic class. If the method is not adapted, then 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
19
TRAP.NET: A Realization of Transparent Shaping in .NET
This slide shows the steps required to adapt an application using TRAP.NET. It also shows how our contributions fit in the big schema of things. [It was Dr. Clarke’s idea to have this flowchart so people always know where they are]. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
20
TRAP.NET: A Realization of Transparent Shaping in .NET
Step 2 Static and Dynamic adaptation Composer Dynamic method generation Member Access with Reference Redirection Static adaptation We just described the process of generating adapt-ready applications, now we will describe how static and dynamic adaptation is achieved at runtime. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
21
TRAP.NET: A Realization of Transparent Shaping in .NET
Composer TRAP.NET hosts the server composer Opens communication channel The client composer can be exposed as .NET Remoting Server – Windows Applications HTTP Server – Web Application 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
22
TRAP.NET: A Realization of Transparent Shaping in .NET
Composer Delegate: method to replace adapt-ready method User uploads delegate assembly through Composer Dynamic method created from delegate method TRAP.NET stores dynamic methods Delegate Dynamic Method 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
23
Dynamic Method Generation
Dynamic method can be executed at runtime Initialized with elements and contents of delegate method Replicates functionality of delegate method Delegate Method Dynamic Method Parameter Types Parameter Types Return Type Return Type Dynamic method is empty at the beginning, then it gets initialized with the same elements and contents of the delegate method using reflection. At this time, assuming no external references, the dynamic method is ready for invocation. Local Variables Types Local Variables Types IL Contents IL Contents 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
24
TRAP.NET: A Realization of Transparent Shaping in .NET
Member Access Delegate Assembly Running Application Delegate Method Dynamic Method IL Contents IL Contents Some Field Some Method New functionality may have external references Delegate assembly is not being executed References not in execution context of running application 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
25
Reference Redirection
Delegate Assembly Running Application Delegate Method Dynamic Method IL Contents IL Contents 1 4 2 3 Some Field Some Method Some Field Some Method Find references with Token Parser: opens up and parses contents of delegate method looking for offset token with are reference identifiers, using those we locate members Locate member to get their metadata to find the member with the same exact signature in the running applications Once we have the metadata, we can search the running application for the corresponding member Once the corresponding members have been found, we can replace the references. The references are replaced by changing the byte contents in the dynamic method so the offsets are now pointing to members inside the running application. Find references with Token Parser Resolve delegate members to obtain their metadata Locate corresponding members in running application Replace references 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
26
TRAP.NET: A Realization of Transparent Shaping in .NET
Static Adaptation Static adaptation reuses mechanism to achieve dynamic adaptation At load time Adapted functionality is not allowed to be re-adapted or rolled back 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
27
TRAP.NET: A Realization of Transparent Shaping in .NET
Outline Motivation Background TRAP.NET Overview Demo Conclusions and Future Work 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
28
TRAP.NET: A Realization of Transparent Shaping in .NET
Summary Attribute-based approach Enabled unification of the adapt-ready application and server composer Avoided using another UI for the Generator Adheres to .NET development practices Used to carry extra metadata information Generator Adds adaptive code in CIL Enables language independence No UI required Visual Studios add-in Composer Enables mutable and reconfigurable software Member access through reference redirection Delegate can reuse existing functionality User can monitor status, upload new code and adapt running application Using Windows application or Web interface This slide shows the steps required to adapt an application using TRAP.NET. It also shows how our contributions fit in the big schema of things. [It was Dr. Clarke’s idea to have this flowchart so people always know where they are]. Items in yellow are the contributions. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
29
TRAP.NET: A Realization of Transparent Shaping in .NET
Future Work Access to new members in delegate assembly Applying TRAP.NET to Grid Computing Safe adaptation and security Dependency analysis Side effects analysis Restriction on the power that TRAP.NET provides Restriction on the power of dynamic adaptation is also a possible area for future work. TRAP.NET enables mutable software which is known to be generally unstable when new functionality that has not been properly tested is used. Even testing of this new functionality is rather difficult. Future research should use TRAP.NET to discover how to restrict the power of dynamic adaptation. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
30
TRAP.NET: A Realization of Transparent Shaping in .NET
Acknowledgements Peers who contributed in the development phase of this work Allen Lee, Tuan Cameron, Ana Rodriguez, Juan H. Cifuentes, Javier Ocasio, Amit Patel, Mitul Patel, Enrique E. Villa, Frank Suero, Etnan Gonzalez, Edwin Garcia, Alain Rodriguez, and Lazaro Millo. This work was supported in part by IBM, the National Science Foundation (grants OCI , REU , and HRD ). Before I start I would like to thank my peers who contributed in this work. Most of the students mentioned in this slide helped with software engineering projects where a solution was already provided to them. Also, some contributed in earlier versions of the tool which did not achieve its objectives but whose preliminary work was important to the current version of TRAP.NET. Juan Cifuentes had good ideas which are implemented in the current version. The current version was researched and developed from scratch utilizing better tools, a better research approach and taking advantage of the .NET 2.0 facilities (attributes, reflection, ILDASM, ILASM). I will explain this concepts in the following slides. My specific contributions will be presented in a couple more slides. [sms]: You need to briefly thank your colleagues who worked on TRAP.NET before you and those who supported you during the time you were working on your thesis. You do not need to read their names though. Also, make the point clear the their contribution were mainly on the implementation side, except for some who also contributed in the ideas. Also, you should mention that you will clearly mention my contribution in a later slide. 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
31
TRAP.NET: A Realization of Transparent Shaping in .NET
References [1] S. Masoud Sadjadi. Transparent Shaping of Existing Software to Support Pervasive and Autonomic Computing. A Dissertation submitted to Michigan State University, 2004. [2] Scott D. Fleming, Betty H.C. Cheng, R. E. Kurt Stirewalt and Philip K. McKinley. An Approach to Implementing Dynamic Adaptation in C++. In Proceedings of the 2005 workshop on Design and evolution of autonomic application software, 2005. [3] Onyeka Ezenwoye and S. Masoud Sadjadi. TRAP/BPEL: A framework for dynamic adaptation of composite services. In Proceedings of the International Conference on Web Information Systems and Technologies (WEBIST 2007), Barcelona, Spain, March (in press). [4] Common Language Infrastructure. Wikipedia. 21 December Available at URL: Infrastructure.png. [5] Serge Lidin. Expert .NET 2.0 IL Assembler. Apress. 2006, page 6. [6] Philip K. McKinley, S. Masoud Sadjadi, Eric P. Kasten and Betty H.C. Chen. Composing Adaptive Software. Computer. July 2004, pages 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
32
TRAP.NET: A Realization of Transparent Shaping in .NET
Questions/Comments Contact Information: S. Masoud Sadjadi Autonomic Computing Research Lab. (ACRL) School of Computing and Information Sciences (SCIS) Florida International University (FIU) TRAP.NET and other Transparent Shaping tools can be downloaded from 12/4/2018 TRAP.NET: A Realization of Transparent Shaping in .NET
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.