Overview of using Aspects – java.net

I believe Aspect Oriented Programming (AOP) will eventually have a huge impact on simplifying large systems development, but first it needs to gain wider understanding of it’s capabilities so people can start to take advantage of it. It’s one of those tecnhologies that has such a huge potential to simplify development through the introduction of aspects to implement cross-cutting concerns, but it still has not yet made it into the mainstream.

java.net have an introductory article illustrating how aspects can be used to simplify the development of Internationalization, which is a good example of a cross cutting concern for an application.

OnJava.com – reviewing the top 10 Java Request for Enhancements

Chris Adamson has an interesting article on the OnJava.com site reviewing the top 10 Request for Enhancements (RFEs) for changes and new additions to Java, in this case for the Dolphin release which is Java SE 7.0 (6.0 (Mustang) is already available for beta download – see download section here).

Some of the interesting requests are the addition of Design by Contract support using pre and post conditions, the addition of ‘struct’ support, and upgrading JEditorPane to support HTML 4.x (a jump from the current 3.2 support).

Taking control of your XML Parsing with StAX

The two most common XML parsing approaches both have their limitations. The DOM approach loads the whole XML doc into memory in it’s tree representation, which is great if you need to walk through the tree to process it’s content, but is inefficient if the XML is large or you are only looking for a small part of the XML. The SAX approach allows you to inspect the XML ‘on the fly’ and get notified of events (matching parts of the XML you are looking for). This avoids having to load it all into memory as in the DOM approach, but is a psuh-based approach which means once the parsing starts the XML streams through until the end of the document, and you have no control over navigating forward and backward through the stream.

java.net have a good introductory article today showing how the StAX API is used, which offers a pull-based approach. It avoids the limitations of DOM and SAX by allowing you to control the processing of the stream, and even terminate processing halfway though if you have found the data you are looking for, meaning you are not forced to wait until the end of the stream.