Comments
Matt McLarty wrote: For more info... Follow me on Twitter See our website
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..
SYS-CON.TV
Today's Top SOA Links


How Many Frameworks Does It Take to Retrieve Orders?
I’ve been working on an application that was supposed to display a list of orders form a relational DBMS

I don’t like most of the Flex MVC frameworks because they force me to write more code. I do like frameworks and tools that let me write less code. But there is no free lunch and, at some point,  even productive frameworks, tools, and libraries reach critical mass and the finger pointing game begins.

Today, I’ve been working on an application that was supposed to display a list of orders form a relational DBMS. Not a rocket science.  But let’s go over the languages, libraries, tools, and frameworks I had to use for this.

First, I wrote a 20-lines SQL Union statement and tested it in Oracle’s SQL Developer.  Then I generated 80% of the code and wrote the other 20% manually. Here’s what I was using:

  1. Eclipse IDE for Java EE Developers (Eclipse Foundation), which comes with the WTP plugin
  2. CRUD code generator Clear Data Builder (Farata Systems). It generated the initial application written in Java, ActionScript, MXML. It also  ANT build script
  3. Configured Apache Tomcat (Apache Foundation) to run from inside Eclipse – this is where my rich Internet application is deployed.
  4. Added to the project the libraries of MyBatis (Clinton Begin and Apache Foundation). This is a light-weight data mapping framework. You map manually written SQL to a Java DTO, which eliminates the need to write JDBC.
  5. Spring Framework (Spring Source)  was used to simplify wiring of MyBatis into my Java applications.
  6. BlazeDS framework (Adobe) is being used for efficient serialization of the server-side Java into client-side ActionScript objects and back via AMF protocol. This exchange happens between the peer ActionScript/Java DTOs.
  7. The ActionScript DTOs where automatically generated based on their Java peers by the DTO2FX tool (Farata Systems)
  8. Most of the Java code was generated, but I had to write small fragments to be called for data manipulations via SQL/MyBatis
  9. The latter would engage the Oracle driver and DBMS (Oracle)

Everything’s ready. Start the server, run the Flex app, and...instead of data I’m getting this error ” org.springframework.jdbc.UncategorizedSQLException : Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type”.

This error message is misleading.  I do insert parameters to the SQL Select, but they are not nulls. I don’t insert anything into the database. The worst part is that there is nothing left to debug.  Everything up to the last SQL-annotated Java method declaration works fine. But you can't debug a method signature, can you? Who is to blame? Oracle driver? Or should I get the source code of MyBatis trying to find the line of the code that blows up?

Enough for today. Going home. I don’t know what’s causing this issue, but I I’ll find the solution. The only question is how much time I’m going to spend on it.  Are all these productivity frameworks and tools really save time in the long run? Would I be better off writing JDBC code manually? AS a matter of fact I like MyBatis a lot better than Hibernate, but still…Where are the time savings?

Read the original blog entry...

About Yakov Fain
Yakov Fain is a Managing Director of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Yakov co-athored the O'Reilly book "Enterprise Application Development with Flex". He twits at twitter.com/yfain.

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE