opinion


19
Mar 08

WordPress Plugin Format

Google Summer of Code has announced this years’ OSS projects that have been accepted to the program. While going through the list I stumbled upon some features that I would really like to have in WordPress, like Plugin Update Notification, One-click installation of themes/plugins and this, that and this. They all have something in common, they all require a better plugin format!

There are tons of plugins out there and only a couple support these features. Why? Well, if you look at the Writing a Plugin documentation you see that a plugin can be packaged absolutely in any possible way.

Plugins can be zip, rar, gz, bz2 etc. archives. They can contain any number of subdirectories that the administrator has to copy to certain other folders and the requirement of meta information is quite relaxed. The automation of installation, upgrade, deletion, versioning for all the plugins is impossible with such relaxed rules.

WP plugins (like the others already have — FF extensions, Eclipse plugins, Google Gadgets, WARs …) should have a solid structure so that the management of the plugins could be automated. One click install, update notifications or automatic updates, public repositories and other cool features can be built upon this.

Besides all the other great ideas already posted I’ve submitted one that would try to address these problems from more ground up.


10
Mar 08

Are static types a personal issue?

Static v/s dynamic types: I will look now into the pros & cons of static typing. What if it’s not really a technical but more of a psychological matter?

This is not exactly an eye-opener, but static types will create a mind map of the project code with considerably less effort than dynamic types. And as long as that map is not important (the project team is small and code complexity is within reason), dynamic types will outperform the extra kickoff needed to fit your design (or lack of it?) into a static paradigm. But when you have to share your code with someone else (even if its yourself in a while) then the dynamicity requires a discipline that is beyond most people.

BTW the constant refactoring debate does not really refer to static types as such, but rather static nominal types a la Java. E.g. in Scala you have structural static types, which cannot be refactored in any reasonable way. When the type system gets complex with a lot of partial structuring and type inference refactoring is almost just as challenging as with dynamic languages.


3
Mar 08

dow.ngra.de@QCon

Since I’m going to QCon in a week expect lots of juicy feedback about the talks and the speakers in realtime. Will be nice to finally find out what Floyd‘s been up to after TheServerSide.


26
Feb 08

Worse-Is-Better Design or Sloppy Code?

Although most of you probably heard of this before, today Worse-Is-Better triggered a chain of thoughts in my head that goes way back.

When I entered the Java development community the hot stuff in my side of the aquarium were RUP, UML and Design Patterns. The approach to software engineering that I learned was to foresee as much as I can and put those ideas in the design. As many others I would often use a design pattern where it fitted, without giving thought if it was really necessary there.

As a result of that Aranea was born. From the point of view of software design Aranea was almost perfect. It was based on independent components with few interdependencies, it foresaw situations like AJAX and desktop deployment long before they were implemented.

By the time we started working on JavaRebel I got somewhat disillusioned in those practices. Therefore, although I originally wrote a throwaway prototype, we ended up evolving it without ever rewriting entirely. Although the code was not directly a mess, it definitely preferred simplicity over unnecessary abstraction and not a single design pattern was hurt while hacking at it.

Both projects were large and complex enough to serve as a case study. But like the original author of the “Worse-Is-Better” essay, I still can’t choose between the two. In fact, I’m not even sure that these are separate approaches, it may very well be just the amount of sloppiness the project can take before it collapses.

Now, sloppiness is a good negative word. It is also fitting, since it refers to the character of the development process, rather than its success.

A very good example of sloppiness in today’s Java ecosystem is Hibernate. It is designed with simplicity in mind and it’s code is a tangled mess of just enough design. Nevertheless it’s a hugely successful project which provides a clean enough API to make developers happy. It is designed evolutionary and at some point developers had to give up full backward compatibility for new features.

On the other side of the scale is Spring. It’s code is precise, well organized and object oriented to the point of nausea. It has a layered design with the simple abstract core and never had to sacrifice backwards-compatibility.

In their own way both these projects are about equally complex. And I don’t mean lines of code, but rather how hard is it for a newcomer to start hacking at their code. In the end it’s almost as hard to unravel the layers of abstraction as to jump through the sloppy code. The main difference is perhaps that Spring offers more extension points whereas Hibernate is somewhat harder to debug.

“Wait”, you say, “Does he really suggest that sloppy code can be good? Why just yesterday I had half a heart attack looking at it!”. The trick is that I’m comparing two highly successful open source projects made by some of the best people in the Java community. This makes a whole lot of difference.

In the end it’s unsurprising to come to the thesis propagated by the agile community: in the hands of the right person any approach will work. A talented leader will trade the right things for sloppiness and a clueless newbie will create an overcomplicated abstract mess. My experience tells me that in my next project I will use just as much sloppiness as the project will take without collapsing and make sure the people around me can handle it as well.

What do you think? Can discipline protect a project or will it create even more complications? And what should be the guiding star when designing it?


22
Feb 08

WAS ist das? RANT

All the app servers and servlet containers I’ve seen these days the IBM’s Websphere Application Server tops them all. The most unexpected, complicated and difficult to understand by far.

Lets start by trying to find out what the server is doing at a given point. The startServer.sh will echo the name of the log file that you can tail. Great! At one point you understand that there’s a lot more going on in the background.

You do a quick find -mmin 3 and find out that do get an overview you have to tail about 5 logs: startServer.log, stopServer.log, SystemErr.log, SystemOut.log, server1_exception.log. Divide and conquer but how am I supposed to keep an eye on them? How many pages of documentation do I have to read to monitor the correct one?

I won’t even start on how to find the administrative console or what services are started on which ports. Once you find it and start deploying an application you understand that exploded format is a big no-no, no option for that. Ok, let’s copy or link the application to the installedApps folder. Nope, does not cut it. Nothing happens, none of the 5 logs show anything.

Just zip -r ../app.ear * and deploy the ear file. It will be unpacked to installedApps and off you go. Well actually you still have to zip even the WAR files inside the EAR for the deployment to be a success.

Now you configure your IDE to generate webapp’s classes to the deployed application. You see that the application starts reloading after every change. Probably somekind of auto loading. You go to the administrative console, find “Class loading and update detection”. This must be it. The checkbox is _un_ticked??? Why is it reloading on every update then? I don’t know, but just enable the damn thing and use a really large polling interval and it will all go away.

I can actually go on but I’m probably just wasting time. By the way, Glassfish’s profile/domain is 6.7 MB, my IBM’s profile/domain is 458MB. Go figure.