Paul Werbicki Supervisor: Dr. Robert C. Kremer

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

COM vs. CORBA.
Broker Pattern Pattern-Oriented Software Architecture (POSA 1)
Architectural Pattern: Broker
Object Oriented Paradigm An evolutionary path. Programming At Its Infancy A program is a single block of procedural code Disadvantages: Reusability is.
Component-based Software Engineering Marcello Bonsangue LIACS – Leiden University Fall 2005 Component Model Comparison.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Communication in Distributed Systems –Part 2
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
.NET, and Service Gateways Group members: Andre Tran, Priyanka Gangishetty, Irena Mao, Wileen Chiu.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
L6 - March 1, 2006copyright Thomas Pole , all rights reserved 1 Lecture 6: Software Packaging: Dynamically Integrable Components and Text Ch.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
Web Services Architecture1 - Deepti Agarwal. Web Services Architecture2 The Definition.. A Web service is a software system identified by a URI, whose.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
Chapter 3: Objects, Components, and the Web Textbook IT Architectures and Middleware, Second Edition Chris Britton and Peter Bye AIT 600 Jeff Schmitt September.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture 15 Introduction to Web Services Web Service Applications.
1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. With Thanks to.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
 OOPLs  Help companies reduce complexity  Increase competition in open markets  Speeds up development  Improves maintenance, resusability, modifiability.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
SE-02 COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require.
Presented By:- Sudipta Dhara Roll Table of Content Table of Content 1.Introduction 2.How it evolved 3.Need of Middleware 4.Middleware Basic 5.Categories.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 15 System Architecture III.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
1 Distributed Systems Architectures Distributed object architectures Reference: ©Ian Sommerville 2000 Software Engineering, 6th edition.
CIS 234: Object-Oriented Programming with Java
Java Distributed Computing
Computer System Structures
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
The Object-Oriented Thought Process Chapter 13
Windows Programming Environments
.NET Omid Darroudi.
Common Object Request Broker Architecture (CORBA)
Distributed Computing
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to Visual Basic 2008 Programming
Java Distributed Computing
CORBA Alegria Baquero.
What is RMI? Remote Method Invocation
Introduction to .NET Framework Ch2 – Deitel’s Book
Instructor: Dr. Hany H. Ammar
Lecture 1 Runtime environments.
CMPE419 Mobile Application Development
Chapter 1 FOUNDATIONS OF JAVA
Ch > 28.4.
Advanced Programming Fall 2017.
Component-Based Software Engineering: Technologies, Development Frameworks, and Quality Assurance Schemes X. Cai, M. R. Lyu, K.F. Wong, R. Ko.
Interpreter Style Examples
CORBA Alegria Baquero.
Inventory of Distributed Computing Concepts
Component--based development
(Computer fundamental Lab)
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
CMPE419 Mobile Application Development
C++/Java/COM Interoperability
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
CORBA and COM TIP Two practical techniques for object composition
Presentation transcript:

Paul Werbicki Supervisor: Dr. Robert C. Kremer Developing Applications with Multiple Programming Languages – an Investigation using C++ and Java Paul Werbicki Supervisor: Dr. Robert C. Kremer Department of Computer Science University of Calgary

Agenda Problem Statement Problem Scope Integration Approaches A Hybrid Approach The Java/C++ Class Library Investigation Results and Current Limitations Contributions and Future Work

Problem Statement How can a single object-oriented application written in one programming language integrate code from another language? What approaches have been used to integrate multiple programming languages? What requirements should an approach meet in order to provide benefit to a developer? To what level is it possible to integrate separate languages, and what limitations currently exist?

Problem Scope Programming languages used include: C++, Java and Visual Basic (.NET) Integration occurs between native and virtual programming languages C++ integrating Java Java integrating C++ Visual Basic integrating Java Integration occurs between programming languages contained in a single application running within a single process Process App Java C++

Integration Approaches Library JNI Enhancement Libraries (MIIK Ltd., 2005; Trewhella, 2002; Gabrilovich & Finkelstein, 2001) Simplifies use of the Java Native Interface (JNI) Reduces developer effort by encapsulating common functionality Proxy Classes (Gamma, Helm, Johnson, & Vlissides, 1995) Transforms code from one programming language to another, providing a level of seamless integration Proxy Class

Integration Approaches Remote Procedure Calls (Intrinsyc Software International Inc., 2005; JNBridge LLC, 2005) Uses Inter-Process Communication and Wire Protocols such as Distributed Component Object Model (DCOM) and Common Object Request Broker Architecture (CORBA) “Out-of-process” only solution, not usable within the context of a single application running within a single process Requires additional resources such as an RPC server App RPC

Microsoft JVM JVM Microsoft directly modified the Java Virtual Machine (JVM) to support programming language integration (Gilbert, 2004) Raw Native Interface and J/Direct Java and Component Object Model (COM) Callable Wrappers Sun vs. Microsoft Microsoft’s JVM enhancements failed to deliver a Java-compatible product Sun’s litigation forced Microsoft to remove the JVM from the market, to be replaced by their .NET framework

A Hybrid Approach Combines the benefits of the Microsoft approach without modifying the JVM Uses COM as an intermediate interface between C++ and Java Implements as an Enhancement Library Provides a Proxy Compiler Tool for greater level of programming language syntax integration COM Library JNI Proxy

Java/C++ Class Library Written in C++ and Java (using the JNI) Based on the object-oriented programming paradigm Uses standard COM interfaces as the contract between programming languages Performs marshalling of all scalar types and most complex types Proxy Compiler Tool allows secondary programming language code to conform to the syntax of the primary language Code A Code B COM Library

Investigation The Collaborative Agent System Architecture (CASA), A Multi Agent System (MAS) written in Java, was integrated with specialized devices using C++ and Visual Basic in an intelligent environment X10 Physical Device Agent Voice-Activated Light Switch Web-Based Device Console Accesses SMARTHOME API to control X10 devices (Section 5.3.1) Sends voice- based commands using CASA (Section 5.3.2) Java Queries physical devices using CASA to display in web-based interface (Section 5.3.3) C++ Visual Basic

Results The Java/C++ Class Library successfully integrated multiple programming languages in most scenarios Allowed the reuse of existing code without modification Existing software with well-defined interfaces provided the highest level of integration Inheritance across the native/virtual boundary required the use of a delegate class Interface Sub- system

Inheritance Across the Native/Virtual Boundary CMyAgent inherits from casa.Agent, overrides handleMessage() Java CMyAgent casa.Agent (C++ Proxy) JavaCOM casa.Agent CASA Agent() CreateObject() AllocObject() regsiterWithLAC() joinCD() sendMessage() sendCDMessage() handleMessage() ~Agent() Release() Message is received from another agent Message is received by casa.Agent::handleMessage, should be received by CMyAgent::handleMessage. Message does not propagate across the Native/Virtual Boundary.

Contributions The Java/C++ Class Library is a combination of multiple integration approaches that is advantageous in many development scenarios Provides a similar level of integration by containing the JVM, interfacing with it through the JNI The complete source code is available to help with research projects that require applications written in multiple languages Provides a basis on which further research into fully supporting the object-oriented programming paradigm may occur

Future Work To fully support native/virtual inheritance an object-oriented interface is required, as the JNI provides only a procedural approach Sun’s Java Research License offers the possibility of modifying the JVM to support such an interface without using COM This interface could then be submitted to the Java Community Process (JCP) as a next generation interface of the JNI

References Gabrilovich, E., & Finkelstein, L. (2001, January). JNI - C++ Integration Made Easy. C/C++ Users Journal, 10-21. Gilbert, H. (2004). The Tragedy of Microsoft and Java. New Haven, CT, USA: Yale University. MIIK Ltd. (2005). JNIWrapper. Kharkov, Ukraine: MIIK Ltd. Trewhella, P. E. (2002). JNI++: SourceForge.net.

Additional Slides Java Native Interface (2.1.2.2, pg. 11) Component Object Model (4.1, pg. 38) Class Diagram (4.2, pg. 45) Ambient Intelligent Environment Diagram Inheritance Expected (5.3.3, pg. 77) vs. Actual (5.4.2, pg. 83) Delegate Class (5.3.2, Pg. 75)

Java Native Interface (2.1.2.2, pg. 11) Based on the Netscape Java Runtime Interface (JRI) Unlike Microsoft RNI and COM, it is not vendor specific Standard native interface to the JVM Used for embedding JVM into other applications Avoids restrictions on JVM implementations Binary compatibility between Java Virtual Machines Exposes JVM internals Remains open to future development

Java Native Interface (2.1.2.2, pg. 11) cont’d Procedural-based library: Invocation functions Type and method mapping functions Object and scalar array manipulation functions Fields and methods are accessed by ID Provides access to object references, garbage collection and exception handling

Component Object Model (4.1, pg. 38) Component-based approach to software development Allows components from independent vendors to work together Allows components to be upgraded without recompiling the entire project Programming language independence Host environment independence

Component Object Model (4.1, pg. 38) cont’d Procedural/interface-based library Component/interface discovery functions Standard interfaces for component/interface/method discovery Dynamic interfaces for late-binding to interfaces/methods at run-time vs. early-binding during compile-time Provides binary-compatibility Methods are grouped into interfaces which are then grouped into components Components and interfaces are uniquely identified Dynamic discovery of interfaces and invocation of methods

Java/C++ Class Library (4.2, pg. 45)

Ambient Intelligent Environment

Inheritance Expected (5.3.3, pg. 77) vs. Actual (5.4.2, pg. 83)

Delegate Class (5.3.2, pg. 75)