BlackBerry app for Metro-North schedules

04 May 2011 » BlackBerry, Java, Travel

Well, it took just under two years and quite a bit of marketshare loss, but I found some time to release my long promised native BlackBerry application for Metro-North commuter train schedules.

You can download NYC North Trains for free, over-the-air. I’ve tested it on OS 5 and 6 devices such as the Curve, Style, Storm 2, Bold, Tour and Torch.

Like the simple Web interface I’ve provided for nearly five years, the native app offers an interface to the MTA schedule data optimized for mobile devices.

However, it also offers some features that make the experience quite a bit more convenient for BlackBerry users.

  • Simple schedule selection using BlackBerry dropdowns and date picker
  • The ability to save your preferred origin and destination (and toggle them depending on which way you’re going)
  • Ability to email the schedule results from the device
  • Ability to save a particular departure to your calendar to block your travel time

Of course, this application comes with the standard disclaimer.

Not affiliated with the MTA or the States of New York and Connecticut. This tool uses live information directly from mta.info, so schedules are always based on the latest available information. This tool retains no copies of schedule information from the MTA.

Enjoy and let me know what other enhancements you’d like to see.

Learning to write Java apps for the BlackBerry

22 April 2010 » BlackBerry, Java, Potpourri

Early in 2009 I decided to start writing Java applications for BlackBerry devices.

I’ll tell you why I chose this particular smartphone platform and how three books that I later received as review copies from Apress can help you get started too.

I’ll also share some thoughts on a gap I see in the BlackBerry developer’s bookshelf.

BlackBerry leads US smartphone market share
With the Apple iPhone garnering all the the mobile application exposure, it’s easy to see why RIM’s BlackBerry devices get less developer attention these days.

However, BlackBerry devices still hold a larger share of the smartphone market than either the iPhone or Android devices.

According to comScore, RIM comprises about 40% of devices sold, with Apple at 25% and Google at around 10%. The iPod and iPad aren’t included in this category, of course.

Other reasons I chose to develop for the BlackBerry platform
Besides the sizable marketshare, there are three major reasons that I’ve been learning to build BlackBerry apps over the past year or so.

  • My wife and I have owned several personal BlackBerry devices over the years and continue to use them daily.
  • Java development is a major part of my day job and it’s nice to reuse those skills on a new platform.
  • I work for a company that uses the BlackBerry Enterprise Server to manage its mobile workforce and therefore I already have a sizable audience of users to target for new projects beyond standard Web applications.

Where to start?
When I started learning about the BlackBerry platform there weren’t that many recent books on the market, which surprised me.

Instead, I needed to learn what I could through trial and error and the help of the large, but somewhat disjointed, collection of official documentation from RIM on the BlackBerry Developer Zone.

While there is a lot of material there, it’s hard to understand what’s most relevant and up-to-date, and what sort of roadmap the beginner should follow to learn the platform given those resources.

Getting started gets much easier
Fortunately, the BlackBerry book landscape has improved in the past few months, but the number of new releases still pales in comparison with the glut of iPhone development titles on the market.

I’ve had a chance to work through a few of these new books, two of which Apress provided me for free as review copies, and another that I have access to via Books24x7 thanks to my place of employment.

I suppose it’s only slightly ironic that as I read the latter book online, I wished I had an iPad to curl up with rather than a run-of-the-mill laptop or smartphone. :)

Apress book overview
By all indications, Apress has emerged as the leading publisher of BlackBerry books in late 2009 going into 2010. In particular, the first title below is one that would have saved me a lot of time when I got started early in 2009.

In any case, I can recommend any of these books, but obviously they all have their own target audience and don’t necessarily need to be read in sequence.

Also, keep in mind that these books focus on the development of native Java applications rather than tailoring Web sites to the BlackBerry browser.

  • Beginning BlackBerry Development by Anthony Rizk.
    This book provides an excellent introduction to the key topics that most interest a Java developer new to the platform.

    It covers the basics of setting up an IDE, putting together a user interface, using local storage, making network connections, using GPS, and distributing your application. All the steps are approached in an easy to follow tutorial format.

    The fact that Anthony Rizk was a founder of Rove Mobile – which produces the admin tools I depend on on my BlackBerry – lends this book extra credibility.

  • Advanced BlackBerry Development by Chris King.
    This book covers some of the same ground as the title above but takes a deep dive into audio and video development, text and email messaging, encryption and access control, and integration with the BlackBerry operating system and its built in applications such as the Address Book, Calendar, and Browser.

    It also provides valuable lessons on packaging your application for many different BlackBerry models and carriers and automating the build, versioning and deployment processes.

  • Learn BlackBerry Games Development by Carol Hamer and Andrew Davison.
    While this book’s subject matter has less in common with the type of business applications I write, it was an interesting read.

    Some of the compelling chapters include information on using Antenna for builds, using OpenGL ES and JSR 239 for 3D graphics, and how to license, release and commercialize your application.

    There’s even a thoroughly geeky chapter on using a BlackBerry connected to a PC via BlueTooth to drive a toy car attached to the computer by USB.

What’s also nice about these books – and what sets them apart from the official RIM documentation – is that they are pretty straightforward about the limitations of the platform and can be quite frank with their assessments of certain capabilities.

What I’d like to see in upcoming books
I set a goal for myself to deepen my BlackBerry skills this year. One of the best ways that I’ve found to thoroughly understand a platform – even one that you’ve been using for years – is to attempt certification or at least know the study materials inside-and-out.

RIM has recently introduced a certification program in order to achieve the BlackBerry Certified Application Developer credential via Java or Web development tracks.

Given how new the exams are, there aren’t yet any guides on the market to help the candidate pass both exams needed for certification.

Addison Wesley’s BlackBerry Development Fundamentals by John M. Wargo claims to be a good guide for the prerequisite exam (BCP-810), but does not cover the second exam on either Java (BCP-811) or Web development (BCX-812, understandably, which is still in beta).

Given that RIM’s study guides are so sparse, I see a great opportunity for any publisher to hit the market with a certification guide on these two exams in 2010.

Final thoughts
If you’re looking to get into Java development for BlackBerry smartphones, I recommend you at least have a look at Beginning BlackBerry Development.

Of course, supplement your learning by staying on top of news from the BlackBerry Developer’s Blog and of course the BlackBerry Developer Zone.

If you find the platform interesting, have a look at either Advanced BlackBerry Development or Learn BlackBerry Games Development.

Finally, I recommend you keep an eye out for news from the WES conference next week. I hope RIM gives developers even more compelling reasons to look at the BlackBerry platform.

Develop and test your apps on the IBM Cloud

I moved to a new position within IBM at the beginning of the year, joining the Enterprise Initiatives organization responsible for delivering IBM Smart Business Development and Test on the IBM Cloud.

Before I joined this team, Development and Test launched as a free public beta in 2009. Throughout 2010 we’ve incrementally improved the pilot and in the near future a generally available pay-per-use version will go live.

I’ll describe some of the features that Development and Test beta has now, highlight some usage scenarios that it can enable or improve, and along the way tell you where to learn more. As always, the standard disclaimer applies.

In a future post, I may put together step-by-step instructions on using the virtual machines on the IBM Cloud to:

  • Build PHP with an instance of DB2 as a way to illustrate how system administrators can evaluate the platform or practice configuration.
  • Verify that a sample Java EE application written for Tomcat works unmodified on WebSphere.

IBM Smart Business Development and Test on the IBM Cloud
Like many Cloud technologies, Development and Test aims to reduce the time and money spent by customers to procure, configure, and run IT infrastructure, platforms and software.

But the target of this particular system is to:

  • Give developers and testers hands-on access to IBM software in minutes rather than days or weeks.
  • Provide application developers with an environment to write and run their applications.
  • Allow usage to scale up or down depending on the phase of the project.

As a result, users will have more confidence in the quality of their work and are able to make better informed choices about its hosting environment when they deploy.

Feature overview
The Development and Test beta is a Web application that provides a dashboard for managing Cloud resources, a catalog of images to start with, and a set of APIs (Web service and command line) for accessing assets programmatically.

With it, you can:

  • Provision virtual servers
    An application developer can quickly start up an instance of a server OS, such as Red Hat Enterprise Linux, that is pre-configured with WebSphere or DB2, for example.

    With an operating system and middleware in place, the developer can try out the software setup or verify that their application works on that particular configuration.

  • Set up virtual development environments
    A developer can request a fully configured IDE instance, such as the Eclipse-based Rational Software Architect, and connect to it using a virtual desktop like FreeNX.

    Alternatively, the user can integrate with a hosted instance of Rational source control, automated testing, and project management software from the physical workstation they already use.

  • Save and extend configurations
    Once the team is satisfied with the product or system at a point in time, they can save a snapshot image of the configured instance.

    That image can then be used as a template from which to create new instances that can be shared with others. Those images can also be tagged as a test release or captured as a known good savepoint to build upon.

    Beyond the catalog of pre-configured IBM software stacks in the system now, IBM is working with partners to add third-party pre-configured packages on the Cloud.

In all cases, the user acquires the resources s/he needs right away without the need to find and run hardware or download, install and configure software.

This shortens project start time, reduces time spent on configuration trial and error, allows for more development iterations in the schedule given the same project length.

If you want to get a hands on introduction now, have a look at the developerWorks overview article or user guide (PDF).

Otherwise, if you want to hear my take how I think this particular Cloud platform can make life a whole lot easier for anyone involved in software development, read on.

New possibilities
Since this approach reduces much of the time and money to get hardware and set up software, several new possibilities and potential use cases come to mind.

Imagine the following scenarios that can be made possible or made much easier:

  • You are an innovator who needs a place to demo an early prototype to potential investors in order to justify further development.
  • You are a developer who has created an application on your laptop with a Personal or Express edition of IBM software and you want to see if it will run on a WebSphere and DB2 server to see if there are unexpected differences.
  • You are an independent software vendor who has verified your software on Tomcat (or PHP) and MySQL and wants to widen your potential customer base to include those customers who have an IBM infrastructure.
  • You are a committer to an open source project, and you want to replicate an issue reported by a user and and debug it using the configuration they have on their system.
  • You are a student who wants to build skills or experience hands on or do comparative research between operating systems and software vendors.
  • You are a standards body member, such as for ODF or Java EE, and want to see how a vendor implementation adheres to the specifications.
  • You are an author, you can make sure your readers have a copy of your sample code.
  • You are an instructor, you can make sure your students have an identical setup to reduce class prerequisite setup time.
  • You are a system administrator, and you want to test out an upgrade on an identical server before committing changes that are time-consuming or difficult to reverse on your own system.

Sound interesting?
The Development and Test on the IBM Cloud beta is available to use for free right now. In the coming weeks, a paid, stable and supported version will be available that charges on a usage basis.

If you want to take it for a spin, have a look at the developerWorks overview article or user guide (PDF) in order to get started with the beta. The support page offers forums, FAQs and getting started videos.

You may also want to follow the new developerWorks section and join the user community to learn more about this platform in particular and Cloud computing in general.

If you’re interested in the upcoming paid version check out the data sheet (PDF) on the IBM Middleware Services page. This video also makes a compelling introduction.

Enjoy, and don’t forget to check back here in the coming weeks to see those step-by-step PHP/DB2 and Tomcat/WebSphere tutorials.

Upcoming WebSphere and PHP book reviews

04 December 2009 » Java, PHP, Web architecture, WebSphere, Writing, Zend

With several vacation days to cash in through the end of 2009, I hope to catch up on some reading and learn more about the latest developments in the two areas where I do most of my work as a Web application developer – Java EE Web applications built on IBM WebSphere and PHP Web applications using various Zend products.

About a month ago I performed a technical pre-publication review of the second edition of the MySQL to DB2 Conversion Guide that was just released this week, but the following books will be covered from an end user point of view, after general availability.

IBM WebSphere eXtreme Scale 6
First up will be IBM WebSphere eXtreme Scale 6 by Anthony Chaves.

Packt Publishing – who have sent me a free review copy – have made “Chapter 7: The DataGrid API” (PDF) available as a free download.

WebSphere eXtreme Scale is an in-memory data grid used to cache objects and improve both performance and scalability in Java EE applications. It’s analogous to memcached.

I’ve read the first chapter so far and am looking forward to diving into the rest shortly, particularly as I continue to tune a high-volume WebSphere application set to launch an update later this month.

Pro IBM WebSphere Application Server 7 Internals
My next review will be a related middleware title, Pro IBM WebSphere Application Server 7 Internals by Colin Renouf. Apress also sent me a review copy of this book, along with the next title.

I’ve read a few chapters so far, and am quite intrigued by how the author has exploited the modular Eclipse (didn’t know that!) underpinnings of WebSphere 7 to produce some interesting system administration plug-ins.

Of most interest to me about this book is that the author is neither an IBMer with access to WebSphere’s source code, nor writing to sell the reader on IBM middleware, but rather a seasoned pro with lots of practical experience getting the most out of WebSphere.

Zend Enterprise PHP Patterns
Finally, I’ll have a look at Zend Enterprise PHP Patterns by John Coggeshall with Morgan Tocker, also from Apress.

Rather than a catalog of architectural, object-oriented software patterns, this book describes several techniques for developing effective and efficient PHP applications using best practices based on Coggeshall’s years at Zend working on several large scale projects for enterprise customers.

I’ve read two of the chapters in this book that are of prime interest to me, “Web Application Performance and Analysis” and “Data-Caching Strategies in PHP.”

The former looks at diagnosing whether an application is CPU, memory, or I/O bound. This server level approach moves beyond profiling PHP code and looking at the hardware itself. Even for applications moving to the Cloud, this should remain extremely relevant.

The latter chapter has much in common with the WebSphere eXtreme Scale product above, so it will be interesting to learn more about the state-of-the-art in both PHP and Java EE Web application performance techniques.

So far so good
Stay tuned for the more complete reviews in the coming month or two. Right now it seems that all three titles are solid additions to any Web application developer’s library, but I’ll hold out my final verdict until I have a chance to evaluate each more thoroughly.

Mobile Metro-North BlackBerry shortcut

11 May 2009 » Java, Travel

I’ve just released a BlackBerry shortcut icon that launches Mobile Metro-North using the default browser on your device.

In the near future, I intend to launch a native BlackBerry application that offers more features over the simple Web interface. It will store station preferences, display the big board of all currently departing trains, and help locate the nearest stop using GPS functionality.

Watch this space for a release announcement, or send me a note if you’d be interested in beta testing.

CommunityOne East roundup

The network is the computer… finally? It seems that Sun’s motto comes full circle, and perhaps confirms their business plan all along.

I attended Sun’s CommunityOne East in Manhattan last Wednesday and cloud was the word of the day. It was also an apt term to describe IBM’s vague overture towards the hardware/software stalwart that morning.

I didn’t walk away from the conference with specifics about the new buzzword, but I do appreciate that it captures some of what IBM has been doing, and therefore reveals a rare bit of consensus among the major vendors:

Other notes from the sessions I attended:

  • OpenESB: Connecting Enterprises: Sang Shin is an excellent instructor and firmly placed three technologies I’m evaluating for some current business needs… BPEL, WSDL, and SOAPui. Despite the compelling demo of NetBeans, I missed the actual server side / asynchronous implementation that is the promise of the ESB.
  • GlassFish v3, OSGi, Java EE 6 Preview and Tools (Eclipse, NetBeans): JEE 6 was introduced in the context of GlassFish 3. There still seems to be some work to get the standards settled any time soon for implementation in WebSphere 8. I look forward to the annotation-based and modular approach of the new standard.
  • Dynamic Languages: The Next Big Thing for the JVM or an Evolutionary Dead End? Chris Richardson reaffirmed some of my observations about Groovy… while cool, it may be the overly rebellious offspring of a middle-aged Java; Brilliant in flashes, but not quite predictable enough to bank on. Scala, however, seems to have lots of promise.

Unfortunately, I couldn’t attend Hans’ presentation on MySQL and PHP – State of the Union, but it appears to have been well received. In fact, you might expect a reprise at NYPHP’s June 23rd meeting.

Instant XML feeds via the JSTL SQL tags

20 December 2007 » DB2, Java, MySQL, Web architecture, WebSphere, XML

A dusty old Java tag library can help conjure up siloed Web site data for new uses.

Some background
I’ve developed a number of server-side Java Web applications over the years, first with scriplets embedded in JSP, then with the template and tag driven paradigm offered by ATG Dynamo before the J2EE standards, and most recently with the Model-View-Controller architecture pattern in Struts and Spring MVC.

Each of those technologies (mostly) improved on its predecessor and enforced a better separation of concerns between the database, application logic, and presentation of the end result in the browser. This in turn has helped my teams divide and conquer Web application development among specialized job roles.

That’s why I’ve long been puzzled why the SQL tags in the JavaServer Pages Standard Tag Library exist as a standard part of J2EE 1.3 onward. These tags enable a front-end developer to embed SQL directly into a JSP page without the need for scriptlet code.

This tag library seemed an ill-conceived reversion (anti-pattern even) to the days before MVC took hold as a best practice in the Java world, and I’m pretty sure I skipped that section of the objectives when studying for the SCWCD exam.

That said, the SQL tags came in pretty handy this week for a particular challenge, and the more I think about how I can use them beyond their intended purpose, the more every new requirement I see looks like a nail.

My particular application context
I support a content management application which was designed, developed, and deployed circa Web 1.9. It’s stable, performant, and most importantly, met its functional requirements of the day.

In the two years that it’s been deployed, several new requirements have arisen that have expanded its anticipated scope as a traditional Web application.

In particular, the ubiquity of XML feeds have driven the need for it to present its core data outside of the templates existing in the confines of its own Web site. The rise of tagging and the popularity of multimedia as syndicatable content has also made it creak.

Compounding the architectural limitations of the application itself is its inflexible hosting environment. The data center that this site is deployed to is governed by CYA-driven restrictions (rightly so) which constitute a barrier to frequent application deployment cycles that add new functionality.

This environment makes it difficult to adopt nascent technological advances – the next big thing in “coolness” or usability – but have also kept it exceptionally stable and available to meet its codified requirements without introducing undue legal or financial risk.

The application itself consists of two subcomponents. There is a Web application module on the secured intranet for authors to generate new content, and a publicly accessible read-only Web application module to display published content.

It’s primarily this latter Internet application where the use of JSTL SQL tags comes in most handy, but I can imagine uses on the intranet side as well (ad hoc reports, for example).

The case for SQL tag driven XML feeds
The JSTL standard defines a tag library for issuing queries against a data source defined in the Web deployment descriptor without using JDBC in Java scriptlet code in a JSP.

If this sounds like a simple concept that harks back to the type 1 JSP days, that’s because it is. The documentation shows its own apprehension about the inappropriate use of these tags:

The JSTL SQL tags for accessing databases … are designed for quick prototyping and simple applications. For production applications, database operations are normally encapsulated in JavaBeans components.

But therein lies their simplicity, flexibility and power for this particular production application scenario.

In order to take any slice of your data that can be exposed via a SQL query to the authorized user mapped to the JNDI entry for that data source, all you need to do is is write your query and iterate through the result set in an XML template defined in your JSP.

Think about that outside of this technology’s intended use as a prototype or simple application building block. Instead, imagine how you could use these tags to improve the value of a complex existing production application.

For example, suppose you’ve always provided an RSS feed for your latest ten published news stories. You’ve written your Controller or Action in your chosen MVC framework of choice and deployed it.

But now your users are demanding the latest five thumbnails of images published with a story to accompany its syndicated title and abstract in their latest mashup. Or perhaps they only want to see the last 10 stories which contain a given keyword.

What do you do? You could write a new Action or Controller and proper Command class in Java to meet that requirement. That would require updating some configuration files or deploying an EAR or WAR.

But look, you have an existing deployed stable application. Why risk introducing new code or downtime to a perfectly good application? Why not just free your data for use by your users’ new requirements in a quick hitting, low risk way?

Reuse your data by plugging in new JSTL SQL tag driven JSP files, don’t rebuild your application for every new data usage requirement.

To the tag library!
Ok, so you’ve read this far. I promise, the implementation itself will be much shorter :)

So your users want more information delivered via your feeds, or they wish to query by keyword or otherwise filter your data in a way you never anticipated.

Let’s see if we can free up that data for them.

  1. Write your query, with or without input parameters.

    SELECT ID, TITLE, ABSTRACT FROM NEWS_ARTICLES;

    SELECT ID, TITLE, ABSTRACT
      FROM NEWS_ARTICLES
      WHERE BODY LIKE ‘%?%’
      FETCH FIRST 5 ROWS ONLY;

    SELECT ID, TITLE, ABSTRACT, THUMBNAIL
      FROM NEWS_ARTICLES NA, NEWS_ARTICLE_IMAGES NAI
      WHERE NA.ID = NAI.NA_ID;

  2. Determine what XML format it should be in, whether a standard such as Atom or something custom like the following.

    <?xml version="1.0" encoding="UTF-8" ?>
    <results>
      <result id="">
        <title></title>
        <abstract></abstract>
        <thumbnail></thumbnail>
        <body></body>
      </result>
    </results>
  3. Tie the query to the format in a JSP file using the JSTL SQL tag library (and optionally, the Core tag library to escape output) and the JNDI name of the data source you already have configured in web.xml.

    Consult the documentation if you want to use placeholders.

    <%@ page contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8" session="false"%>

    <?xml version="1.0" encoding="UTF-8" ?>

    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

    <sql:setDataSource dataSource="jdbc/yourdatasource"/>
    <sql:query var="items">
      SELECT ID id, TITLE title, ABSTRACT abstract, BODY body, THUMBNAIL thumbnail
        FROM NEWS_ARTICLES NA, NEWS_ARTICLE_IMAGES NAI
        WHERE NA.ID = NAI.NA_ID;
    </sql:query>

    <results>
     <c:forEach var="row" items="${items.rows}" >
      <result id="<c:out value="${row.id}"/>">
        <title><c:out value="${row.title}"/></title>
        <abstract><c:out value="${row.abstract}"/></abstract>
        <thumbnail><c:out value="${row.thumbnail}"/></thumbnail>
        <body><c:out value="${row.body}"/></body>
      </result>
     </c:forEach>
    </results>

  4. Deploy the JSP file as your application server requires. If reloading is not enabled, restart the application (consider setting a 15 minute timeout or similar, so you gain the performance boost but provide a hook for updating JSPs individually).

Conclusion
That’s it, you’ve now added an aspect of functionality to your application which frees up any data you can query for via SQL (or XQuery, if your data server is so enabled). You’ve done it in a pluggable fashion and haven’t needed to build any new Java code within your existing application and its framework.

Of course, the flip side is that you’ve done it outside of your application framework and may have circumvented some well-intended best practices. However, you may to prefer to think of this approach as a temporary, low-risk way to share the data available to the users of your application in novel ways that may justify investing in the development of longer term solutions.

Ironically enough, this reversion to single file deployment can make an application buzzword compliant with the one of the most touted recent enterprise targeted architectural pattern – SOA. It reduces the barrier between the value an application has – its data – and the consuming end point of that data – to a simple JSP.

Thoughts on the Spring Framework

One of my goals for the year was to learn more about the Spring Framework, a layered set of modules that intend to make enterprise Java development easier.

In September, I took a class on Spring. Last month, I put together a presentation to share what I learned with my colleagues.

The bootcamp
I attended the Core Spring bootcamp in New York City. If you’re looking to learn about Spring in a classroom environment, there is perhaps no better source than Interface21‘s consultants as they are the company behind the project.

The course materials were solid and the class revolved around a real-world application scenario. For each segment presented, corresponding before and after projects for the lab were available in a workspace used by the free, Eclipse-based Spring IDE that was distributed to the class.

A copy of Pro Spring was included with tuition, but I’ve found the newer Spring in Action, second edition a better read. The instructors also noted that the older Pro Spring book had information on AOP and transactions that weren’t up to speed with the latest 2.x versions of Spring.

As you would expect from a technology that in practice killed EJBs, the Spring bootcamp focuses on middle-tier applications. However, there was good coverage of Spring MVC, which I hope to a adopt for a new project built on WebSphere 6.1 and J2SE 5.0.

Like Baldwin home from Paris
Some time after the course I had the opportunity to present an overview of the Spring Framework to my department. The audience consisted of developers as well as project managers and other non-technical types, so the goal was to keep the presentation accessible as well as sufficiently informative.

To sum up the philosophy of Spring in a nutshell, I hit on three characteristics with real world parallels. I hope they went over well, and I think some of the other learning materials out there would benefit from a similar approach. It seems the ideas behind Spring could be conveyed easier than they often are (another reason I like Spring in Action).

  • Inversion of Control / Dependency Injection
    Give code what it needs, don’t make it ask
    Does your car buy its own gas? Should it have its own credit card? Or use yours?
  • Interchangeability through Interfaces
    Keep things “black box” enough that you can swap individual pieces out when you need to
    Your twenty year old lamp can take either a traditional incandescent light bulb or a new compact fluorescent light bulb which provides a 75% more efficient way to do the same thing in the same standard socket.
  • Aspect Oriented Programming
    Terrible name and difficult vocabulary for an easy-to-grasp concept
    Consolidate logging and access control code, don’t repeat it all over the place
    Imagine an assistant tracking your billable hours to several projects during the day for you while you focus on your real job.

Silly middle-tier guys, or, what’s with that goofy .htm extension?
I have one outstanding gripe about Spring. Spring MVC in particular. I let it slide in the class, but since the foolishness is repeated in other materials for learning Spring I felt I had to speak my mind.

In a lot of examples for configuration of the Spring MVC DispatcherServlet, folks will tell you that “.htm” is the preferred convention for the mapping requests to the front controller.

The argument goes that we should trick the search engines into thinking this is static HTML content and besides, the mapping reflects that even though the page is dynamic, it is indeed rendered in HTML. Furthermore, the “.do” convention from Struts is pure tomfoolery.

This is dogsqueeze.

I take exception with all those arguments. In fact, I’d go as far as to say the “.htm” extension for dynamic content is actually harmful:

  • Most developers deploy Java Web applications to an application server which is not also the front-end Web server. Application servers, such as WebSphere, are configured to serve only dynamic content, such as servlets and JSPs. The HTTP server, such as Apache, serves the static files such as HTML documents, stylesheets and images.

    What if you really did have a static file with a “.htm” extension deployed by one of your Web developers? Do you want to see her go bonkers when she can’t figure out why her file is not being found because you decided to map that extension to your servlet? WTF?

  • Do you really want to make the impression that you’re hosting your Fortune 500 or high volume e-commerce site on MS-DOS?
  • The “search-engine friendly” argument for the “.htm” extension goes out the window when you start using query string parameters anyway.
  • You’ve introduced goofiness at the cost of elegance, another tenet core to Spring. Sigh.

But honestly, if you’re going to go through with it anyway, just add the damn extra “l”, filename limitations (virtual as they may be) are a thing of the past.

Next page »