Solved

Java equivalent of DLL

Posted on 2008-10-13
2
1,279 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now