Here Is a Review Version of the Book for You to Check Out

Total Page:16

File Type:pdf, Size:1020Kb

Here Is a Review Version of the Book for You to Check Out modified 2:50 PM 25 June 2004 Cover.fm <version 1.0> 2 2nd REVIEW DRAFT 25 June 2004 (c) 2003 Kircher, Völter, Zdun FOR REVIEW ONLY PLEASE DO NOT DISTRIBUTE THE PDF ANY FURTHER modified 2:50 PM 25 June 2004 Cover.fm <version 1.0> 1 Table of Contents 1 Series Foreword.........................................................................5 2 Foreword ....................................................................................7 3 Preface ......................................................................................11 3.1 How to Read this Book .........................................................11 3.2 Goals of the Book..................................................................13 3.3 About the Authors .................................................................14 3.4 Acknowledgements ...............................................................16 3.5 Patterns and Pattern Languages.............................................17 3.6 Our Pattern Form...................................................................22 3.7 Key to the Illustrations ..........................................................25 4 Introduction To Distributed Systems ....................................29 4.1 Distributed Systems: Reasons and Challenges......................29 4.2 Communication Middleware.................................................35 4.3 Remoting Styles ....................................................................37 5 Pattern Language Overview...................................................49 5.1 Overview of the Pattern Chapters..........................................57 6 Basic Remoting Patterns.........................................................65 6.1 Interactions among the Patterns.............................................97 7 Identification Patterns...........................................................103 7.1 Interactions among the Patterns...........................................115 8 Lifecycle Management Patterns...........................................117 8.1 Basic Lifecycle Patterns ......................................................118 8.2 General Resource Management Patterns.............................129 8.3 Interactions among the Patterns...........................................142 modified 2:49 PM 25 June 2004 RemotingTOC.fm <version 1.0> 2 9 Extension Patterns ................................................................ 157 9.1 Interactions among the Patterns .......................................... 171 10 Extended Infrastructure Patterns ....................................... 175 10.1 Interactions among the Patterns .......................................... 193 11 Invocation Asynchrony Patterns ......................................... 197 11.1 Interactions among the Patterns .......................................... 216 11.2 Related Patterns: Invocation Asynchrony........................... 229 12 Related Concepts, Technologies, and Patterns................... 231 12.1 Related Patterns .................................................................. 232 12.2 Distribution Infrastructures................................................. 236 12.3 Quality Attributes................................................................ 246 12.4 Aspect-Orientation and Remoting ...................................... 251 13 Technology Projections ........................................................ 253 14 ....................................................................................................... .NET Remoting Technology Projection255 14.1 Brief History of .NET Remoting ........................................ 255 14.2 .NET Concepts - A Brief Introduction................................ 256 14.3 Pattern Map......................................................................... 258 14.4 An Simple .NET Remoting Example.................................. 259 14.5 Remoting Boundaries.......................................................... 264 14.6 Basic Internals..................................................................... 266 14.7 Error Handling .................................................................... 267 14.8 Server-Activated Instances ................................................. 268 14.9 Client-Dependent Instances and Leasing............................ 276 14.10 More Advanced Lifecycle Management............................. 283 14.11 Internals of .NET Remoting................................................ 285 modified 2:49 PM 25 June 2004 RemotingTOC.fm <version 1.0> 3 14.12 Extensibility of .NET Remoting..........................................289 14.13 Asynchronous Communication ...........................................296 14.14 Outlook to the Next Generation ..........................................302 15 Web Services Technology Projection...................................305 15.1 Brief History of Web Services ............................................305 15.2 Pattern Map .........................................................................310 15.3 SOAP Messages ..................................................................310 15.4 Message Processing.............................................................320 15.5 Protocol Integration.............................................................328 15.6 Marshalling using SOAP XML Encoding...........................330 15.7 Lifecycle Management ........................................................333 15.8 Client-Side Asynchrony ......................................................335 15.9 Web Services and QoS ........................................................340 15.10 Web Service Security ..........................................................342 15.11 Lookup of Web Services: UDDI .........................................343 15.12 Other Web Service Frameworks .........................................345 15.13 Consequences of the Pattern Variants Used in Web Services354 16 CORBA Technology Projection ...........................................357 16.1 Brief History of CORBA.....................................................357 16.2 Pattern Map .........................................................................359 16.3 Initial Example ....................................................................360 16.4 CORBA Basics....................................................................362 16.5 Messaging............................................................................382 16.6 Real-Time CORBA .............................................................387 17 Appendix ................................................................................395 17.1 Appendix A: Building Blocks for Component Infrastructures395 17.2 Appendix B: Extending AOP Frameworks for Remoting...399 modified 2:49 PM 25 June 2004 RemotingTOC.fm <version 1.0> 4 18 References.............................................................................. 407 modified 2:49 PM 25 June 2004 RemotingTOC.fm <version 1.0> 2 Series Foreword Series Foreword modified 2:49 PM 25 June 2004 ForewordFrankBuschmann.fm <version 1.0> 6 Series Foreword modified 2:49 PM 25 June 2004 ForewordFrankBuschmann.fm <version 1.0> 3 Foreword Foreword Many of today’s enterprise computing systems are powered by distrib- uted object middleware. Such systems, which are common in industries such as telecommunications, finance, manufacturing, and government, often support applications that are critical to particular business operations. Because of this, distributed object middleware is often held to stringent performance, reliability, and availability requirements. Fortunately, modern approaches have no problem meeting or exceeding these requirements. Today, successful distrib- uted object systems are essentially taken for granted. There was a time, however, when making such claims about the possi- bilities of distributed objects would have met with disbelief and derision. In their early days, distributed object approaches were often viewed as mere academic fluff with no practical utility. Fortunately, the creators of visionary distributed object systems such as Eden, Argus, Emerald, COMANDOS, and others were undeterred by such opinion. Despite the fact that the experimental distributed object systems of the 1980s were generally impractical — too big, too slow, or based on features available only from particular specialized platforms or programming languages — the exploration and experimentation required to put them together collectively paved the way for the prac- tical distributed objects systems that followed. The 1990s saw the rise of several commercially successful and popular distributed object approaches, notably the Common Object Request Broker Architecture (CORBA) promoted by the Object Management Group (OMG) and Microsoft’s Common Object Model (COM). CORBA was specifically designed to address the inherent heterogeneity of busi- ness computing networks, where mixtures of machine types, operating systems, programming languages, and application styles are the norm and must coexist and cooperate. COM, on the other hand, was built specifically to support component-oriented applications running on the Microsoft Windows operating system. Today, COM has been modified 2:49 PM 25 June 2004 ForewordSteveVinoski.fm <version 1.0> 8 Foreword largely subsumed by its successor, .NET, while CORBA remains in wide use as a well-proven architecture for building and deploying significant enterprise-scale heterogeneous systems, as well as real-time and embedded systems. As
Recommended publications
  • Advanced-Java.Pdf
    Advanced java i Advanced java Advanced java ii Contents 1 How to create and destroy objects 1 1.1 Introduction......................................................1 1.2 Instance Construction.................................................1 1.2.1 Implicit (Generated) Constructor.......................................1 1.2.2 Constructors without Arguments.......................................1 1.2.3 Constructors with Arguments........................................2 1.2.4 Initialization Blocks.............................................2 1.2.5 Construction guarantee............................................3 1.2.6 Visibility...................................................4 1.2.7 Garbage collection..............................................4 1.2.8 Finalizers...................................................5 1.3 Static initialization..................................................5 1.4 Construction Patterns.................................................5 1.4.1 Singleton...................................................6 1.4.2 Utility/Helper Class.............................................7 1.4.3 Factory....................................................7 1.4.4 Dependency Injection............................................8 1.5 Download the Source Code..............................................9 1.6 What’s next......................................................9 2 Using methods common to all objects 10 2.1 Introduction...................................................... 10 2.2 Methods equals and hashCode...........................................
    [Show full text]
  • Plugin Tapestry ​
    PlugIn Tapestry ​ Autor @picodotdev https://picodotdev.github.io/blog-bitix/ 2019 1.4.2 5.4 A tod@s l@s programador@s que en su trabajo no pueden usar el framework, librería o lenguaje que quisieran. Y a las que se divierten programando y aprendiendo hasta altas horas de la madrugada. Non gogoa, han zangoa Hecho con un esfuerzo en tiempo considerable con una buena cantidad de software libre y más ilusión en una región llamada Euskadi. PlugIn Tapestry: Desarrollo de aplicaciones y páginas web con Apache Tapestry @picodotdev 2014 - 2019 2 Prefacio Empecé El blog de pico.dev y unos años más tarde Blog Bitix con el objetivo de poder aprender y compartir el conocimiento de muchas cosas que me interesaban desde la programación y el software libre hasta análisis de los productos tecnológicos que caen en mis manos. Las del ámbito de la programación creo que usándolas pueden resolver en muchos casos los problemas típicos de las aplicaciones web y que encuentro en el día a día en mi trabajo como desarrollador. Sin embargo, por distintas circunstancias ya sean propias del cliente, la empresa o las personas es habitual que solo me sirvan meramente como satisfacción de adquirir conocimientos. Hasta el día de hoy una de ellas es el tema del que trata este libro, Apache Tapestry. Para escribir en el blog solo dependo de mí y de ninguna otra circunstancia salvo mi tiempo personal, es com- pletamente mío con lo que puedo hacer lo que quiera con él y no tengo ninguna limitación para escribir y usar cualquier herramienta, aunque en un principio solo sea para hacer un ejemplo muy sencillo, en el momento que llegue la oportunidad quizá me sirva para aplicarlo a un proyecto real.
    [Show full text]
  • An Easy-To-Use Toolkit for Efficient Java Bytecode Translators
    An Easy-to-Use Toolkit for Efficient Java Bytecode Translators Shigeru Chiba Muga Nishizawa Dept. of Mathematical and Computing Sciences Tokyo Institute of Technology Email: {chiba,muga}@csg.is.titech.ac.jp Abstract. This paper presents our toolkit for developing a Java-bytecode translator. Bytecode translation is getting important in various domains such as generative programming and aspect-oriented programming. To help the users easily develop a translator, the design of our toolkit is based on the reflective architecture. However, the previous implementa- tions of this architecture involved serious runtime penalties. To address this problem, our toolkit uses a custom compiler so that the runtime penalties are minimized. Since the previous version of our toolkit named Javassist has been presented in another paper, this paper focuses on this new compiler support for performance improvement. This feature was not included in the previous version. 1 Introduction Since program translators are key components of generative programming [5], a number of translator toolkits have been developed. For the Java language, some toolkits like EPP [9] and OpenJava [18] allow developers to manipulate a parse tree or an abstract syntax tree for source-level translation. Other toolkits, such as BCEL [6], JMangler [13], and DataScript [1], allow manipulating a class file, which is a compiled binary, for bytecode-level translation. The ease of use and the power of expressiveness are design goals of these toolkits. The latter goal means what kinds of translation are enabled. The former goal is often sacrificed for the latter one. The bytecode-level translation has two advantages against the source-level translation.
    [Show full text]
  • Aspect-Oriented Programming
    Beyond OOP Advanced Separation of Concerns Metaprogramming Reflection Aspect-Oriented Programming Eric Tanter DCC/CWR University of Chile [email protected] Éric Tanter – U.Chile [june | 2005] 1 Contents ● A brief history of programming ● Advanced modularization problems ● Reflection and metaprogramming ● Aspect-oriented programming Éric Tanter – U.Chile [june | 2005] 2 Part I A Quick History of Programming Adapted from Brian Hayes, “The Post-OOP Paradigm”, American Scientist, 91(2), March-April 2003, pp. 106-110 Éric Tanter – U.Chile [june | 2005] 3 Software? ● Real challenge: building the machine ● Software was not important as such ● First programs (40's) ● Written in pure binary: 0s and 1s ● Explicit memory address management Éric Tanter – U.Chile [june | 2005] 4 Then came the assembly... ● Assembly language ● No more raw binary codes ● Symbols: load, store, add, sub ● Converted to a binary program by an assembler ● Calculates memory addresses ● First program to help programming Éric Tanter – U.Chile [june | 2005] 5 ...and then, compilers ● Assembly required knowledge of the specific computer instruction set ● Higher-level languages (e.g. Fortran) ● Think in terms of variables/equations ● Not registers/addresses ● 60's: big projects = late/costly/buggy Éric Tanter – U.Chile [june | 2005] 6 Structured Programming ● Manifesto by Edsger W. Dijkstra: “Go to statement considered harmful” [1968] ● Build programs out of sub-units ● Single entrance point, single exit ● 3 constructs: ● Sequencing, alternation, and iteration ● Proof that
    [Show full text]
  • Middleware Architecture with Patterns and Frameworks
    Middleware Architecture with Patterns and Frameworks Sacha Krakowiak Distributed under a Creative Commons license http://creativecommons.org/licenses/by-nc-nd/3.0/ February 27, 2009 Contents Preface ix References........................................ x 1 An Introduction to Middleware 1-1 1.1 Motivation for Middleware . 1-1 1.2 CategoriesofMiddleware . 1-6 1.3 A Simple Instance of Middleware: Remote Procedure Call . ......... 1-7 1.3.1 Motivations and Requirements . 1-8 1.3.2 Implementation Principles . 1-9 1.3.3 Developing Applications with RPC . 1-11 1.3.4 SummaryandConclusions. .1-13 1.4 Issues and Challenges in Middleware Design . 1-14 1.4.1 DesignIssues ...............................1-14 1.4.2 Architectural Guidelines . 1-15 1.4.3 Challenges ................................1-17 1.5 HistoricalNote .................................. 1-18 References........................................1-19 2 Middleware Principles and Basic Patterns 2-1 2.1 ServicesandInterfaces . 2-1 2.1.1 Basic Interaction Mechanisms . 2-2 2.1.2 Interfaces ................................. 2-3 2.1.3 Contracts and Interface Conformance . 2-5 2.2 ArchitecturalPatterns . 2-9 2.2.1 Multilevel Architectures . 2-9 2.2.2 DistributedObjects . .. .. .. .. .. .. .. .2-12 2.3 Patterns for Distributed Object Middleware . 2-15 2.3.1 Proxy ...................................2-15 2.3.2 Factory ..................................2-16 2.3.3 Adapter..................................2-18 2.3.4 Interceptor ................................2-19 2.3.5 Comparing and Combining Patterns . 2-20 2.4 Achieving Adaptability and Separation of Concerns . ..........2-21 2.4.1 Meta-ObjectProtocols. 2-21 2.4.2 Aspect-Oriented Programming . 2-23 ii CONTENTS 2.4.3 PragmaticApproaches. .2-25 2.4.4 ComparingApproaches .
    [Show full text]
  • Polymorphic Bytecode Instrumentation
    SOFTWARE: PRACTICE AND EXPERIENCE Softw. Pract. Exper. 2016; 46:1351–1380 Published online 18 December 2015 in Wiley Online Library (wileyonlinelibrary.com). DOI: 10.1002/spe.2385 Polymorphic bytecode instrumentation Walter Binder1,*,†, Philippe Moret1, Éric Tanter2 and Danilo Ansaloni1 1Faculty of Informatics, Università della Svizzera Italiana (USI), Lugano, Switzerland 2PLEIAD Lab, Computer Science Department (DCC), University of Chile, Santiago, Chile SUMMARY Bytecode instrumentation is a widely used technique to implement aspect weaving and dynamic analyses in virtual machines such as the Java virtual machine. Aspect weavers and other instrumentations are usu- ally developed independently and combining them often requires significant engineering effort, if at all possible. In this article, we present polymorphic bytecode instrumentation (PBI), a simple but effective tech- nique that allows dynamic dispatch amongst several, possibly independent instrumentations. PBI enables complete bytecode coverage, that is, any method with a bytecode representation can be instrumented. We illustrate further benefits of PBI with three case studies. First, we describe how PBI can be used to imple- ment a comprehensive profiler of inter-procedural and intra-procedural control flow. Second, we provide an implementation of execution levels for AspectJ, which avoids infinite regression and unwanted interference between aspects. Third, we present a framework for adaptive dynamic analysis, where the analysis to be performed can be changed at runtime by the user. We assess the overhead introduced by PBI and provide thorough performance evaluations of PBI in all three case studies. We show that pure Java profilers like JP2 can, thanks to PBI, produce accurate execution profiles by covering all code, including the core Java libraries.
    [Show full text]
  • University of South Wales Abbey Bookbinding Unit 3, Gabalfa Workshops Oat Menter Excelsior Ind
    University of South Wales Abbey Bookbinding Unit 3, Gabalfa Workshops Oat Menter Excelsior Ind. Estate 2059469 CardiffCFI43AY Tel:+44 (0)29 2062 3290 Fax:+44 (0)29 20625420 E: [email protected] www.abbeybookbinding.co.uk A Domain-Specific Aspect Language Approach to Distributed Systems Development Paul Soule Department of Computing and Mathematical Sciences University of Glamorgan A submission presented in partial fulfilment of the requirements of the University of Glamorgan/Prifysgol Morgannwg for the degree of Doctor of Philosophy August 2008 Abstract Distributed applications are difficult to write. Programmers need to adhere to specific distributed systems programming conventions and frameworks, which makes distributed systems development complex and error prone and ties the resultant application to the distributed system because the appli­ cation's code is tangled with the crosscutting concern distribution. Existing mainstream programming languages, such as Java, do not pro­ vide language support for distribution. Rather, programmers must rely on object-oriented distribution frameworks to provide distribution support. Although highly successful, the cost of using these frameworks is that the resultant code is tied to the framework. Object-oriented frameworks in gen­ eral, and distribution frameworks in particular, can therefore be considered crosscutting in nature because the framework's code, either via inheritance or containment, is scattered throughout the application's code thereby tying the application to the framework. This is a particular concern in distributed systems development because dis­ tribution frameworks impose a large code overhead due to the requirements distributed systems impose, such as the need to catch distribution-specific exceptions, locating and binding to distributed objects, locating another server in the event the current server becomes unavailable, and adhering to programming conventions dictated by the framework, such as implementing framework specific interfaces.
    [Show full text]
  • Secure Method Calls by Instrumenting Bytecode with Aspects
    Secure Method Calls by Instrumenting Bytecode with Aspects Xiaofeng Yang and Mohammad Zulkernine School of Computing, Queen’s University Kingston, Ontario, Canada, K7L 3N6 {yang,mzulker}@cs.queensu.ca Abstract. Today most mobile devices embed Java runtime environ- ment for Java programs. Java applications running on mobile devices are mainly MIDP (Mobile Information Device Profile) applications. They can be downloaded from the Internet and installed directly on the device. Although the virtual machine performs type-safety checking or verifies bytecode with signed certificates from third-party, the program still has the possibility of containing risky code. Inappropriate use of sensitive method calls may cause loss of personal assets on mobile devices. More- over, source code is not accessible for most installed applications, making it difficult to analyze the behavior at source-code level. To better protect the device from malicious code, we propose an approach of bytecode in- strumentation with aspects at bytecode level. The instrumentation pin- points the location of statements within methods, rather than at the interface of method calls. The aspects are woven around the statement for tracking. The weaving is performed at bytecode level without requir- ing source code of the program. Keywords: Bytecode instrumentation, aspects, code security. 1 Introduction Mobile technology is very popular nowadays. More and more applications are running on mobile devices such as cellphones and PDAs, etc. Mobile code can easily migrate from one site to another, and even to a personal cellphone. Java applications are popularly running on mobile devices that embed Java Runtime Environments. User’s information may be at risk as they are not usually aware of the programs they are running on their devices, for example, the unauthorized SMS (Short Message Service) sending programs [1] can be executed without any authorization of a user.
    [Show full text]
  • Code Instrumentation with Mod-BEAM
    1 Computer Science Code instrumentation with Mod-BEAM Roman Rinke Armando Wiedijk MSc. Thesis July 18, 2019 Supervisors: dr. A. Fehnker prof.dr.ir. M. Aksit External Supervisor: prof.dr. C. Bockisch Formal Methods and Tools Faculty of Electrical Engineering, Faculty of Mathematics Mathematics and Computer Science and Computer Science University of Twente Philipps University of Marburg P.O. Box 217 35037 Marburg 7500 AE Enschede Germany The Netherlands Abstract There are various methods and techniques for a developer to keep their code read- able and reusable. Design patterns have become important in modern development in order to realise this. There exists code, however, that you would not want in pro- duction. An example of this would be code that is generated by instrumentation tools. Tools might want to generate code to help create performance benchmarks, or to analyse the code-coverage of your test-cases. ”Code instrumentation” is a term commonly used to describe the task of adding such generated code. What we focus on in this thesis is code-instrumentation for Java projects. When a Java file is compiled, the compiler outputs a .class file with the low-level instructions that the Java Virtual Machine can execute. Java code instrumentation can be performed on the actual source-code (before compiling) or on the bytecode itself (after compiling). Multiple frameworks that allow for Java bytecode instrumen- tation. Some of these frameworks are a bit dated, but they all share the common interest to allow for easy, fast and maintainable bytecode manipulation. From the hypothesis that existing tools that make use of bytecode instrumenta- tion have potential overlap, the tool ”Mod-BEAM” is introduced.
    [Show full text]
  • Slides Revision: 20190923-Ea7c311
    Will it blend? Java agents and OSGi Slides revision: 20190923-ea7c311 1 Welcome 2 About me 3 Outline Quick demo Java agents primer Usage scenarios OSGi integration Integration testing Testing demo 4 Quick demo 5 Java agents primer 6 Java instrumentation APIs Provides services that allow Java programming language agents to instrument programs running on the JVM. java.lang.instrument Javadoc, Java SE 8 7 Static agents # loaded at application startup $ java -javaagent:agent.jar -jar app.jar Premain-Class: org.example.my.Agent import java.lang.instrument.*; public class Agent { public static void premain(String args,⏎ Instrumentation inst) { inst.addTransformer(new ClassFileTransformer() { /* implementation elided */ }); } } 8 Dynamic agents // dynamically attached to a running JVM VirtualMachine vm = VirtualMachine.attach(vmPid); vm.loadAgent(agentFilePath); vm.detach(); Agent-Class: org.example.my.Agent import java.lang.instrument.*; public class Agent { public static void agentmain(String args,⏎ Instrumentation inst) { inst.addTransformer(new ClassFileTransformer() { /* implementation elided */ }); } } 9 Class transformation public interface ClassFileTransformer { byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException; } 10 Java bytecode public static void main(java.lang.String[]); Code: 0: getstatic #16⏎ // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #22⏎ // String Hello, world 5: invokevirtual #24⏎ //
    [Show full text]
  • Runtime Code Generation for Interpreted Domain-Specific Modeling Languages
    Proceedings of the 2018 Winter Simulation Conference M. Rabe, A. A. Juan, N. Mustafee, A. Skoogh, S. Jain, and B. Johansson, eds. RUNTIME CODE GENERATION FOR INTERPRETED DOMAIN-SPECIFIC MODELING LANGUAGES Tom Meyer Tobias Helms Tom Warnke Adelinde M. Uhrmacher Institute of Computer Science University of Rostock Albert-Einstein-Straße 22 18059 Rostock, GERMANY ABSTRACT Domain-specific modeling languages (DSMLs) facilitate concise and succinct model descriptions. DSMLs are commonly realized by defining a custom grammar and executing models in an interpreter. This provides flexibility in language design as well as in the implementation of simulation algorithms. However, this type of implementation can lead to a negative impact on simulation performance in comparison to implementing models in general-purpose programming languages (GPL). To mitigate this problem, we propose using runtime code generation. This allows us to replace specific parts of a model at runtime by compiling generated GPL source code. In this paper, we demonstrate the potential benefit of this concept based on ML-Rules, a DSML for modeling and simulating biochemical reaction networks. Using code generation for arithmetic expressions in ML-Rules’ reaction rate functions, we were able to decrease the runtime by up to 40% in complex application scenarios. 1 INTRODUCTION The development of a novel modeling method typically includes a software implementation of the method. One successful approach is to define domain-specific modeling languages (DSMLs) tailored to a specific application domain (Miller et al. 2010). Carefully designed DSMLs are powerful tools and enable modelers to efficiently develop succinct and accessible implementations of complex models. Especially in comparison to general-purpose programming languages (GPLs), using DSMLs results in more readable and compact model definitions.
    [Show full text]
  • Type-Safe Java Bytecode Modification Library Based on Javassist
    TALLINN UNIVERSITY OF TECHNOLOGY Faculty of Information Technology Institute of Computer Science Chair of Theoretical Informatics Type-safe Java bytecode modification library based on Javassist Bachelor thesis Student: Sven Laanela Student code: IAPB020471 Advisor: Pavel Grigorenko Tallinn 2015 I declare that this thesis is the result of my own research except as cited in the references. The thesis has not been accepted for any degree and is not concurrently submitted in candidature of any other degree. Signature Name Sven Laanela Date May 26, 2015 Abstract Dynamic (runtime) Java bytecode modification enables various fra- meworks to greatly enhance Java programs. They can provide logging, caching, dependency injection, object-relational mapping, etc. with- out cluttering the application source code, or even when the source code is not available. Existing Java bytecode modification libraries do not provide compile-time type safety or IDE-assisted code completion capabilities with regard to the class under modification. This thesis researches a problem of type-safe Java bytecode modification, build- ing on top of Javassist { a Java bytecode modification library { and taking into consideration the most common Java bytecode modifica- tion use-cases. Scenarios implemented in Javassist are described and an alternative approach that implements those scenarios in a type-safe manner is proposed. An implementation library is presented as proof of concept for the proposed approach to Java bytecode modification. An analysis of the applicability of the approach is provided, outlining both the benefits and trade-offs when compared to Javassist. Annotatsioon D¨unaamiline(s.t. rakenduse t¨o¨otamiseaegne) Java baitkoodi muut- mine v~oimaldaboluliselt t¨aiendadaJava rakendusi ilma l¨ahtekoodi ris- ustamata.
    [Show full text]