Tuesday, July 25, 2006

Tapestry Overview

When I was primarily doing struts and jsp development, I remember reading all these stellar Tapestry reviews and feedback, and was really planning to look into it a little further. In a few instances, I did look into the regular examples that were out there; however, at the time, I was not particularly impressed with it (that was before I looked at JSF). I mean that the syntax seemed to be pretty straightforward; however, there were all of these page and component definition descriptors that seemed to make things so much more verbose ( in a retrospect, I have to admit that at the time I was definitely not getting the idea of what a component oriented framework was all about).

So, maybe a year ago, I was a bit bored with what I'd been learning at the time ( I was kinda stuck in a rut and didn't seem to be learning much beyond the standard Struts/JSP stuff). So, I decided to learn about JSF, since it was a Java standard that seems to be pickup up speed pretty nicely. So, I sat down , read a couple of books on JSF and implemented a couple of projects with it at work and at school. It was definitely an improvement over Struts and a good learning experience. However, along the way I got to learn a couple of the not-so-savory sides of it as well. One of my biggest compaints is that it really smelled of a framework that was designed by a committed : the really simple stuff worked really nicely, it was easy to pick up and learn about; however, as soon as you started doing something not trivial (and I do mean it, not simple, but definitely not difficult stuff - e.g. selecting a row from a data table), you were immediately going up the creek... Although the framework was supposed to abstract you from the http implementation, I found myself having to deal with sessions, http requests and params, almost the same as struts... Somewhere along the way, I encountered Facelets, which was definitely an improvement over the standard JSF implementation and it was then when I realized how nice it was to have plain html implementation of the view using an extra html property for the tag to indicate framework components.

So, about a month ago, after listening to a JavaPosse interview of Howard Lewis Ship I finally decided to really give Tapestry a go. And so far, my impression is "WOW, what a refreshing and nice way to develop web apps". Although, there are a couple of things to learn from the get-go about how to start writing a Tapestry web app, after the initial slight learning curve, writing an app is really, really nice and easy. Especially now that with Tapestry 4.0 the xml descriptors can be by Tapestry annotations inside the actual page or component class makes it a less verbose.. Overall, the impression is that Tapestry came out of a practical need and evolved fulfilling all of these practical needs to make web app development more predictable and productive. Additionally, unlike JSF, Tapestry is not trying to do too many things in addition to simplifying web app development (e.g. JSF is trying to be able to have different view implementation by switching view handlers to do html, wml, and telnet). Thus, Tapestry is not unnecessarily complicated by 'possible' problems that one might have to solve when implementing web apps.

In summary, I will probably try to see what else Tapestry has to offer. So far, I really haven't have had to deal with any of the standard http/web protocols and it has been so wonderfully handled by the framework. The other day, just in a few hours, I was able to reimplement a struts app with Tapestry in a few hours. Additionally, what would have been really messy to implement before was really easy now and I found myself implementing new features that I had been thinking about in a very long time but never went ahead with it because of the mess I'd have to deal with had I had to do it in Struts. The only problem that I have encountered so far was that when I was deploying a tapestry app in JBoss 4.0.4RC1, it was giving me some errors due to the hivemind libraries being loaded multiple times (not a problem in Tomcat, as JBoss has a funny way of handling classloading). Finally, the 4.1 Tapestry release, promises a whole bunch of AJAX features that only vendor specific JSF implementation like Oracle ADF seem to offer ) and I'm really looking forward to seeing what it will bring to the table.

jFreeSafe updates

I had been thinking for a while now to sit down and make some updates to jFreeSafe, and today I finally did it. The changes in themselves are nothing particularly exciting or difficult, but they were just 'nice-to-have'-s that I wish I had when I first installed the application.

My initial take was to modify the existing PasswordEntry and make the password field there to be a TextField.ANY and make it a bit longer, so that I can store more unstructured information. Actually, I used it to store CC stuff in it. Now, with the new entries, here is how it plays out:
1. CreditCardEntry : has detail fields for a bunch of common properties for a credit card (e.g. CC#, exp date, customer service number, etc).
2. NoteEntry: basically, a very generic note that has a name and allows for a long, unstructured note (actually, each entry has a long last field to allow any unforeseen types of data to be stored in it)

Below are the screenshots:





Thursday, July 20, 2006

Tapestry NetBeans plugin

I've read up a bit on Tapestry and I've followed Geertjan's blog for quite a while now. I've been a NetBeans fan for quite a while now (since 3.5), and Geertjan's blog has been really eye opening in what is possible with NetBeans. So, a while back, he was really excited about Wicket, and he started working on a plugin for developing Wicket apps in NetBeans. It appears that in the last few months, with the help of Petr they've built quite a nice set up to support Wicket in NetBeans.

What that means about me is that I will try to do something similar, but with Tapestry. What I will try to do is to develop a plugin that will support Tapestry development in NetBeans. Geertjan has already done most of the work here as he has covered a lot of the topics that are required to build a nice web framework support plugin for NetBeans. At the same time, as he seems to point out in one of his latest entries, the information that is required to build such a plugin is either scattered all over the net (or the NetBeans.org site), or is in the source code for his Wicket support plugin . Now that I'm trying to organize my thoughts about this project better, I start noticing that he's also done a great job of documenting his work and his progress along the way. However, I guess giving it a second run wouldn't hurt anyone.

I will probably try to put up a post that would list the proposed features for such a plugin. However, the idea is that the plugin should make working with Tapestry easier, maybe even to the point of not having to know all the nitty-gritty details of exactly how Tapestry works. It should probably have all the nice features of the Wicket plugin, translated into the Tapestry world.

One thing that I've considered in the past is to dig into the Spindle project (which is an Eclipse Tapestry support plugin which has an Eclipse specific and an Eclipse agnostic part) and try to adapt it to work for NetBeans. Now, the thing is that part of my goals includes learning the NetBeans APIs along the way. So, while sometime down the road, looking into using the Spindle implementation and putting up a NetBeans frontend to it would make sense, it appears that for now it would make the most sense to see about implementing the basics in NetBeans only...

I will also probably post more details on the steps required to accomplish this; however, after a few hours of playing around with NetBeans, the tutorials on the site, Geertjan's tutorials, as well as the NetBeans APIs, I've put together the first few things for the plugin... Here are a couple of screenshots that just give me an enormous adrenaline rush...


First, a blank Tapestry project, set up and ready to go (I wish I knew how to do this a while back at work, as with both Tapestry and JSF/Facelets I've always kept referring to a sample project that I know it works when I've done new projects...):


Geertjan is probably going to laugh at this one as this is dirt simple to do, but damn, it is nice to be able t accomplish this.




The next one is showing how the Tapestry framework is added to the list of supported frameworks in a standard NetBeans web project. I admit right off the bat that I took all the code from the Wicket plugin and replaced all references to Wicket with references to Tapestry. I still need to remove some of the config options here that really have nothing to do with Tapestry, but this is a very nice start (I was initially having some trouble getting the framework support in - I spent a good number of hours until I found out exactly how to register the framework in the IDE).





The last one is a list of a couple of new file types added to a project. Most likely, I will have to restrict them to Tapestry projects only, but it's a nice start again. THere is more work to be done to maybe create a graphical customizer for a Tapestry page, but still.. I'm pumped.. :-)


Wednesday, July 12, 2006

JFreeSafe mystery continued...

Alright, this is a conspiracy. Up until yesterday I was having so much trouble getting JFreeSafe to work properly. For starters, I checked out the sources from cvs (assuming it was the latest version). Now, (unwisely), my initial take was to create a NetBeans J2ME project out of the existing source so that I could reuse all the goodies that my favorite IDE offers. That didn't work...class not found errors in the preverification step

Next step, was.. OK, it must be something with NetBeans, let's try to do the ant build that came with the source. I changed a couple of things in the build.properties (after checking with Laszlo, the lead of the project, it turned out that I was supposed to create a build.local.properties file which seems to be the convention) and attempted a build... and I was in trouble. First, I was getting some obfuscation errors telling me that some classes were missing.. So, I started digging in, trying to find out what's going on.. I removed the test package from cldc-crypto.jar (actually, org.bouncycastle.crypto.test), the class not found error disappeared. I actually had a good jar; however, when I attempted to install it on the phone I was getting a funky "invalid jar" error...

This is where the real hell started.. First, I thought.. it might be something in how jdk 1.5 created the jar (since the original jfreesafe distribution was build on Linux with Blackdown java 1.4.2, and I was trying Sun Java 1.5.0_3). I downloaded the latest update (1.5.0_6), same deal... I tried creating the jar with 1.4.2 sun jdk.. same deal.. I was starting to get desperate as it was getting to be almost 2 am in the morning, I had to get up at 6:30... and I still had nothing working... Oh, well, some things NEVER work on the first day you try to get them to work, no matter how hard you try...

So, the next day, I'm at it again. This time around, I tried the build on a windows box at work.. I was getting a preverification error as before.. and I didn't have much time to play around with it. So, at home, I try a different angle. I poked around the manifest and the jad files to verify that everything is kosher there. I did notice that for some reason the build was creating duplicated Manifest files inside the jar. However, deleting and attempting the reinstall didn't do much. Finally, I did notice a note on the project home page that some people were having a problem with installing 0.2.6.1 and the suggestion was to try 0.2.7.

So, I take 0.2.7 with the same expectation. However, with the first try (after modifying the appropriate properties to point to my wtk 1.0.4 install) it build the first time and successfully install... Voila!!! I was in business again, made the quick modification to the java class that was displaying the passwords, rebuilt, put it on a server, connected to my wlan (btw, my Nokia E61 ROCKS!!!), downloaded and installed the jar, everything works perfectly...

So today, encouraged by yesterday's success, I try to create an NetBeans project based on the existing 0.2.7 sources. Now, even without making it point to the wtk 1.0.4 install (using the default wtk 2.0 setup in NB), it built and I was able to successfully install on the phone... Hm... So, I try it again, this time with the same project that I was having problems previously, the 0.2.6.1 sources.. I used the same NB project from a couple of days ago: build, run, deploy, install on the phone... and IT WORKED !!! Now this is strange, the stuff that didn't work the other day works now...

So, now, I'm completely stumped as to what was exactly causing the problem before. The important thing is that I have the program running, I have a good NetBeans J2ME project that builds and installs successfully, which is an excellent prerequisite to getting some work done on this project.

For starters, I would want to add a few different types of data to be added. Currently, it only has a OTP type - not sure what that means, and a password type - for system/username/password. Since I sometimes put some credit card info in there, that probably one of the types to add - e.g. cc#, exp date, stuff like that in separate fields. The other type is just a "free" note type - something without any additional fields defined. Today, I was also thinking about adding some categories to the entries - e.g. I have quite a number of entries in the app and the list becomes quite long, so a "categorized" mode of display would probably be helpful as well.

Laszlo had mentioned in the forums that he is adding the ability to preserve the data across upgrades and installs, which would definitely a must ( I don't think I want to spend a few hours keying stuff on my phone every time something is upgraded). Additionally, along the same lines, it would probably be useful to have some way of entering the data to be put on the phone in a regular app (or just a csv file or something) and be able to "import" the data into the phone. Finally, Laszlo already has a "server" part of the project (I haven't had a chance to look at the details), and it looks like this will be covering the richer interface/synchronization uses that I mention.

Anyways, I'm looking forward to getting some stuff done with this app. It hasn't had releases in a while. I understand how things are sometimes - when it's just you working on a project, sometimes it's difficult to get motivated and excited, and to put out a release.

Now, just before I posted this, I just found out that Laszlo has a blog on JRoller: check it out - http://www.jroller.com/page/atleta

Tuesday, July 11, 2006

JavaPassion Web Services Programming Course

I will be enrolling and will try to follow this course: Web Services Programming . I am just totally amazed that such a resource is available for free - and, really, for me, that is the best way of learning. I've determined for myself that classroom learning is very inefficient for me : e.g. if the students are not carefully pre-selected to have skills/knowledge on the same level (which usually is not the case), the instructor just ends up spending 90% of the classes teaching to the lowest common denominator.. and in the end, I just end up being bored to death in the actual classes. So, I started looking around if there is a web services class somewhere online (e.g. there are supposed to be these online universities that offer all kinds a classes).. but guess what, nothing is available. There are a number of J2EE/Web services training courses, but you have to go to their training facility (big $$$) or they have to come to your company (bigger $$$). So, it doesn't work for me.. So, I couldn't find an online course that would offer the depth that I need... it's funny, cause I'm willing to pay (actually, through the company) a decent amount of money to get a decent course..

So, this is the best. I really probably should suggest to the instructor in the course.. I don't see why Sun shouldn't make a couple of bucks off of this... Maybe have some kind of "premium" subscribers that might get extra attention... Something like that...

Free Safe

Free Safe is an awesome j2me program that does password encryption and management on a mobile phone. Now, I had something similar on my Palm Zire; however, now that I switched to my Nokia E61, I really miss having access to all of my passwords (e.g. the other day, I was in the bank and I was trying to remember my account number..). This app provides a decent level of functionality and with a couple of enhancements will be doing exactly what I need it to do... Swweeet....

Popular Posts

Related Posts with Thumbnails