Board index » jbuilder » limit access to source code

limit access to source code


2005-02-12 12:02:29 AM
jbuilder14
I have a java application which has source code for the graphical user
interface (gui.java) and also additional code for some calculations
(calc.java). I have to give access to a few users so they can edit the
calculations, calc.java but I have to limit access to the source code for
the gui itself, gui.java. What is the best way to do this? I was thinking of
splitting the source code into two classes, one with the code for the
graphical interface alone and the other for the calculations part. If I do
this will it be possible to
give the users the .java file for the calculations part alone with the
.class files for the gui? How do I do this in JBuilder, do I create a
project for each class and then implement interfaces or something? Thank you
very much -- any help will be greatly appreciated!
 
 

Re:limit access to source code

sue wrote:
Quote
I have a java application which has source code for the graphical user
interface (gui.java) and also additional code for some calculations
(calc.java). I have to give access to a few users so they can edit
the calculations, calc.java but I have to limit access to the source
code for the gui itself, gui.java.
Your best bet is to maintain them in two separate projects. The first
project would create a JAR file of all the classes necessary for the
GUI with an interface such as CalcInterface. The second project would
contain the Calc class, implementing CalcInterface. It would use the
JAR file from the first project.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:limit access to source code

Thank you very much for the info -- do you have any kind of example on how
to implement this? Same package or different package? How do I use the JAR
file, - do I import it as a separate class? Thanks again!
"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
sue wrote:

>I have a java application which has source code for the graphical user
>interface (gui.java) and also additional code for some calculations
>(calc.java). I have to give access to a few users so they can edit
>the calculations, calc.java but I have to limit access to the source
>code for the gui itself, gui.java.

Your best bet is to maintain them in two separate projects. The first
project would create a JAR file of all the classes necessary for the
GUI with an interface such as CalcInterface. The second project would
contain the Calc class, implementing CalcInterface. It would use the
JAR file from the first project.

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

{smallsort}

Re:limit access to source code

sue wrote:
Quote
Thank you very much for the info -- do you have any kind of example
on how to implement this? Same package or different package? How do I
use the JAR file, - do I import it as a separate class? Thanks again!
You create JAR files using "File | New | Archive | Basic"; you add them
as libraries using "Tools | Configure | Libraries...".
Given the nature of your query, I strongly recommend that you take some
time to go through the JBuilder tutorials. They will tell you far more
about the JBuilder environment than I ever could in the newsgroups.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:limit access to source code

"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
sue wrote:

>I have a java application which has source code for the graphical user
>interface (gui.java) and also additional code for some calculations
>(calc.java). I have to give access to a few users so they can edit
>the calculations, calc.java but I have to limit access to the source
>code for the gui itself, gui.java.

Your best bet is to maintain them in two separate projects. The first
project would create a JAR file of all the classes necessary for the
GUI with an interface such as CalcInterface. The second project would
contain the Calc class, implementing CalcInterface. It would use the
JAR file from the first project.

A more appropriate option would be to enable the application to load
different classes implementing the CalcInterface and have those configurable
at runtime.
In that scenario no code needs to be exposed and the program can store the
location and classnames of the classes to load in a propertiesfile or other
configuration system and load them using reflection.