SlideShare une entreprise Scribd logo
1  sur  48
Adapter

SENG 609.04 Design Patterns

         Winter, 2003



     Presented by Ming Zhou, Guy Davis
Agenda
      Intent & Motivation
  

      Structure
  

      Applicability
  

      Consequences
  

      Known Uses
  

      Related Patterns
  

      References
  

               - Total 17 pages -   1
What is Adapter?
    Change the interface of a


    class into another interface
    which is expected by the
    client.
    A.K.A. Wrapper





                  - Total 17 pages -   1
What is Adapter?
    Change the interface of a


    class into another interface
    which is expected by the
    client.
    A.K.A. Wrapper





                  - Total 17 pages -   1
What is Adapter?
    Change the interface of a


    class into another interface
    which is expected by the
    client.
    A.K.A. Wrapper





                  - Total 17 pages -   1
Motivation




             - Total 17 pages -   1
Motivation




             - Total 17 pages -   1
Motivation




             - Total 17 pages -   1
Motivation




                                  1   1



             - Total 17 pages -           1
Structure (Class)




           - Total 17 pages -   1
Structure (Object)




           - Total 17 pages -   1
Applicability




            - Total 17 pages -   1
Applicability
    Use an existing class whose interface


    does not match the requirement




                 - Total 17 pages -         1
Applicability
    Use an existing class whose interface


    does not match the requirement
    Create a reusable class though the


    interfaces are not necessary
    compatible with callers




                 - Total 17 pages -         1
Applicability
  Use an existing class whose interface


  does not match the requirement
 Create a reusable class though the

  interfaces are not necessary
  compatible with callers
 Want to use several existing subclasses,
  but it is impractical to subclass
  everyone. (Object Adapter Only)


               - Total 17 pages -       1
Class Adapter Pattern
    Pros


        Only 1 new object, no additional indirection
    


        Less code required than the object Adapter
    


        Can override Adaptee's behaviour as required
    



    Cons


        Requires sub-classing (tough for single
    


        inheritance)
        Less flexible than object Adapter
    




                       - Total 17 pages -              1
Object Adapter Pattern
      Pros
  

          More flexible than class Adapter
      


          Doesn't require sub-classing to work
      


          Adapter works with Adaptee and all of its
      

          subclasses
      Cons
  

          Harder to override Adaptee behavior
      


          Requires more code to implement
      

          properly

                         - Total 17 pages -           1
Pluggable Adapters




    implemented with abstract operations



                   - Total 17 pages -      1
Pluggable Adapters




    implemented with delegate objects

                    - Total 17 pages -   1
Two-way Adapters
                                               class PegAdapter: public SquarePeg,
class SquarePeg {
                                                  RoundPeg {
  public:
    void virtual squarePegOperation()              public:
   { blah }
                                                     void virtual roundPegOperation() {
}
                                                         add some corners;
                                                         squarePegOperation();
class RoundPeg {
                                                     }
    public:
                                                     void virtual squarePegOperation() {
      void virtual roundPegOperation()
                                                         add some corners;
     { blah }
                                                         roundPegOperation();
}
                                                     }
                                               }
                                     - Total 17 pages -                               1
Adapting Local Classes to RMI
Comparison:
 Increases reusability

  of local class
 Improves performance

  of local class
 Doesn't use Java

  single parent by
  subclassing (uses
  composition)
                  - Total 17 pages -   1
Related Patterns
    Adapter can be similar to the remote


    form of Proxy. However, Proxy doesn't
    change interfaces.
    Decorator enhances another object


    without changing its interface.
    Bridge similar structure to Adapter,


    but different intent. Separates
    interface from implementation.
                 - Total 17 pages -         1
Conclusions
    Allows collaboration between classes


    with incompatible interfaces
    Implemented in either class-based


    (inheritance) or object-based
    (composition & delegation) manner
    Useful pattern which promotes reuse


    and allows integration of diverse
    software components
                 - Total 17 pages -        1
References
    Becker, Dan. Design networked applications in RMI using the Adapter design




    pattern. JavaWorld Magazine, May 1999. http://www.javaworld.com/javaworld/
    jw-05-1999/jw-05-networked.html
    Buschmann et al. A System of Patterns: Pattern-Oriented Software Architecture.




    John Wiley and Sons. Chichester. 1996
    Gamma et al. Design Patterns: Elements of Reusable Object-Oriented Software.




    Addison-Wesley. Boston. 1995
    Nguyen, D.X. Tutorial 10: Stacks and Queues: The Adapter Pattern. Rice




    University. 1999. http://www.owlnet.rice.edu/~comp212/99-fall/tutorials/10/
    tutorial10.html
    Whitney, Roger. CS 635 Advanced Object-Oriented Design & Programming. San




    Diego State University. 2001. http://www.eli.sdsu.edu/courses/spring01/cs635/
    notes/proxy/proxy.html#Heading10
    Shalloway, Alan., and Trott, James R., Design Patterns Explained: A New




    Perspective on Object-Oriented Design, Addison-Wesley, 2002.
    Rising, Linda., The Patterns Handbook: Techniques, Strategies, and Applications,




    Cambridge university Press, 1998.


                                     - Total 17 pages -                                1
Questions?




             - Total 17 pages -   1
Questions?




             - Total 17 pages -   1
Java Native Interface (JNI)

SENG 609.04 Design Patterns

Winter, 2003



       Presented by Guy Davis, Ming Zhou
Agenda
      Overview
  

      Justification
  

      Hello World!
  

      Summary
  

      References
  

      Q&A
  




                - Total 17 pages -   1
JNI Overview




          - Total 17 pages -   1
Interactions with Native Code



      Access to Java world from native code




      Access to- native code from Java
                 Total 17 pages -             1
Justification
Pros:
 Reuse: allows access to useful native code
 Efficiency: use best language for the task
Cons:
 Applets: doesn't work as they're mobile
 Portability: native methods aren't portable
 Extra work: javah, create shared native libs

                  - Total 17 pages -         1
HelloWorld.java
class HelloWorld {
public native void displayHelloWorld();
static {
    System.loadLibrary(quot;helloquot;);
}
public static void main(String[] args) {
    new
    HelloWorld().displayHelloWorld();
  }
}
               - Total 17 pages -     1
HelloWorld.java
class HelloWorld {
public native void displayHelloWorld();
static {
    System.loadLibrary(quot;helloquot;);
}
public static void main(String[] args) {
    new
    HelloWorld().displayHelloWorld();
  }
}
               - Total 17 pages -     1
HelloWorld.java
class HelloWorld {
public native void displayHelloWorld();
static {
    System.loadLibrary(quot;helloquot;);
}
public static void main(String[] args) {
    new
    HelloWorld().displayHelloWorld();
  }
}
               - Total 17 pages -     1
HelloWorld.java
class HelloWorld {
public native void displayHelloWorld();
static {
    System.loadLibrary(quot;helloquot;);
}
public static void main(String[] args) {
    new
    HelloWorld().displayHelloWorld();
  }
}
               - Total 17 pages -     1
HelloWorld.h
#include “jni.h”
/* Header for class HelloWorld */
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
    extern “C” {
#endif

/*
 * Class: HelloWorld
 * Method: displayHelloWorld
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif

                     - Total 17 pages -             1
HelloWorld.h
#include “jni.h”
/* Header for class HelloWorld */
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
    extern “C” {
#endif

/*
 * Class: HelloWorld
 * Method: displayHelloWorld
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif

                     - Total 17 pages -             1
HelloWorld.h
#include “jni.h”
/* Header for class HelloWorld */
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
    extern “C” {
#endif

/*
 * Class: HelloWorld
 * Method: displayHelloWorld
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif

                     - Total 17 pages -             1
HelloWorldImp.c

#include <jni.h>
#include quot;HelloWorld.hquot;
#include <stdio.h>

JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
    printf(quot;Hello world!nquot;);
    return;
}




                          - Total 17 pages -           1
HelloWorldImp.c

#include <jni.h>
#include quot;HelloWorld.hquot;
#include <stdio.h>

JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
    printf(quot;Hello world!nquot;);
    return;
}




                          - Total 17 pages -           1
HelloWorldImp.c

#include <jni.h>
#include quot;HelloWorld.hquot;
#include <stdio.h>

JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
    printf(quot;Hello world!nquot;);
    return;
}




                          - Total 17 pages -           1
HelloWorldImp.c

#include <jni.h>
#include quot;HelloWorld.hquot;
#include <stdio.h>

JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
    printf(quot;Hello world!nquot;);
    return;
}




                          - Total 17 pages -           1
Create a Shared Library
class HelloWorld {
   ...
        System.loadLibrary(quot;helloquot;);
   ...
}

 Compile the native code into a shared library:
  (example for MS Windows Visual C++ 4.0)


  cl -Ic:javainclude -Ic:javaincludewin32
     -LD HelloWorldImp.c -Fehello.dll



                            - Total 17 pages -   1
Run the Program
Command:

 java HelloWorld
Result:

 Hello World!

Possible
exceptions:

 java.lang.UnsatisfiedLinkError: no hello in
  shared library path at
  java.lang.Runtime.loadLibrary(Runtime.java)
  at java.lang.System.loadLibrary(System.java)
  at java.lang.Thread.init(Thread.java)


                    - Total 17 pages -      1
Summary
    Connect Java with native languages
    Code reuse
    Powerful
    Compromise of Java safety features,


    cross-platform and dynamic ability
    JNI call is slow and costful


    Not work well for applets



                 - Total 17 pages -       1
References
 Glenn L. Vanderburg. et al., Tricks of the Java
    Programming Gurus, 1996, http://docs.rinet.ru:8080/
    JaTricks/
   Beth Stearns, Trail: Java Native Interface, Sun
    Microsystems, Inc., 2003, http://java.sun.com/docs/
    books/tutorial/native1.1/
   Roedy Green, JNI, The Java Native Interface, Canadian
    Mind Products, 2002, http://mindprod.com/jni.html
   Kong Wenyu, A Brief Introduction to Java Native
    Interface, http://www.geocities.com/kongwenyu/jni.html


                       - Total 17 pages -               1
Questions?




             - Total 17 pages -   1
Questions?




             - Total 17 pages -   1

Contenu connexe

Tendances

Design Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternDesign Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternMudasir Qazi
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design PatternSanae BEKKAR
 
Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternMudasir Qazi
 
Prototype design patterns
Prototype design patternsPrototype design patterns
Prototype design patternsThaichor Seng
 
Design Patterns
Design PatternsDesign Patterns
Design Patternssoms_1
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsMichael Heron
 
Bridge pattern for Dummies
Bridge pattern for DummiesBridge pattern for Dummies
Bridge pattern for DummiesTaekSoon Jang
 
Design Pattern - Singleton Pattern
Design Pattern - Singleton PatternDesign Pattern - Singleton Pattern
Design Pattern - Singleton PatternMudasir Qazi
 

Tendances (20)

Factory Method Pattern
Factory Method PatternFactory Method Pattern
Factory Method Pattern
 
Factory Method Pattern
Factory Method PatternFactory Method Pattern
Factory Method Pattern
 
Design Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternDesign Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory Pattern
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design Pattern
 
Prototype pattern
Prototype patternPrototype pattern
Prototype pattern
 
Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method Pattern
 
Bridge Design Pattern
Bridge Design PatternBridge Design Pattern
Bridge Design Pattern
 
Prototype design patterns
Prototype design patternsPrototype design patterns
Prototype design patterns
 
Proxy pattern
Proxy patternProxy pattern
Proxy pattern
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design Patterns
 
Proxy Design Pattern
Proxy Design PatternProxy Design Pattern
Proxy Design Pattern
 
Bridge pattern for Dummies
Bridge pattern for DummiesBridge pattern for Dummies
Bridge pattern for Dummies
 
Builder pattern
Builder patternBuilder pattern
Builder pattern
 
Design Pattern - Singleton Pattern
Design Pattern - Singleton PatternDesign Pattern - Singleton Pattern
Design Pattern - Singleton Pattern
 
Design pattern
Design patternDesign pattern
Design pattern
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
 

En vedette

ennaji ahmed base de donnees
ennaji ahmed base de donneesennaji ahmed base de donnees
ennaji ahmed base de donneesAHMED ENNAJI
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Patterneprafulla
 
The Decorator Pattern
The Decorator PatternThe Decorator Pattern
The Decorator PatternAkshat Vig
 
Design Pattern
Design PatternDesign Pattern
Design PatternHimanshu
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanPriyanka Pradhan
 
Creational pattern
Creational patternCreational pattern
Creational patternHimanshu
 
Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Sameer Rathoud
 
Security and Integrity of Data
Security and Integrity of DataSecurity and Integrity of Data
Security and Integrity of DataAdeel Riaz
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns pptAman Jain
 
Structural patterns
Structural patternsStructural patterns
Structural patternsHimanshu
 

En vedette (12)

ennaji ahmed base de donnees
ennaji ahmed base de donneesennaji ahmed base de donnees
ennaji ahmed base de donnees
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Pattern
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 
The Decorator Pattern
The Decorator PatternThe Decorator Pattern
The Decorator Pattern
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka Pradhan
 
Creational pattern
Creational patternCreational pattern
Creational pattern
 
Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)
 
Security and Integrity of Data
Security and Integrity of DataSecurity and Integrity of Data
Security and Integrity of Data
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Structural patterns
Structural patternsStructural patterns
Structural patterns
 

Similaire à Adapter Design Pattern

Adapter Pattern Abhijit Hiremagalur 200603
Adapter Pattern Abhijit Hiremagalur 200603Adapter Pattern Abhijit Hiremagalur 200603
Adapter Pattern Abhijit Hiremagalur 200603melbournepatterns
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...Codemotion
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas Jabbar
 
Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)Stephen Chin
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedFabian Jakobs
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008rajivmordani
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languagesdeimos
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Languageelliando dias
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践Jacky Chi
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...elliando dias
 
Launchpad: Lessons Learnt
Launchpad: Lessons LearntLaunchpad: Lessons Learnt
Launchpad: Lessons LearntTim Penhey
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails IntroductionEric Weimer
 

Similaire à Adapter Design Pattern (20)

Adapter Pattern Abhijit Hiremagalur 200603
Adapter Pattern Abhijit Hiremagalur 200603Adapter Pattern Abhijit Hiremagalur 200603
Adapter Pattern Abhijit Hiremagalur 200603
 
Creational Design Patterns
Creational Design PatternsCreational Design Patterns
Creational Design Patterns
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
 
jdays 2015
jdays 2015jdays 2015
jdays 2015
 
Anti Object-Oriented Design Patterns
Anti Object-Oriented Design PatternsAnti Object-Oriented Design Patterns
Anti Object-Oriented Design Patterns
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
 
Redux vs GraphQL
Redux vs GraphQLRedux vs GraphQL
Redux vs GraphQL
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languages
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Language
 
ArangoDB
ArangoDBArangoDB
ArangoDB
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Launchpad: Lessons Learnt
Launchpad: Lessons LearntLaunchpad: Lessons Learnt
Launchpad: Lessons Learnt
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails Introduction
 

Plus de guy_davis

Adopting Scrum and Agile
Adopting Scrum and AgileAdopting Scrum and Agile
Adopting Scrum and Agileguy_davis
 
Pragmatic Programmer
Pragmatic ProgrammerPragmatic Programmer
Pragmatic Programmerguy_davis
 
Content Caching with Rails
Content Caching with RailsContent Caching with Rails
Content Caching with Railsguy_davis
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentguy_davis
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Javaguy_davis
 
Agile Software Development Methodologies
Agile Software Development MethodologiesAgile Software Development Methodologies
Agile Software Development Methodologiesguy_davis
 
Project Monitoring and Control
Project Monitoring and ControlProject Monitoring and Control
Project Monitoring and Controlguy_davis
 
The Human Side of Software Development
The Human Side of Software DevelopmentThe Human Side of Software Development
The Human Side of Software Developmentguy_davis
 
Software Quality Plan
Software Quality PlanSoftware Quality Plan
Software Quality Planguy_davis
 
Unified Process
Unified ProcessUnified Process
Unified Processguy_davis
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Managementguy_davis
 
Quality Function Deployment
Quality Function DeploymentQuality Function Deployment
Quality Function Deploymentguy_davis
 

Plus de guy_davis (12)

Adopting Scrum and Agile
Adopting Scrum and AgileAdopting Scrum and Agile
Adopting Scrum and Agile
 
Pragmatic Programmer
Pragmatic ProgrammerPragmatic Programmer
Pragmatic Programmer
 
Content Caching with Rails
Content Caching with RailsContent Caching with Rails
Content Caching with Rails
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Agile Software Development Methodologies
Agile Software Development MethodologiesAgile Software Development Methodologies
Agile Software Development Methodologies
 
Project Monitoring and Control
Project Monitoring and ControlProject Monitoring and Control
Project Monitoring and Control
 
The Human Side of Software Development
The Human Side of Software DevelopmentThe Human Side of Software Development
The Human Side of Software Development
 
Software Quality Plan
Software Quality PlanSoftware Quality Plan
Software Quality Plan
 
Unified Process
Unified ProcessUnified Process
Unified Process
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 
Quality Function Deployment
Quality Function DeploymentQuality Function Deployment
Quality Function Deployment
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Adapter Design Pattern

  • 1. Adapter SENG 609.04 Design Patterns Winter, 2003 Presented by Ming Zhou, Guy Davis
  • 2. Agenda Intent & Motivation  Structure  Applicability  Consequences  Known Uses  Related Patterns  References  - Total 17 pages - 1
  • 3. What is Adapter? Change the interface of a  class into another interface which is expected by the client. A.K.A. Wrapper  - Total 17 pages - 1
  • 4. What is Adapter? Change the interface of a  class into another interface which is expected by the client. A.K.A. Wrapper  - Total 17 pages - 1
  • 5. What is Adapter? Change the interface of a  class into another interface which is expected by the client. A.K.A. Wrapper  - Total 17 pages - 1
  • 6. Motivation - Total 17 pages - 1
  • 7. Motivation - Total 17 pages - 1
  • 8. Motivation - Total 17 pages - 1
  • 9. Motivation 1 1 - Total 17 pages - 1
  • 10. Structure (Class) - Total 17 pages - 1
  • 11. Structure (Object) - Total 17 pages - 1
  • 12. Applicability - Total 17 pages - 1
  • 13. Applicability Use an existing class whose interface  does not match the requirement - Total 17 pages - 1
  • 14. Applicability Use an existing class whose interface  does not match the requirement Create a reusable class though the  interfaces are not necessary compatible with callers - Total 17 pages - 1
  • 15. Applicability Use an existing class whose interface  does not match the requirement  Create a reusable class though the interfaces are not necessary compatible with callers  Want to use several existing subclasses, but it is impractical to subclass everyone. (Object Adapter Only) - Total 17 pages - 1
  • 16. Class Adapter Pattern Pros  Only 1 new object, no additional indirection  Less code required than the object Adapter  Can override Adaptee's behaviour as required  Cons  Requires sub-classing (tough for single  inheritance) Less flexible than object Adapter  - Total 17 pages - 1
  • 17. Object Adapter Pattern Pros  More flexible than class Adapter  Doesn't require sub-classing to work  Adapter works with Adaptee and all of its  subclasses Cons  Harder to override Adaptee behavior  Requires more code to implement  properly - Total 17 pages - 1
  • 18. Pluggable Adapters implemented with abstract operations  - Total 17 pages - 1
  • 19. Pluggable Adapters implemented with delegate objects  - Total 17 pages - 1
  • 20. Two-way Adapters class PegAdapter: public SquarePeg, class SquarePeg { RoundPeg { public: void virtual squarePegOperation() public: { blah } void virtual roundPegOperation() { } add some corners; squarePegOperation(); class RoundPeg { } public: void virtual squarePegOperation() { void virtual roundPegOperation() add some corners; { blah } roundPegOperation(); } } } - Total 17 pages - 1
  • 21. Adapting Local Classes to RMI Comparison:  Increases reusability of local class  Improves performance of local class  Doesn't use Java single parent by subclassing (uses composition) - Total 17 pages - 1
  • 22. Related Patterns Adapter can be similar to the remote  form of Proxy. However, Proxy doesn't change interfaces. Decorator enhances another object  without changing its interface. Bridge similar structure to Adapter,  but different intent. Separates interface from implementation. - Total 17 pages - 1
  • 23. Conclusions Allows collaboration between classes  with incompatible interfaces Implemented in either class-based  (inheritance) or object-based (composition & delegation) manner Useful pattern which promotes reuse  and allows integration of diverse software components - Total 17 pages - 1
  • 24. References Becker, Dan. Design networked applications in RMI using the Adapter design  pattern. JavaWorld Magazine, May 1999. http://www.javaworld.com/javaworld/ jw-05-1999/jw-05-networked.html Buschmann et al. A System of Patterns: Pattern-Oriented Software Architecture.  John Wiley and Sons. Chichester. 1996 Gamma et al. Design Patterns: Elements of Reusable Object-Oriented Software.  Addison-Wesley. Boston. 1995 Nguyen, D.X. Tutorial 10: Stacks and Queues: The Adapter Pattern. Rice  University. 1999. http://www.owlnet.rice.edu/~comp212/99-fall/tutorials/10/ tutorial10.html Whitney, Roger. CS 635 Advanced Object-Oriented Design & Programming. San  Diego State University. 2001. http://www.eli.sdsu.edu/courses/spring01/cs635/ notes/proxy/proxy.html#Heading10 Shalloway, Alan., and Trott, James R., Design Patterns Explained: A New  Perspective on Object-Oriented Design, Addison-Wesley, 2002. Rising, Linda., The Patterns Handbook: Techniques, Strategies, and Applications,  Cambridge university Press, 1998. - Total 17 pages - 1
  • 25. Questions? - Total 17 pages - 1
  • 26. Questions? - Total 17 pages - 1
  • 27. Java Native Interface (JNI) SENG 609.04 Design Patterns Winter, 2003 Presented by Guy Davis, Ming Zhou
  • 28. Agenda Overview  Justification  Hello World!  Summary  References  Q&A  - Total 17 pages - 1
  • 29. JNI Overview - Total 17 pages - 1
  • 30. Interactions with Native Code Access to Java world from native code Access to- native code from Java Total 17 pages - 1
  • 31. Justification Pros:  Reuse: allows access to useful native code  Efficiency: use best language for the task Cons:  Applets: doesn't work as they're mobile  Portability: native methods aren't portable  Extra work: javah, create shared native libs - Total 17 pages - 1
  • 32. HelloWorld.java class HelloWorld { public native void displayHelloWorld(); static { System.loadLibrary(quot;helloquot;); } public static void main(String[] args) { new HelloWorld().displayHelloWorld(); } } - Total 17 pages - 1
  • 33. HelloWorld.java class HelloWorld { public native void displayHelloWorld(); static { System.loadLibrary(quot;helloquot;); } public static void main(String[] args) { new HelloWorld().displayHelloWorld(); } } - Total 17 pages - 1
  • 34. HelloWorld.java class HelloWorld { public native void displayHelloWorld(); static { System.loadLibrary(quot;helloquot;); } public static void main(String[] args) { new HelloWorld().displayHelloWorld(); } } - Total 17 pages - 1
  • 35. HelloWorld.java class HelloWorld { public native void displayHelloWorld(); static { System.loadLibrary(quot;helloquot;); } public static void main(String[] args) { new HelloWorld().displayHelloWorld(); } } - Total 17 pages - 1
  • 36. HelloWorld.h #include “jni.h” /* Header for class HelloWorld */ #ifndef _Included_HelloWorld #define _Included_HelloWorld #ifdef __cplusplus extern “C” { #endif /* * Class: HelloWorld * Method: displayHelloWorld * Signature: ()V */ JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif - Total 17 pages - 1
  • 37. HelloWorld.h #include “jni.h” /* Header for class HelloWorld */ #ifndef _Included_HelloWorld #define _Included_HelloWorld #ifdef __cplusplus extern “C” { #endif /* * Class: HelloWorld * Method: displayHelloWorld * Signature: ()V */ JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif - Total 17 pages - 1
  • 38. HelloWorld.h #include “jni.h” /* Header for class HelloWorld */ #ifndef _Included_HelloWorld #define _Included_HelloWorld #ifdef __cplusplus extern “C” { #endif /* * Class: HelloWorld * Method: displayHelloWorld * Signature: ()V */ JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif - Total 17 pages - 1
  • 39. HelloWorldImp.c #include <jni.h> #include quot;HelloWorld.hquot; #include <stdio.h> JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) { printf(quot;Hello world!nquot;); return; } - Total 17 pages - 1
  • 40. HelloWorldImp.c #include <jni.h> #include quot;HelloWorld.hquot; #include <stdio.h> JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) { printf(quot;Hello world!nquot;); return; } - Total 17 pages - 1
  • 41. HelloWorldImp.c #include <jni.h> #include quot;HelloWorld.hquot; #include <stdio.h> JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) { printf(quot;Hello world!nquot;); return; } - Total 17 pages - 1
  • 42. HelloWorldImp.c #include <jni.h> #include quot;HelloWorld.hquot; #include <stdio.h> JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) { printf(quot;Hello world!nquot;); return; } - Total 17 pages - 1
  • 43. Create a Shared Library class HelloWorld { ... System.loadLibrary(quot;helloquot;); ... } Compile the native code into a shared library: (example for MS Windows Visual C++ 4.0) cl -Ic:javainclude -Ic:javaincludewin32 -LD HelloWorldImp.c -Fehello.dll - Total 17 pages - 1
  • 44. Run the Program Command: java HelloWorld Result: Hello World! Possible
exceptions: java.lang.UnsatisfiedLinkError: no hello in shared library path at java.lang.Runtime.loadLibrary(Runtime.java) at java.lang.System.loadLibrary(System.java) at java.lang.Thread.init(Thread.java) - Total 17 pages - 1
  • 45. Summary Connect Java with native languages Code reuse Powerful Compromise of Java safety features,  cross-platform and dynamic ability JNI call is slow and costful  Not work well for applets  - Total 17 pages - 1
  • 46. References  Glenn L. Vanderburg. et al., Tricks of the Java Programming Gurus, 1996, http://docs.rinet.ru:8080/ JaTricks/  Beth Stearns, Trail: Java Native Interface, Sun Microsystems, Inc., 2003, http://java.sun.com/docs/ books/tutorial/native1.1/  Roedy Green, JNI, The Java Native Interface, Canadian Mind Products, 2002, http://mindprod.com/jni.html  Kong Wenyu, A Brief Introduction to Java Native Interface, http://www.geocities.com/kongwenyu/jni.html - Total 17 pages - 1
  • 47. Questions? - Total 17 pages - 1
  • 48. Questions? - Total 17 pages - 1

Notes de l'éditeur

  1. Java Native Interface provides an means of interacting with native platform classes and functions through the creation of shared libraries. JNI can be used with most languages such as C, C++, Fortran, Cobol, etc...
  2. Full two-way interaction. Native code can interact with Java objects and their methods. Can also generate and throw exceptions that can be handled by Java code. Java code has full access to functionality contained with the native code through the generated interface definitions. Full passing of primitive parameters after conversion (strings to UTF)
  3. There is a ton of existing useful code in &#x201C;native&#x201D; languages: Numerical analysis libraries like LAPACK and BLAS in Fortran Lots of business logic contained with Cobol code Much high-speed code is written in C or assembly
  4. Keyword 'native' used to indicate methods that are available through shared libraries of native code.
  5. Loading the library: On Unix, looks for &#x201C;libhello.so&#x201D; or similar On Win, looks for &#x201C;hello.dll&#x201D; Show how to generate library later...
  6. Once library is loaded, can call native methods defined earlier. Finally, compile the class with: javac HelloWorld.java
  7. Autogenerated with call to: javah -jni HelloWorld
  8. Signature indicates no parameters being passed and void return clause.
  9. The JNIEXPORT and JNICALL macros are defined in jni_md.h which contains platform specific definitions. JNIENV is an interface pointer used to invoke JNI calls. jobject is the Java object on which the call is invoked.
  10. The JNIEXPORT and JNICALL macros are defined in jni_md.h which contains platform specific definitions. JNIENV is an interface pointer used to invoke JNI calls. jobject is the Java object on which the call is invoked.
  11. The JNIEXPORT and JNICALL macros are defined in jni_md.h which contains platform specific definitions. JNIENV is an interface pointer used to invoke JNI calls. jobject is the Java object on which the call is invoked.
  12. The JNIEXPORT and JNICALL macros are defined in jni_md.h which contains platform specific definitions. JNIENV is an interface pointer used to invoke JNI calls. jobject is the Java object on which the call is invoked.
  13. The JNIEXPORT and JNICALL macros are defined in jni_md.h which contains platform specific definitions. JNIENV is an interface pointer used to invoke JNI calls. jobject is the Java object on which the call is invoked.