2007-01-03

@annotations

In case you've been under a rock... Java 5 now has a feature called the annotation and it allows you to attach meta-data to a class or a method. This isn't too terribly exciting unless you write a class that can read these annotations. Official docs here. So what I've found you end up doing is writing a proxy or mediator to handle how the annotated classes are used, what the annotations mean, and how the classes interact.

I'm using DWR at the moment and when we write a POJO and annotate it with the right annotations we get a class that DWR can use to create JSON messages. DWR searches a registered POJO for the "@RemoteMethod" annotations and registers those methods for remote invocation. This is very similar to how the JBossWS system works.

In both DWR and JBWS we are using annotations on POJOs to mark the class and method for consumption by a larger framework that will use the method we wrote to form the unique functional core of an application. We can tell the framework some things about how to consume the method and class using the annotation... and we can use the same POJO in multiple frameworks... in theory.

In theory the same annotations could mean different things to different frameworks. This way a POJO could be fed through a testing tool and then fed to a Web Services framework. The key to using the annotations is that the consuming tool, library, or framework sits across concerns from the POJO.

You POJO should be concerned about one thing, such as how to build an item summary. Your POJO then plugs into the framework. The result is that you program what is unique about your application and forget about everything else.

In designing tools, libraries, or frameworks to consume annotations, consider what is always the same. Write your framework to do those things. Then you register POJO into your framework to do the unique tasks for an application.

I can see a need for about a half dozen annotations frameworks from where I sit. And I can see how a code by convention system could be obsoleted by the astute use of annotations. If the framework is built intelligently, Java 5 could become the fastest and simplest way to build applications because so many concerns could be lifted from the application programmer's shoulders by use of Annotations and well-designed AOP.

2006-12-15

Software is

Software is an encoding medium for ideas. Nothing more and nothing less. That is profound enough by itself. The idea of thoughts existing in an active manner independently from the skull of the thinker is revolutionary enough. What software is, is a fundamental immutable truth: someone must think a thought and encode it.

Ideologies decide whether this means that an idea is property the way a house or car is property or whether ideas cannot be owned. These ideological frameworks allow for commerce around software to operate, make money, and allow people to build careers. It is in the arena of ideology that OpenSource and Proprietary models combat.

This is a simple but important distinction. Software is thought. That is always true. It has all the properties of written thought and some of the properties of active thought. The idea that this form of thought can be bought and sold is part of an ideology. The idea that nobody can own thought is an idea that forms part of another ideology.

No matter what you believe on the subject of intellectual property it is still true that software is a form of expressed thought. That means that how we treat software at least in part informs how we treat expressions of thought and how we treat expressions of thought informs how we treat software. This is not something that I see reflected in modern legislation on the subject of property rights.

2006-12-14

Database Design

Let's say I want a screen that displays a list of MP3s with Genre, Artist, Album, Song Name, Play Length. What would the database table for this look like? Many neophytes would design a table that looked like:

MP3Files
Column
Typedefault
MP3ID
int
auto increment
Genre
varchar(255)NULL
Artist
varchar(255)NULL
Album
varchar(255)
NULL
Song Name
varchar(255)
NULL
Play Length
varchar(255)NULL

... and amazingly never see the problem with this.

2006-12-04

Full Body User Interface

One of my graduate school professors runs the Body Language User Interface project called BLUI for short. It is a unique Human Computer Interaction (HCI) project that allows a user to paint in three dimensions. Projects like BLUI probably inspired the current generation of console controllers on products like the PlayStation3 and the Wii.

The prolonged sedentary use of computers is simply unhealthy. Human bodies were not designed to sit immobile in front of a screen for hours on end. Physical exercise may be important for mental health in general and is completely absent from conventional human-computer interactions.

The computer is arguably the most profound advance of human technology since the advent of the written word. Many of us today live computer-life-styles that would be impossible without these devices. Yet they are slowly killing us.

Wii users are now talking about soreness and fatigue from extended use of the Wii-mote. Repetitive-motion injuries are obviously a concern with any UI and the Wii offers the opportunity for you to experience tennis-elbow caused by a video game. These are just the hazards of owning a body and playing a sport.

And, now we can start to call some video games sports. Perhaps Electronic Sports are on the horizon? All the better. It means that our computers are going to stop being shackles that tie us to the desktop.

Some distant future may even give us a Full Body Interface (FuBI) where the users will dance to communicate with their machines. Dances that control fighter jets. Dances that control robot probes on the surface of Mars. Dances that communicate how to conduct the surgical removal of a tumor.

It's just an idea.

2006-11-30

Bi-Tek

Johnston County in North Carolina has gotten a temporary court order to get Google to remove a page from cache. The page contained the personal information of county residents including social security numbers and cell phone numbers. The news has focused the fact that Google did not respond instantaneously causing Johnston County to seek a court order from an NC judge and not the fact that one of the county's contractors was negligent in its handling of sensitive data.

While it is disturbing that Google doesn't respond faster to requests to clear Personally Identifiable Information from its cache... Johnston county did leave the information languishing on the Internet for six weeks. And, how did this information make it to the web anyhow?

The News and Observer Article states that Bi-Tek creates a file that is posted to the Johnston county website and this file is supposed to contain only names, addresses, and non-private account numbers. Bi-Tek made a mistake that instead posted private data to the Internet.

Earlier this year the VA had its own incident where it potentially exposed the personal information of millions of veterans. Proving that large and small organisations alike have to fight employee ignorance, malice, and indifference regarding sensitive data. The questions that the press should really be asking might be:
  1. What is going to happen to Bi-Tek for this mistake?
  2. What are they going to do at Johnston County to make sure this never happens again?
  3. Will Google be motivated to create a special "Oops! I posted my credit card number on a bulletin board!" call center?
  4. Should software companies that handle sensitive banking, tax, and accounting data have to be certified? And, would an incident like this revoke the license of such a company? Should they ever get it back?
If you pay taxes in Johnston County, North Carolina you should be concerned about the security of your tax information and you should be asking questions about Bi-Tek, Johnston County's website, and what they are doing to safe guard your personal information that they have stewardship over.

2006-11-15

Direct Web Remoting

DWR (Direct Web Remoting) is yet another Ajax framework. This one is, however, a Java framework that makes a heck of a lot of sense for java developers. Take a POJO. Register it in the dwr.xml file under WEB-INF in your war... and now you have an object you can call from your webpages.

Yeah. I didn't believe it either. But the 2.0 beta of DWR that I have been working with is really just about that easy. DWR generates the javascript which you just include in a page, then it generates the servlet that the javascript calls. DWR turns a POJO into an Ajax servlet.

See how easy it is to get started with DWR and if I get enough feed back I'll post some code samples of how to do a portlet that has can process actions using that POJO you registered with DWR. Now with some very simple (but smart) scripting you get Ajax features that automatically degrade to universally supported portlet actions.

And that is why DWR is head and shoulders over some very wrong-headed attempts to turn Ajax web development into Swing or pseudo-swing development. The web is the web. Features should degrade gracefully and page designers and artists should be able to work with programmers to create web applications that work well, look nice, and degrade gracefully.

see also: my DWR tag roll on del.icio.us

2006-11-03

Open Source the Inevitable

Anyone who didn't see open source coming was just kidding themselves about what software is fundamentally. Software is speech. Software is the embodiment of ideas. Once an idea is born it spreads.

Patent law used to recognize this truth. After all, an invention is an idea given substance. The limited monopoly power granted by a patent is intended to fade in time. And, after a time the idea behind an invention becomes part of the greater matrix of ideas that create the culture and community of inventors.

Eventually, enough time will pass that the novelty of every software "invention" will fade and the ideas that drive those inventions will become part of the greater fabric of the community of software creators. Open source is one method of speeding up this process. By forcing software to expose its inner working you forcibly populate the world with the thoughts and ideas that were used to create the software.

Closed source software spreads its thoughts and ideas much more slowly. So much more slowly that the thoughts and ideas the pervade the open source community will eventually over power the closed source community's ideas. In this way open source is guaranteed victory over closed mind-sets... But, not necessarily economic victory.

In the arena of "hearts and minds" victory by open source is not revolutionary, it is evolutionary. Victory for open source in this arena is not the destruction of a particular company, it is the change of the company. Open source is just a label for a small part of a grander change coming for humanity.

The expression ideas is slowly becoming divorced from the physical world. In time the only thing that will have value are thoughts and ideas. Ideas have no value or power until they are shared. Open source is about sharing thoughts and ideas. And, our future is more about the power of thoughts and ideas than it is about control of resources.