Links for May 29th through June 2nd

Daily del.icio.us for January 22nd through January 23rd

  • AWS Elastic Beanstalk: A Quick and Simple Way into the Cloud – The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming
  • It is not the critic who counts … – The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming
  • Git Immersion – Brought to you by EdgeCase – Git Immersion is a guided tour that walks through the fundamentals of Git, inspired by the premise that to know a thing is to do it.
  • Unofficial JAXB Guide – Mapping interfaces — Project Kenai – Because of the difference between the XML type system induced by W3C XML Schema and the Java type system, JAXB cannot bind interfaces out of the box, but there are a few things you can do.
  • SQLContainer 1.0 Released – Blog – vaadin.com – The SQLContainer is an add-on for Vaadin, that implements the Container interface for standard SQL database servers. SQLContainer allows you to easily bind data stored from an SQL database to Table and Select components, as well as edit the data using Form
  • Mysema Blog: Querying in SQL with Querydsl – Querydsl provides a typesafe querying layer on top of JPA, JDO, JDBC and other backends. This blog post presents a simple tutorial on how to get started with querying in SQL using Querydsl.
  • Seven Things: Home – Lift gives you the above Seven Things, plus your code is concise and maintainable, Lift's performance and scalability, and all the benefits of deploying your application on battle-tested J/EE infrastructure.
  • dzone.com – Guess what programming language grew most in popularity in 2010? – TIOBE Software published its annual TIOBE Programming Community Index. The ranks are led by the usual suspects Java, C, C++, and PHP. But the language that grew most in popularity in 2010 was a bit of a surprise:
    Python
  • CodeMirror – In-browser code editing made bearable – CodeMirror is a JavaScript library that can be used to create a relatively pleasant editor interface for code-like content ? computer programs, HTML markup, and similar
  • SchemaSpy – Graphical Database Schema Metadata Browser – SchemaSpy is a Java-based tool (requires Java 5 or higher) that analyzes the metadata of a schema in a database and generates a visual representation of it in a browser-displayable format.
  • Active-Active Configuration: Spring Note: SqlUpdate – The org.springframework.jdbc.object.SqlUpdate class is another tool that I use a lot. This class encapsulates INSERT, UPDATE, and DELETE queries as beans defined within your application context.

Life is beautiful with XMLBeans and XStream

XML creation, parsing and processing with Java has gotten so much easier with tools like XMLBeans, XStream and many other such tools. I personally love XMLBeans and XStream and I try to use them for all of my XML processing needs. While they both consume XML, they solve different problems. XMLBeans allows you to process XML by binding it to Java types using XML schema that has been compiled to generate Java types that represent schema types. XStream on the other hand allows you to serialize objects to XML and back again using special reflective secret sauce.

I’ve been using these tools for many years now and so you tend to forget just how useful and powerful they are and how productive they make you. Case in point – A friend of mine came to me for help. He was building an application that would allow him to resale items from Amazon on his site and he wanted to use the Amazon eCommerce Web Services to search for products programmatically and update a local database that housed his content. Having played with Amazon E-Commerce Service (ECS) before, I offered to write up a simple application that would make the Web Services call, process the results and present them back to you.

Amazon’s ECS is an API that allows you to access Amazon data and functionality through a Web site or Web-enabled application. ECS follows the standard Web services model: users of the service request data through XML over HTTP (REST) or SOAP and data is returned by the service as an XML-formatted stream of text. In addition to the WSDL, ECS also provides XML schemas for validating the XML output of REST requests. So I decide to use XMLBeans to create my type system using the XML Schema provided by Amazon. XMLBeans provides you with a utility (scomp) to compile your schema into Java XMLBeans classes and metadata. To generate the Java code, use the following command:

scomp –jar amznws.jar AWSECommerceService.xsd

This generates a jar file named amznws.jar, which will contain all of the code needed to bind an XML instance to the Java types representing your schema. In my application, I use HttpClient to make my REST request and then use the XMLBeans generated jar file to process the result. Here’s a snippet of code from my sample class:

https://gist.github.com/311527.js

As you can tell, HttpClient makes the REST call a snap and XMLBeans makes processing the results easy as well. In total, I spent 3-4 hours getting the application working and a lot of the time was spent figuring out the data set returned from Amazon and trying to come up with a meaningful example. Here is a zip file with the IDEA project that has all the stuff needed to make this work including a simple JSP and a JUnit test class.

Links of Interest:

Top Financial Firms Architecting with XML

Found this item on Robin Cover’s must-read XML.org Daily Newslink. Last month, Reuters unveiled a new XML-based secure trade notification system that enables financial institutions to manage their trading capital and risk exposures better as well as improve operational efficiency. Reuters’ service, already selected by Lehman Brothers, offers a trade messaging hub to make a variety of financial integrations easier and cheaper. At its core, Reuters Trade Notification Service (RTNS) is a trade messaging hub that facilitates the electronic transfer of all trade related messages. The service is already operational and is undergoing a controlled introduction. RTNS will initially focus on trade affirmation and confirmation, and will be expanded to cover allocation and settlement instructions, amongst others. The service will support industry standard message formats such as FIX, FPML, as well as FIX and TWIST. FpML provides an overall template for execs in other vertical industries how they might map XML (schema and transmission) concerns to their needs for dataflow, business rules and access control. The FpML standard, which is freely licensed under the FpML public license, is intended to automate the flow of information across the entire derivatives partner and client network, independent of the underlying software or hardware infrastructure supporting the activities related to these transactions.

Links of interest: