Daily del.icio.us for August 30th through September 9th

  • Implementing composite keys with JPA and Hibernate – Occasionally, you come across a situation where a composite key is required, and you need a strategy for this. This tip shows you how to implement composite keys with JPA and Hibernate.
  • A Simple Java class for Amazon SimpleSQS – With such a beautiful service such as the Amazon Simple Queue Service, it shouldn't be wrapped up with a lot of complicated layers of classes for utilizing. That is why I developed the simple POJO, single class method for utilising Amazon SQS from within Java
  • Welcome to Solr – Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface and many more features
  • Scrummerfall « Tales from a Trading Desk – Scrummerfall. n. The practice of combining Scrum and Waterfall so as to ensure failure at a much faster rate than you had with Waterfall alone
  • Generate PDFs with XStream and XSL-FO – In this article, you saw how easily you can create a PDF document from Java business objects using XStream and XSL-FO. The separation of concerns allows you to isolate the view from the business objects, thus you can change the view (PDF document) without having to modify the Java code
  • log4jdbc – JDBC proxy driver for logging SQL and other interesting information – log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.
  • beet – Beet records user behavior and performance data for your Spring-based Java application. It can thus help you to analyze usage patterns and research production performance issues.
  • Prototype JavaScript framework: Prototype 1.6.1 released – We’re pleased to announce the release of Prototype 1.6.1 today. This version features improved performance, an element metadata storage system, new mouse events, and compatibility with the latest browsers. It’s also the first release of Prototype built with Sprockets, our JavaScript packaging tool, and PDoc, our inline documentation tool.
  • InfoQ: Hypertable – An Open Source, High Performance, Scalable Database – This presentation discusses Hypertable, an open source, high performance, distributed database modeled after Google's Bigtable. Doug discusses the differences between Hypertable and traditional database technology, support for massive sparse tables, scaling to petabytes size, and how Hypertable is designed to run on top of an existing distributed file system, such as the Hadoop DFS.
  • Clojure vs Scala, Part 2 | Code Monkeyism – There are two languages stirring up the Java World: Clojure and Scala. Clojure a Lisp dialect on the JVM, powerful and pure and the Scala language a tight integration of object and functional programming. Which should you learn?

Daily del.icio.us for May 7th through May 9th

Daily del.icio.us for March 24th through March 27th

  • JPivot – Home – JPivot is a JSP custom tag library that renders an OLAP table and let users perform typical OLAP navigations like slice and dice, drill down and roll up. It uses Mondrian as its OLAP Server. JPivot also supports XMLA datasource access.
  • olap4j: Open Java API for OLAP – olap4j is designed to be a common API for any OLAP server, so you can write an application on one OLAP server and easily switch it to another. And built on that API, there will be a growing collection of tools and components
  • Mistaeks I Hav Made: Mapping Inheritance Cleanly with XStream – This works with multiple subclasses and with SingleValueConverters. As long as you can determine the concrete type to be unmarshalled from the contents of the marshalled element, you can use this technique to elide the class attribute and get cleaner XML.
  • Amazon Web Services: No Open Cloud Manifesto for us | Between the Lines | ZDNet.com – Amazon will join Microsoft as two big cloud computing players not signing on to the Open Cloud Manifesto.

    The manifesto, which has raised a ruckus following a Microsoft blog post, is set to be released Monday with IBM as the ringleader. Given the hubbub it was only natural to wonder where Amazon Web Services, one of the premier cloud computing players stood

  • MapReduce programming with Apache Hadoop – JavaWorld – Google and its MapReduce framework may rule the roost when it comes to massive-scale data processing, but there's still plenty of that goodness to go around. This article gets you started with Hadoop, the open source MapReduce implementation for processing large data sets
  • RSS to PDF Newspaper – This is a free software project to let people create printable PDFs from content found on the web. It is a free alternative to HP's Tabbloid service. It is being developed as part of the Five Filters project to promote alternative, non-corporate media.
  • Oracle: If RHEL were free, we wouldn’t compete | The Open Road – CNET News – Now we find out that it's not a question of support at all, but rather that Oracle simply wants Linux to be free. Why? Because that makes its overpriced software seem cheaper.

    At least Oracle is being honest now. Coekaerts' argument is cheeky, but it makes strategic sense for Oracle. It just makes no financial sense for Red Hat.

  • Ubuntu promises DIY Amazon cloud • The Register – The Jaunty Jackalope edition of Ubuntu, version 9.04, due in April, will let you take existing Amazon Machine Images (AMIs) from Amazon's Elastic Compute Cloud (EC2) and run them on your own Ubuntu servers.
  • Book Review: Pragmatic Thinking & Learning – Andy Hunt, co-author of several titles in the Pragmatic Programmers series, has turned his pragmatic prism on our brains. His new book, Pragmatic Thinking and Learning: Refactoring Your Wetware, is a delight to read, provided you understand the vocabulary of agile development. It could be a perfect gift for your favorite geek this holiday season.
  • jaxb: A JAXB Tutorial – Wolfgang Laun has created an outstanding tutorial. Wolfgang’s tutorial is possibly the most comprehensive (and most current) information on every aspect of JAXB. I highly recommend it both as a getting started guide and a reference.

Daily del.icio.us for February 10th through February 14th

Daily del.icio.us for May 25, 2007

Daily del.icio.us for May 22, 2007 through May 25, 2007

Declarative Caching Services for Spring

Declarative Caching Services for Spring by Alex Ruiz — Caching is an essential practice that improves the performance of enterprise applications. In this article, Alex Ruiz demonstrates a declarative caching framework for Spring 2.0, which supports pluggable cache implementations.

spring, spring2.0, caching, aspectj, AOP, SpringAOP, XStream

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: