- Each individual step represents a technology layer:
- Step 1: C++ Low Level Function
- Step 2: C++ Main Function
- Step 3: C Main Function
- Step 4: Java Main Function
- Each individual step is skippable:
- This means you can start from any step and work your way forward, with some slight modifications.
- Developers can decide to follow the steps backwards and use a top down approach (by commenting out access to the lower technology layer).
- When developing new code, developers can decide not to include bottom technology layers (for instance, starting with Step 3 will mean you have no C++ code and are just using Java to run a C Program).
- Each individual step is testable:
- New developers have less variables involved when stuff doesn't work.
- Developers get immediate feedback regarding whether they are on the right track.
- Developers can check a technology layer along with lower technology layers (by uncommmenting the main function are recompiling).
- When debugging code, developers can decide not to include top technology layers (for instance, running the C main function will mean you are not running the Java code and are just checking the functionality of the C and C++ code).
- You need a Java compiler for Windows (ie, see Getting Started with Java's Hello World: Part I).
- You need a C++ compiler for Windows (ie, download TDM-GCC at tdm-gcc.tdragon.net).
- Choose a working directory for the C++/C code (ie, preferrably in your project's resources folder, "C:\Users\Scott\workspace\myrepo\my-app\src\main\resources\dlls").
This post was reposted from http://scottizu.wordpress.com/2013/08/21/an-introduction-to-jni-using-a-bottom-up-approach-introduction/, originally written on August 21st, 2013.
No comments:
Post a Comment