Adapter Classes for using C++ library through JNI
-
Hi , I have created C++ library(3 dlls) and I am using these library in my Java UI through JNI. In my JNI I am modifiying jobjectArray i.e. adding data inside my jobjectArray and returning it from JNI. Now my problem is if in future my C++ library changes I will have to change my JNI code. What should I do to 'tune' my JNI so that it will change with minimum impact. Does it require Adapter classes or wrapper clases. Any information on this will help me. Thanks
-
Hi , I have created C++ library(3 dlls) and I am using these library in my Java UI through JNI. In my JNI I am modifiying jobjectArray i.e. adding data inside my jobjectArray and returning it from JNI. Now my problem is if in future my C++ library changes I will have to change my JNI code. What should I do to 'tune' my JNI so that it will change with minimum impact. Does it require Adapter classes or wrapper clases. Any information on this will help me. Thanks
[Byrne voice] Well we can't predict the future But we're trying to do the best that we can [/Byrne voice]
I suppose 'the best you can' here is: "follow the KISS principle, keep it simple". Since you cannot predict the future changes, make your overall design simple and well documented.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]