File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the BEST WAY to provide java code to vendor?

 
Bhavesh Dak
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have two interfaces and its implementations Now I need to provide this interfaces to some third party vendor to use.
I dont want to share implementation details (Not even class files).
So what is the best way I can share this information?

I dont want to package my implementation details(Implementation classes) into the jar.

Appriciate for any hint or solution for this.






 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to give somebody the implementation of your classes, then there is obviously no way for that person to run your program on their own computer in any way.

You can implement your program as a web service - it will be running on your own server, and the client will have to call it remotely.

You can try to obfuscate your code (make it hard to decompile), but this not safe in principle (a hacker who tries hard enough can always find it out, no matter how much you encrypt or obfuscate the code). Running it on a server, not giving third parties access to the code, is the only way to make it really safe.
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesper,

One hypothetical solution is there in my mind.
Suppose my service class is located at remote location, now If I can load this class (Using ServiceLoader) into vendor machine at runtime from its remote location at first request and cache it so that there will be only a single hit. (Clear the cache as and when its necessary to do so)
Will this work?

Thanks Jesper for info about obfuscation.

 
Campbell Ritchie
Sheriff
Pie
Posts: 47228
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really mean vendor? Purchaser, surely?
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ritchie,

Yes, By this
I can load this class (Using ServiceLoader) into vendor machine at runtime
I actually mean it be a vendor.
Because the loading and caching will happen behind the scene at runtime and when user(vendor) kill or logs out of the application these things will be removed.

This is what I am just thinking about but dont know wether this will work or not.

Please help me to figure this.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be trivial to implement a class loader that saves your class files anyway.
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have only two ways:
Either I use Web Services or I have to give source to the vendor.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhavesh Dak wrote:I have only two ways:
Either I use Web Services or I have to give source to the vendor.

You don't have to give the source to the vendor; you can give him compiled class files, but in principle he could reverse engineer those. The only really secure solution is to keep the class files to yourself and have the vendor call them remotely, for example through a web service.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic