Forgot one part to configuring the server, you should add a line for every bean with the full path:

[Objects]
COM=
JAVABEAN=
TCF=

[COM]
RULE=all

[JAVABEAN]
RULE=all
BEANPATH=c:\program files\witango\server\beans\widgets.jar
BEANPATH=c:\program files\witango\server\beans\directory.jar

[TCF]
RULE=all


Also, you can download my project files at http://public.bighead.net/workday/

Robert.

On Saturday, July 5, 2003, at 03:35 AM, Robert Garcia wrote:

OK,

After hours of pulling my hair out getting beans to work on the server, and Dev Studio for OS X, I was able to duplicate the same test with a Java Bean. I have been waiting to use beans for quite some time. There is little to no docs on how to implement them in v5, and some obstacles that I would swear WithEnt put there just to mess with my head!

First: The Final Results.

The test was to calculate the number of workdays between any two dates, and the algorithm used was to loop through each day from the start day to the end, and add the workdays one by one. Yes, there may be another more efficient algorithm, but that was not the point. The <@timer> tag was used on all 4 tests to measure the elapsed time. Tests run with Witango server v5.01.058 on Windows Server 2003/IIS 6 AMD 2000+(1.6ghz) 512megRam 266FSB.

(note for the truly geeky: I found in my research, that there isn't only leap years, but leap seconds that are added every few years, and very few programming languages take them into account, go figure.)

-------------------------------------------------------
The TAF.
Start Date: 1/1/1910
End Date: 12/31/2035
Elapsed Time: about 15 seconds on avg.
Start Date: 1/1/1910
End Date: 12/31/2500
Elapsed Time: 103 seconds.
Note: The algorithm is completely done in the taf with standard witango tags.
-------------------------------------------------------
The TCF.
Start Date: 1/1/1910
End Date: 12/31/2035
Elapsed Time: about 16 seconds on avg.
Note: The instantiation of the object only took a fraction of a second, even so, the object was created in domain scope, and only subsequent tests were counted, so slightly higher time is not due to object creation. WithEnt has definitely optimized the TCF object creation methods.
-------------------------------------------------------
Witango Helper.
Start Date: 1/1/1910
End Date: 12/31/2035
Elapsed Time: .158 seconds.
Start Date: 1/1/1910
End Date: 12/31/2500
Elapsed Time: .68 seconds.
Start Date: 1/1/1910
End Date: 12/31/3500
Elapsed Time: 1.8 seconds.
Note: The TAF passes properties to the RealBasic app through an HTTP Request, and runs same algorithm and returns results in a properly formatted http response.
-------------------------------------------------------
Java Bean.
Start Date: 1/1/1910
End Date: 12/31/2035
Elapsed Time: about .137 seconds on avg.
Start Date: 1/1/1910
End Date: 12/31/2500
Elapsed Time: .87 seconds.
Start Date: 1/1/1910
End Date: 12/31/3500
Elapsed Time: 2.44 seconds.
Note: The Bean takes the longest to instantiate. About a second. Definitely should instantiate beans one time, and hold object in app or domain scope. Test did not include instantiation.
-------------------------------------------------------
Final Notes: The RealBasic app is native code, but is slower on the smaller date gap. This is due to the overhead in the RB app where the app has to parse an http request, decode URLencoded args, run the process, and prepare http response. The greater the gap, the more the RB app wins. But the JAVA bean is faster than I expected. The new work done by WithEnt is obvious, and I am excited about it. Although If they lived close, I would be deliverying to them about 30 or so anchovy pizzas and stiffing them with the bill to get them back for the lack of documentation, and other anomalies (more on that later).

I would not consider myself a pro java developer. I am not a novice, but not much better. I would consider myself a pro at witango and RB. I looked at the "directory" bean from Kevin Boydstrum (Thank You.) to see its structure, which was incredibly more simple than I expected. I used Apple's Free Dev tools to quickly duplicate the algorithm and test in the OS X Dev IDE. It is an excellent environment for this, and I highly recommend.
-------------------------------------------------------
Conclusion: According to Phil, we will soon be able to compile TCFs into Servlets to deploy to J2EE, which is good news, and should mean that they will run as beans in the Witango env. This means my Pie in the Sky dream, is actually a near reality.

Now that I have judged the bean, and being mexican I should have an affinity for the bean, I now embrace the bean. I plan to move all of my current TCF methods to beans, and go through my critical apps and move as much code as I can to beans.

I will look at development on Witango in a whole new light. I will use the TCF to prototype my methods, and once they are ready, I will duplicate the methods in beans for deployment.

IMHO, this puts the Witango Development/Deployment model up there, and surpasses the WebObjects, and other JSP/J2EE models. As long as WithEnt can keep it robust, it will have near the same level of performance, and far superior RAD development and app prototyping.

In the near future, I am going to be exploring more complex beans, passing arrays back and forth, and using beans to do some serious work. I have a lot of experience with the Quicktime API, so I see a great opportunity to create a bean that does imagemagick type work.
-------------------------------------------------------
Some Tips on How to get Beans to Work:
On the windows server, download the latest JVM, or J2RE and install. Set the system classpath to c:\program files\witango\server . This is done by right clicking on "My Computer" and clicking the advanced tab, and clicking the "environment variables" button.

Read the readme for the server (058) and make sure the witango.ini has a property "JAVAVIRTUALMACHINE=" pointing to your JVM. Mine is: C:\Program Files\Java\j2re1.4.1_03\bin\client\jvm.dll
Open the handlers.ini file, and add the line "LoadHandler=1" to the [JAVABEAN] stanza. Also, and here is the part that cost me hours, and made me curse all things australian, check the line in the handlers.ini file that looks like this:
C:\\Program Files\\Witango\\Server\\W3HBN601.DLL
This looks correct, but when I continually restarted the service, the JVM was loading ok, but the bean handler plugin was not loading. Finally, after looking real close, I realized that the path in the file was wrong. WithEnt must have a new version of the bean and com handlers they were planning to ship but didn't. The line should read:
C:\\Program Files\\Witango\\Server\\WSHBN501.DLL
Once I figured that out, it all worked on the server.

The OS X Dev studio was a different story. I actually called phil on his saturday, and he gave me a newer version of the studio, but nothing worked as it was supposed to no matter how many different things I tried, and no matter how many clean installs. SoI looked at the Directory.taf from Kevin Boydstrum (once again thank you) and I edited the XML directly in my new taf for the create object, and used the <@callmethod tag for the method.

If anyone has gotten Beans to load in the OS X dev studio, call me anytime! I will be posting my source code for this widget, and I will also post my ProjectBuilder project for those who have OS X.

Lastly, for those of you who criticized that this thread was not going anywhere or going to provide any valuable info to the witango community, I have to say it, bite me. ;-)

Time for Bed.

--

Robert Garcia
President - BigHead Technology
CTO - eventpix.com
2781 N Carlmont Pl
Simi Valley, Ca 93065
ph: 805.522.8577 - cell: 805.501.1390
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/ - http://theradmac.com/

--

Robert Garcia
President - BigHead Technology
CTO - eventpix.com
2781 N Carlmont Pl
Simi Valley, Ca 93065
ph: 805.522.8577 - cell: 805.501.1390
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/ - http://theradmac.com/

Reply via email to