Moderator (MDR): SPK-jaz
SPK-jaz: Greetings and welcome to the Training Office Hours for the online JavaBeansTM short course. I'm John Zukowski from MageLang Institute, and I will be available to answer questions during the next hour or so. Do you have any questions about the course, or about Java in general?
grao: I am not getting any material that indicates how JavaBeans are used in different languages.
SPK-jaz: By different languages, do you mean English/Spanish or Java/C++? Did you mean integrating Beans into other languages or using Beans in multilingual programs?
grao: Like C++, JavaScript, etc.
SPK-jaz: With the help of the ActiveX bridge, you can use Beans as ActiveX controls. If you don't want to use ActiveX, you are left with JNI, which is used to integrate Java with other languages--no differences there. Regarding JavaScript/Beans interactions, again, there is nothing special about Beans that makes it different from a regular Java program.
grao: What is JNI? Is it native methods?
SPK-jaz: JNI stands for the Java Native Interface, which is a well-defined API for interfacing with native code.The interface changed between 1.0 and 1.1, and Microsoft supports something else entirely. For information on JNI (including a tutorial), go to http://java.sun.com/products/jdk/
1.1/docs/guide/jni/index.html And, yes, it is native methods. What are you trying to do that you need to interact with native code?
grao: Presenting JavaBeans (Michael Morrison) gives one or two examples of how Beans properties can be changed in Java, C++, and JavaScript languages. I want to see more of similar examples. I am giving a presentation to my business department. I have to drive the point home that once we build our products using JavaBeans technology, we can tell the world that they can use it in any language.
SPK-jaz: I'll make a note of it and look into creating something about it for the JDC. It's a good idea.
There is an example of integrating Beans with Visual Basic in O'Reilly's Developing JavaBeans (Rob Englander). I don't have Presenting JavaBeans though, so I can't compare.
grao: I have seen that book, but that book's example is no different from using a Bean through Visual Cafe GUI environment, or any other GUI builder tools. Do you agree?
SPK-jaz: Maybe I need to know more about what you are really after.
grao: I am looking for something where I write a piece of code myself for changing properties of a Bean--of course, in different languages.
SPK-jaz: It sounds like it is outside of a GUI tool?
grao: Yes, that is right.
SPK-jaz: Not to knock what you are trying to do, but the whole purpose of Beans is to be used inside of a GUI tool
grao: But that would not sell with nontechnical guys. Their response is: if you are claiming it is not only platform-independent, but also language-independent then show me an example by integrating it into some piece of code like Pascal, COBOL, etc.
SPK-jaz: There is an example of integrating Java and COBOL in Eye on Objects. Go to http://eye-on-objects.com and select the archives for March 1. I haven't seen one on Pascal/Java yet. All I am trying to state is there is nothing special about JavaBeans to integrate with these other languages. You basically are doing Java/Pascal or Java/COBOL integration.
You need to look for information on just regular Java/3GL integration. So, what else are you doing with Java?
grao: I want to use JavaBeans technology to build our products, which are just components. (They do not do anything on their own. Some applications have to use these components.) Since JavaBeans is a component technology, it is ideal. If you say there is nothing special about JavaBeans, then why should I use it rather than plain Java. The people who use our components might be using active server pages, or some other scripting languages.
SPK-jaz: If you have already decided to use Java, the purpose of creating Beans vs. creating a Class Library/Package is basically with a Bean, you can more easily use them within a GUI-builder tool. Without Beans, there is no visual integration, its just hacking code. (Hacking code=manually creating it)
If who you are creating the code for doesn't have a GUI-builder tool, they can still use the Beans, they would just have to use them by manually writing the code that a GUI builder would generate when you drag and drop to create the program. A Bean does not have to be a GUI component to be used within a GUI tool.
grao: The whole point is, I want to present the idea that once it is a JavaBean, it can easily integrated, either using a GUI tool, or using plain source code, into different languages and different script languages.
SPK-jaz: A Bean will present you with both options. If what you deliver doesn't have a GUI tool, then the integration doesn't care if it is a Bean. It will be easier as a Bean, since the usage names will be well defined, but it is just like connecting the other language/scripting language to a nonBean Java library. (Change what you deliver who you deliver to.)
grao: I need your help in creating the examples for integrating into different languages (as many languages as possible) inside the source code of these languages.
SPK-jaz: You might also want to look into using CORBA. If you are trying to communicate between different languages, that is another option. However, I don't believe there is any support for CORBA within something like JavaScript or VBScript.
Goodbye and thanks for stopping by, I hope you enjoyed the course.