Native XML Databases at NYPHP next week

17 October 2007 » DB2, Java, MySQL, PHP, XML

Elliotte Rusty Harold will offer his take on Native XML Databases at New York PHP next Tuesday night in Manhattan.

The presentation follows a mailing list thread and resulting blog post that generated a lot of interest and discussion on the topic. It should be a great talk for database administrators, application developers and content producers alike:

While much data and many applications fit very neatly into tables, even more data doesn’t. Books, encyclopedias, web pages, legal briefs, poetry, and more is not practically normalizable. SQL will continue to rule supreme for accounting, human resources, taxes, inventory management, banking, and other traditional systems where it’s done well for the last twenty years.

However, many other applications in fields like publishing have not even had a database backend. It’s not that they didn’t need one. It’s just that the databases of the day couldn’t handle their needs, so content was simply stored in Word files in a file system. These applications are going to be revolutionized by XQuery and XML.

If you’re working in publishing, including web publishing, you owe it to yourself to take a serious look at the available XML databases. This high-level talk explains what XML databases are good for and when you might choose one over a more traditional solution. You’ll learn about the different options in both open and closed source XML databases including pure XML, hybrid relational-XML, and other models.

As always, the meeting at IBM is free and open to the public, but you must submit your RSVP by 6PM EDT Monday, October 22nd.

DB2 for Intel Mac

24 September 2007 » DB2, IBM, Java, Mac, PHP

Antonio Cangiano has offered tantalizing news about the upcoming release of a developer’s edition of DB2 Express-C for Intel Macs.

According to Cangiano – a software engineer at the IBM Toronto Software Lab – a beta of the full data server, not just an application development client or driver, should be out by the end of the year.

The interest of Python and Ruby developers helped drive the case at IBM for a Mac version of DB2, but I imagine PHP and Java programmers on this platform are looking forward to the official announcement as well.

I’m still running on PowerPC and it would be nice to see DB2 released on an IBM processor built for Apple, but it’s another good reason to pick up a new Mac around Christmas :)

On cruft, or, channeling Lao-Zi

I discovered this insightful nugget over on Slashdot.

It was posted in response to a disillusioned “Ask Slashdot” submitter pondering whether such a thing as “Pretty Code” exists.

Cruftiness is the quality of having cruft. Cruft is the stuff that accumulates on code over time. Cruft has no odor, but it stinks. Cruft has no mass, but it weighs the code down. Cruft can’t be seen, but it’s ugly. Cruft cannot be young, it’s always old. Cruft can’t be deliberately added, it only appears when you’re not looking.

Cruft can’t be explained to managers, except through awkward car analogies. They still won’t get it because managers drive well-maintained elegant foreign cars like BMW’s, which gather no cruft. Programmers understand, because their Fords and Chevys are practically built of cruft. Harley motorcycles should have cruft, but noise dissipates cruft. Cruft is mysterious.

Cruft is never present on code which hasn’t had enough work. Cruft only appears on code which has been worked too long, by too many people.

Brilliant.

A new ibm.com

IBM unveiled a significant upgrade to its Web site earlier this month. There were many folks who drove this successful launch and we’re all pretty proud of the result.

Beyond the aesthetic touch ups and usability improvements seen in the new v16 and v15 templates (Here’s a v14 page for comparision), there were quite a few personalization features packed in.

Visitors can now:

  • Add a given page to their interest areas based on the subject or topic indicated in the meta tags. For example, by clicking Add to My Interests.
  • Navigate based on those interests and country/language preference.
  • Sign in anywhere and share content with others via “E-mail this page” links always available in the masthead and footer.
  • Save time with forms that are pre-filled with information from their profiles when logged in.

My team’s contributions were to the client-side JavaScript and server-side Java functionality, which comprised the overall asynchronous, services-oriented architecture.

This system design enables customization to be plugged in regardless of the underlying hosting infrastructure of the existing Web site.

For example, areas of ibm.com that are hosted on static file Web servers or those which only use CGI are still able to use the new features provided by the central WebSphere application since they are enabled via a single new JavaScript file and use the id of elements in the DOM of the new HTML templates.

I had the opportunity to work with a new team and learned quite a bit over the short run of the project. I was able to pick up or improve my skills with asynchronous JavaScript programming, JSON, DOM, Java build tools such as Ant, high-performance WebSphere hosting, and the CMVC version control system.

The services-oriented architecture was probably the most fundamentally different part of this Web application from others I’ve been involved with and I’m pretty excited about applying that pattern in future projects now that I’ve seen the value of a real world implementation.

Technology of the day: Bridging Java and PHP

22 May 2007 » IBM, Java, PHP, WebSphere

Last summer I put together a list of Options for using PHP with WebSphere. One of the approaches I mentioned, but didn’t elaborate on, was to use a PHP-Java bridge.

In the time since I wrote that post, and particularly in the past month, there have been several items published which demonstrate the value of this technology. I still need to delve deeper, but here’s a quick summary of what’s going on.

What it is
In essence, a PHP-Java bridge enables PHP developers to access Java code from within their applications and vice versa. The benefit is that you can reuse libraries or services deployed on one platform from code that exists in a different environment.

This differs from the standard approach of using an HTTP server front end to route individual requests for PHP scripts or J2EE applications. The PHP or Java application can instead call the other without the HTTP server’s involvement.

While you can always use Web service APIs to communicate between your applications over HTTP, PHP-Java bridges provide a method to access the external application’s API directly from the source code. As such, they are much more efficient than traditional network calls.

How it works
Implementations enable one or more of the following techniques:

  • PHP running as a Web server module calls out to a servlet running on a J2EE application server.
  • A servlet executes PHP scripts via CGI.
  • PHP calls non-J2EE Java applications.

Where to get it
There are three major projects which implement this technology in varying degrees.

Find out more
The well documented open source PHP/Java bridge appears to be the most mature technology at this point. You’ll find more information via the related links section of the project page.

IBM developerWorks has posted the first installment in a “Develop with Java and PHP technology on AIX Version 5.3” series on setting up the requisite software in a Unix environment.

There don’t seem to be many details available about the Zend Platform Java Bridge, but I’m hoping to learn more when/if Andi Gutmans posts his presentation from JavaOne that he described in this blog entry.

There’s also a “Caffeinated PHP, Integrating PHP and Java” Webinar tomorrow which will describe Zend’s offering.

I’m not sure of the roadmap for the PHP Integration Kit and it hasn’t moved much since being announced as an alphaWorks technology last year.

Code review in version 7 of Rational tools

26 April 2007 » Java, RAD, RSA, Web architecture

A quick note to help out other folks who are looking for the Code Review feature they used in version 6 of Rational Application Developer or Rational Software Architect in version 7 of these tools.

Instead of selecting the Code Review view from within the Java perspective, you’ll now find the same functionality under Analysis Results.

In general, references to “Code Review” in the help documentation have been changed to “Static Analysis.”

Kathy Sierra and the Blogger’s Code of Conduct

The blogosphere was aflutter last week after a slew of nasty comments and death threats were leveled at one of my favorite authors, Kathy Sierra of Head First fame, by one or more anonymous posters on her blog and in other high-profile forums.

Kathy’s reaction to the punks (and the owner’s of the sites themselves) was covered on Slashdot and even hit the BBC. CNN was slated to air a segment on it this morning.

The incident spurred a call for a “Blogger’s Code of Conduct,” and Tim O’Reilly has led the way with a first draft on his blog. Mostly common sense I suppose, but still a good start and cause for reflection when posting or replying to blogs.

In any case, I hope to see Kathy back and writing soon. Readers like myself owe much to her ability to help us understand complex software development concepts through humor, and to drive the point home by involving beer consumption as the logical end goal of any proper sample application.

OutOfMemory errors during Struts file upload

17 January 2007 » Java, Web design, Web development

I ran into an issue today that I couldn’t find an existing answer to. Hopefully this solution helps anyone else who’s still using Struts 1.x and running into errors when uploading large files through a Web form. It’s a setting for the Apache Jakarta Commons FileUpload library that Struts uses rather than internal to Struts itself.

Occasionally during the submission of forms I’d see errors in the console which began with the following stack trace.

java.lang.OutOfMemoryError at
java.io.ByteArrayOutputStream.<init>
(ByteArrayOutputStream.java(Compiled
Code)) at org.apache.commons.fileupload.
DeferredFileOutputStream

You might think that it makes sense to increase the buffer size to fix a problem like that. You might even try increasing any of the other Struts RequestProcessor settings.

In retrospect it makes sense that you don’t tell something to allocate more of a resource that it can’t already get enough of, but it took me a cup of coffee or two to realize I had to reduce the buffer size, not increase it.

Anyway, lesson learned.

bufferSize – The size (in bytes) of the input buffer used when processing file uploads.” Lowering this may affect performance, the documentation says, but that’s a better option than having it not perform at all.

memFileSize – The maximum size (in bytes) of a file whose contents will be retained in memory after uploading. Files larger than this threshold will be written to some alternative storage medium, typically a hard disk. Can be expressed as a number followed by a “K”, “M”, or “G”, which are interpreted to mean kilobytes, megabytes, or gigabytes, respectively.”

Default <controller> element in struts-config.xml:

<controller bufferSize="4096" memFileSize="256K"/>

What I tweaked to eliminate the error.

<controller bufferSize="1024" memFileSize="128K"/>

Your mileage may vary.

« Previous pageNext page »