Jan 24 2008

JSF or JSP/Struts?

Posted in JSF on Thursday, January 24, 2008 at 6:04

I know it is most debatable subject amongst web developers! IMO, JSF is better technology. I have been trying my hands to it for last 6 months and quite impressed with its architecture and phase wise event processing.

I always try to compare software engineering with other engineering branches and feel that still software engineering is evolving. If you notice how a car is manufactured - everything is a component [a well thought and precisely crafted steering wheel, tires, motor engine, seats, outer body]. And, may be each one of them is made up of some other components. For example, motor engine made up of crankshaft, piston, nuts/bolts etc. Now all these components are brought to floor for assembling and care it out to showroom!

This is where software engineering should be evolved to. To churn out more projects in less time & with limited resources, we should focus on component way of development. Assume, as part of our application, if we need to show tree view of user & role association for organization hierarchy, web developer should not spend more time in building java-script enabled tree [as mechanical engineers manufacturing car don’t focus on building motor engine, they just know how to fix it for this car]. If he tries to develop it from scratch, it may take a 8-10 hours for him [assuming he is well versed with java-scripting]. Developing same piece of application with JSF libraries [tree component is off-the-shelf available just customize it for this application] may be accomplished in half time!

Last night I came across a very good blog by Gavin that describes [very precisely] why one should choose JSF over JSP/Struts that has become kinda standard these days.

I guess, that kind of bring an end to this debatable subject [though arguments are still exchanged as you can see in comments]! :)

One response so far

Jan 22 2008

Persisting Japanese Characters in DB using Hibernate

Posted in Hibernate, MySQL on Tuesday, January 22, 2008 at 5:54

I was not able to store user input [with Japanese characters] in database using Hibernate properly. All other data except the field that store data in Japanese format was getting populated fine.

As per the first doubt - did I declare that column to accept data in UTF-8 format? Yes, I have that column mapped for UTF-8 input. In fact, when I entered data using MySQL Query Browser, it is getting stored right.

Second thought was - am I getting uncorrupted data across the layers i.e. from presentation layer -> business layer -> data access layer. That too was correct.

That left me with only one possibility [may not be, but I was under such impression] - when hibernate is trying to persist data into database, it is corrupting it and I am getting garbled values. I’ve got some hint from hibernate tutorial. According that I can specify hibernate.connection.charSet as property in hibernate configuration file. I tried that but no help.

My further search led me to a blog where a solution was suggested by extending MySQLDialect. But if I understood correctly, his/her problem was bit different that what I was facing. I got another hint from the comments on the same blog [though the person who left the comment said it didn’t work for him :-(]. It was a suggestion to supply character encoding to connection URL i.e. jdbc:mysql://localhost/pas?characterEncoding=UTF-8. Lucky enough, it works for me!

After appending character encoding to my connection URL, now I am able to persist data properly!

No responses yet

Jan 21 2008

The Debut

Posted in Events on Monday, January 21, 2008 at 6:41

Wow…!! It’s all set and running. The biggest challenge would be to make it richer by publishing really interesting posts/articles/thoughts.

Yes! I am talking about this site. I was thinking of it for many months. The seed was sowed during my trip to Japan last year in May-June. But it was very vague then. I couldn’t conclude what am I looking for. Moreover I was more focused on family front as I am back home after 2 months and was due for next travel by September. My thoughts and idea became much stronger during my next trip and I decided to start blogging on my own web-site.

I don’t want to blog only. I look at it as a platform to introduce myself to rest of the “virtual” world. I perceive it as a base to launch couple of projects I have in my mind for a while. I want to bring my activities on internet under one roof. And, now that roof is “nirav-patel.com“.

I registered for domain on 14th January, 2008. I am always fond of this day as we do kite flying on 14th January in my home town. I was [rather I am] very new to web-site hosting and working in that environment. Though everything was easily put up on “cpanel”, I was required to explore much before I start the show. For blogging I tried various options - b2evolution, nucleus. They are feature rich tools but I found them more complex than wordpress.

Finally, I am all set and ready to make it large!

No responses yet

« Prev