Solved

Java equivalent of DLL

Posted on 2008-10-13
2
1,293 Views
Last Modified: 2013-11-23
We have a DLL that performs some proprietary calculations on data passed to it.  A new client wants the same calculations, but in Java.  I think I can manage to write the code (read comma delimited file, make calcs for each row, output results to a file).   Do I just compile it as a class?  If I want to test it how do I access it's methods and properties from another class that incudes Main().

Also, is it possible/difficult for the client to decompile the class and get to our proprietary calculations.
0
Comment
Question by:studioEtc
  • 2
2 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22707665
You could compile to class and then export/seal classes inside a JAR file which is a Java ARchive (Library).

You could then from client code, instantiate your proprietary class and execute methods that way like:

MyType myType = new MyType();
myType.calc(param);

Hope that helps.
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22707668
Only expose the public interface and hide all the implementation classes through class scoping.  The sealing of the JAR will prevent from inheriting any of your implementation code directly.  You can further look into code obfuscation, but think this should do the trick for what you want.

Here is some more detail on this topic from Java/Sun site: http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 106
Checkbox and ListView in Android Layout 4 67
jar file executable 12 52
Windows 10 IE Certificate Issue 10 46
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question