Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java equivalent of DLL

Posted on 2008-10-13
2
Medium Priority
?
1,341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 60

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 60

Accepted Solution

by:
Kevin Cross earned 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

670 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