At long last, an excellent JAXB tutorial

March 24th, 2009

Like it or not, if you’re writing code today you’re going to have to deal with consuming and producing XML. From my experience, one of the best options to manage the heavy lifting surrounding XML. However finding useful information on JAXB is difficult, with various forum posts and mailing lists, most information is out of date. Luckily 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.

nick Entry

Integration with Apache Camel

March 15th, 2009

Some time ago I read the excellent Enterprise Integration Patterns book and I’ve wanted to leverage the concepts detailed in the book in my own work. Eventually I found the Apache Camel project and have been impressed with how quickly I was able to integrate it into my application.

Camel is essentially a message router that allows you define routing and mediation rules using either a domain specific language (DSL) or XML. Here’s an example of a rule I’m currently using in production:

This is an asynchronous route that accepts an incoming XML payload via JMS and routes it to the correct filter component based on the root element. (While the filter component is a custom component, but it could just as easily be a simple bean invocation, or any other component supported by Camel.)

The more time I spend exploring Camel, the more impressed I am with it. I plan on making it a permanent fixture in my application stack for client projects.

nick Entry ,

WicketForge 0.5.4 Released

March 4th, 2009

WicketForge 0.5.4 was released last night, correcting a few ClassCastException bugs and adding another Wicket XHTML to the list of tags available to be completed. This release doesn’t yet add the properties file support I’ve been working on, but I’m hoping to get time to finish that up shortly.

To update to 0.5.4, please run your IDEA plugin updater.

nick Entry , ,

NYT: What carriers aren’t eager to tell you about texting

December 28th, 2008

To most of us, sending a text message is magic. Simply enter your short message content, select a recipient, and send. From there, the message arrives in the recipient’s inbox to be read or ignored. For this privilege, wireless customers pay about $0.20/message unless they have a prepaid package. How the message pricing is determined is essentially a black art, and the subject of a recent NYT article (registration required).

The most interesting point in the article is that once the carrier costs are covered, it doesn’t matter if a tower conveys a hundred messages or a million. While revenue per message has been falling, the volume of messages has been skyrocketing and will continue to do so.

nick Entry ,

American Airlines Mobile Boarding Pass

November 21st, 2008

American Airlines has introduced Mobile Boarding Pass, which allows you to avoid having to print a boarding pass at home. Instead, a link to the boarding pass is emailed to your device. You follow the link to retrieve a device-only version of your boarding pass which can be shown to security and gate personnel. Currently, you can only use this for non-stop flights from Chicago O’Hare, LAX or Santa Anna, so it’s extremely limited. The other obvious problem is showing your boarding pass after you pass through the metal detector - you can’t take your phone through the detector, so how can you show the boarding pass after you pass through?

More information on Mobile Boarding Pass can be found here.

nick Entry ,

Customizing JAXB’s Namespace Prefixes

November 21st, 2008

At a recent event in Denver, some of our integration partners complained about the namespace prefixes in the XML we generated. By default, JAXB creates simple prefixes like “ns1″, “ns2″ and so on. I’m not sure it matters unless you’re processing XML using some archaic means, but keeping partners happy is usually a good idea, so I turned to the JAXB API.

JAXB makes prefix customization pretty easy through the NamespacePrefixMapper class, found in the com.sun.xml.bind.marshaller package. The abstract class has one method to implement:

From here, it’s a simple matter of returning the prefix you want for a given namespace, then telling your JAXBContext about your implementation:

If you’re also using javax.xml.xpath.XPath, your NamespacePrefixMapper can also implement javax.xml.namespace.NamespaceContext, centralizing your namespace customization in a single class.

nick Entry , , , ,

Sprint looks to remake its brand

February 12th, 2008

It can take years to build a solid reputation in any industry, especially in the phone service business. While it’s hard to recall, Sprint had a glowing reputation, with good customer service and a strong network. A number of network problems, like the Great Nextel Failure of 2006 and increasingly horrible customer service pushed customers away in droves - mostly into the arms of AT&T Wireless and Verizon.

Sprint’s looking to turn the corner after hiring former AT&T Wireless CEO Dan Hesse. USA Today ran an interview with him yesterday. While he doesn’t list many specifics outside of changing the corporate culture and reliance on WiMax in the future, he seems confident that he can stop the bleeding.

Hesse’s main focus seems to be on differentiating Sprint from other carrier. It’s not a bad plan - you always want to be disruptive. To differentiate Sprint, they should fix their customer service and capitalize on the Nextel services that so many customers left in late 2006. Devices really don’t matter. Service and pricing matters.

If Hesse can’t do it, maybe Microsoft should buy them.

nick Entry ,

Determining how much to charge

February 10th, 2008

When I started System Mobile, one of the most challenging things was determining how much to charge clients for projects. At first, estimates were more of a guess than the result of a process. As I became more knowledgeable about projects and various clients, my estimates became more precise.

The popular blog FreelanceSwitch has an article on determining what your time is worth and discusses the pros and cons of charging hourly versus charging by project.

nick Entry ,

Leveraging CGLIB Proxies with Wicket

February 7th, 2008

Anyone that’s spent some time with Java has made use of reflection, which can be loosely defined as Java’s ability to programmatically interrogate a class and call methods on it. Reflection is typically used in frameworks to call property accessors. Within Wicket, reflection is used to retrieve and populate properties using the PropertyModel. Suppose you’ve got a Person class with two properties: firstName and lastName, with the relevant accessors. Your PropertyModel would look like:

Easy enough, right? Where the process breaks down is the string referring to the firstName property. What if the property changes? You won’t know until you try the page or your unit test fails. This is where CGLIB comes in.

A Wicket user working on a project came up with the idea to use CGLIB proxies to bind object properties to components, taking you from this:

to this:

It’s slightly more verbose, but it allows you to know if your property names have changed at compile-time rather than runtime.

Is this in Wicket yet? No, it was just brought up on the Wicket list yesterday, but a number of people are excited about it. It will likely end up in an extension or Wicket-Stuff rather than the core framework. You can follow the discussion here: http://www.nabble.com/CompoundModel-based-on-proxies-td15317807.html

nick Entry ,

More Maven Woes Follow-Up

February 3rd, 2008

Various people have responded about my Maven complaint, suggesting explicitly excluding the JAR. I tried it, and it didn’t work. Like I said, I’m new to Maven so it’s possible I missed a “simpler” fix.

nick Entry ,

Following up on microcredits

February 3rd, 2008

Some time ago I posted about my experiment with Kiva, a website coordinating microcredit loans. My initial loan was $100 divided over four business. While that doesn’t seem like a significant amount, my $25 was combined with several other creditors to meet the full loan amount of the various businesses. Kiva suggests smaller loan amounts in order to minimize your risk.

So far, two of the four businesses have repaid the loans in full, ahead of their repayment schedule. I reloaned the funds to additional businesses. The remaining businesses are still meeting their repayments on time. The process seems to be working, and working quite well.

If you’re like me and consider most charities to be inefficient at best and wastes of money at worst, supporting people with microcredits might be for you.

nick Entry ,

More Maven Woes

February 3rd, 2008

A new project I’m on requires the use of both XFire, for Crowd’s Java Client, as well as CXF, for everything else. Of course, XFire and CXF both require the XmlSchema library, but the POMs for each require different versions of if. XFire’s POM uses version 1.1 while CXF uses 1.3.2. Both versions are downloaded and 1.1 is loaded in the classpath first, causing various problems with CXF.

After fighting this and losing half a day, I eventually had to setup my own Maven repository for XFire, changing its dependency to 1.3.2. Along the way I had to update the POM hashes or Maven wouldn’t use the POM to resolve dependencies.

I’m relatively new to Maven and it’s possible I’ve overlooked something, but this problem shouldn’t have been that hard to solve. Hopefully Don’s work on Maven will yield some improvements in Maven. Otherwise, I’m sticking with Ant.

nick Entry

Article: Introducing Apache Wicket

January 29th, 2008

With Apache Wicket 1.3.0 out for a while now, it was time to finish my article and turn it over to TSS to publish. The article went up yesterday and the response has been very positive so far.

I’m hoping to make this a short series, although future articles probably won’t be 22 pages long. If you’ve read the article, I’m always interested in your feedback.

nick Entry ,

And you can quote me.

January 3rd, 2008

I had an opportunity to speak with Paul Krill over at InfoWorld about the Apache Wicket 1.3 release from the user’s perspective. Paul’s clearly a talented writer, since he took my incoherent mumbling and made me appear almost intelligent.

Thanks to Martijn for lining up the interview.

nick Entry

Amazon’s SimpleDB Coming Soon

December 14th, 2007

Amazon.com offers a number of low-cost, high-availability services, including S3, EC2 and Flexible Payments. It looks like Amazon has plans to provide some form of database as well, called SimpleDB.

SimpleDB allows you to create a domain, which is similar to a table in traditional relational terms. You place items (rows) into the domain and assign attributes (columns). SimpleDB supports multiple values per attribute, which can be somewhat confusing.

One huge potential issue is you’re not guaranteed that your data will be consistent immediately. Amazon calls it ‘eventual consistency’. Data is written to multiple locations and the propagation takes time, so your data might not be consistent as soon as you complete the operation.

From the available documentation, it’s also not clear if referential integrity is supported and how, or if any form of transactions are available.

I’ve used S3 with Eventful and it’s an excellent service. I’m not sure where Amazon is going with SimpleDB.

nick Entry

Make Way For Cellular Service Providers

December 5th, 2007

Suppose you wanted to get internet access to your new house or apartment. You’ve already got a new computer with a shiny Dell/Apple/etc logo. After doing the research and choosing an internet service provider, you’re told your new computer won’t work on the ISP’s network. Instead, you have to buy a new computer from the ISP, complete with a two-year agreement.

If it doesn’t make sense for internet access, why should consumers tolerate it from cellular providers? At least one company is starting to get it.

Business Week is reporting that Verizon is adopting Google’s Android platform for mobile phones, in addition to allowing a broader range of devices on their network. Why would Verizon want to sell the razors if it’s not going to sell the blades? Simple - carriers subsidize the cost of phones and don’t make money until the customer is in the 10th month of the contract. By moving to a cellular service provider (CSP), Verizon can potentially save money on phones and support costs.

Other cell carriers haven’t responded to Verizon’s move, and most will probably take a wait-and-see approach. Given Verizon’s position as the most profitable carrier, any success will likely spur competitors to open network access.



nick Entry

Reset those mock objects

November 21st, 2007

Lately I’ve been rolling mock objects into my unit tests. I selected EasyMock since it came up first in the Google search. Everything was going well until I wanted to test return values with the expectLastCall(…) method. If you’re not familiar:

It seems to follow the (disjointed) EasyMock documentation, but fails with “Unexpected method call find(1)”. Since I’m creating my mock objects at the start of every test method, I needed to call reset(…) on my mock objects. Using TestNG, this is straightforward:

nick Entry , ,

Wicket Component Tour: Behaviors

November 7th, 2007

The next post in the Wicket Component Tour is up. This time I present Behaviors and offer a quick example.

Click here for the full article

nick Entry

Experimenting with Google Print Ads

October 16th, 2007

By now most people are familiar with Google’s AdWords, the search giant’s link placement service. It seems Google’s addition to the ad placement space, Print Ads, has escaped attention. I recently created a Print Ad campaign to post ads for Eventful, our event management and online registration application. (More info about that here.)

The process is simple. Start by selecting your campaign start and end dates and search for newspapers to run your ad. You can search by region, newspaper name and circulation size. Some advanced options allow you to search for specific sections or days of the week. Next, determine ad size and bid on the space. Unlike AdWords, you’re not bidding against other people for the same search terms. Instead, you offer a bid and the newspapers accept or reject it.

Once your offer is accepted, you’ll need to provide an ad in PDF format. The only thing to remember here is to use 300 DPI images or better in your ads or Google will reject them. (Google verifies the ad for content and quality.) The process is complete once your ad is uploaded.

Google Print Ads provides very simple, accessible way for anyone to run a newspaper ad. And if you’ve picked up a few Chicago papers over the last few days, you might’ve seen Eventful’s ad.

nick Entry

Eventful Launches

September 2nd, 2007

I’m very pleased to announce the launch of Eventful, a subscription-based event management application. Eventful has been in development for some time and it’s great to finally offer it to the public. So far, the response has been overwhelmingly positive. Customers are already accepting registrations for events managed with Eventful.

Eventful’s core features allow event managers to:

  • Import existing attendee databases
  • Create personalized email campaigns
  • Organize sessions, tracks and lodging
  • Build customized registration and surveys
  • Publish all information to a customizable event microsite

Since most readers of this blog are developers, you’re probably interested in some of the underlying technologies. Here’s a quick list of frameworks used:

Development tools primarily consisted of IntelliJ’s IDEA and iReport, a GUI tool used to create report templates for JasperReports.

nick Entry