I have a problem conserning a project of mine... I have a "project.jar" archive that inside are many classes of the main project software that runs normally.Anyway,my questions are...
1)May I call a method of an "A.class" from "project.jar" that does not belong to the "project.jar" archive?
2)If the above question is not understandable, please I'm refreshing what I am meaning (Is the same but in different words): May I call the "A.class" from "Beta.class" by importing the string argument : % java Beta A.class
How may I do this,please I am hoping for your help!
Joined: Nov 27, 2004
...and I don't want to use JRMI... I have found some resources on internet that talks about ClassLoader Interface, but still doesn't work to me. so please, If you can post me a simple example with Alpha.class and Beta.class as my example above, that would be helpful to me...
Thanks for your time..
Joined: Nov 27, 2004
Sorry about the 3rd continue post My Question Is still NOt Answered... I am posting again because i forgot to refer where are the infos I found on net: javaworld.com about the jini tutorial...
to 1) Absolutely. As long as both classes are in your classpath, it does not matter whether they are in the same jar file or not.
java Beta A.class
This doesn't work. You call a class by importing it in your source code, and then invoking the method. Again, the class must be in your classpath, and the method must be accessible to the calling class (which is governed by its public/protected/package/private qualifier).
Hi, and thanks for the respond, You reply me something that i was afraid of... this is not working...(unfortunatelly)
My problem is that I wanna let the users of my application to develop some extentions of this only application writting Java code. This is difficult because I must develop a whole framework beneth and give the instructions to the users about it to write code that extends my application without the main binary distribution be change of. You know, that many times some of the needs of users need more customization and I am talking about 2000 lines of code until now, that a user-developer that wants customization is very difficult for them. That was the main problem that I have, and I thought that something like this probably would help.
Anyway, IF you have any suggestion about it, please reply me again!
Thanks for your time! Nik
Joined: Mar 22, 2005
Why don't you make the classes/methods a user/developer should use to extend your app public, and ship the javadocs -which describe how to use them- with it? As long as they have the jar file, they can simply include that in their classpath.
Or are you thinking about a plugin mechanism where your code needs to call routines users/developers have written?
Either way, using/calling your classes and methods is not a problem.
You want to allow users to "extend" or "customize" your Java application? Can you explain what sort of extensions you have in mind? How sophisticated are your users? If we know what you have in mind, we can give better suggestions. Note, by the way, how far this topic has come from the first post in this thread. This suggests that rather than just asking a specific question taken out of your problem context, you should be brief but also always indicate what you are trying to do, what your goal and context are, in the first post.
Plug-in designs always make Dependency Inversion pop up in my head. At about slide 20-25 that presentation has some pictures that might look like what you're trying to do.
You hit on the points of documenting how to extend your system and making it easy. Those are certainly challenges in designing the interfaces that any extensions must implement. I don't have any concrete suggestions except to keep the poor extension coder in mind. Oh, and keep those interfaces stable! Any time you change one you upset your whole extender community!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Nov 27, 2004
Thanks all of you for your replies,
I think the extention policy in java s/w related distribution is something that all of us has get ,at least 1 time, in mind...
I know that maby the extention mechanism is something that needs attention because , as you said, if the extention mechanism is change, the extention community of the users-developers would messed up in s/w updating.
I usually use obfacators because, in a past project of mine, I saw changes on the source code, for customization, in many users that means:
=>someone changed the source code for his custom needs, and gave this to the others that they had many problems in their database due to this customisation of the code...
So,I am thinking about an extention mechanism that the customization can't give such problems, except the open-architect of the mechanism created by the users...