Monthly Archives: October 2007

Garbage Collection in Objective-C

I briefly looked at an article about Objective-C 2.0 and I’m totally disappointed. I learned the language in 1994 and I still think that it’s a really great language and much superior to others like Java, C or C++.
One of the fun parts was memory management. Former versions of Objective-C did not have garbage collection – but they provided some support through manual reference counting. There were some basic rules you had to follow as a developer and obeying to this rules meant to call the famous release/retain methods at appropriate places to increase/decrease the reference counters of objects. There were also things like auto pooling etc. For beginners of the language this usually was a nightmare and lead to memory leaks or unpredicated behaviour (as objects were released to soon).
But on the other hand if you followed strictly the rules (which were I think three simple rules) all this reference handling stuff was actually very easy and you did not have memory leaks – everything was working fine – we developed huge applications without any problems. Even using the distributed objects (sending and calling objects over the network to other applications) worked fine (although this was a little bit more tricky).
I guess most developers are happy with the changes but I think that no garbage collection was not a weakness of Objective-C. Actually I think its a strength as you as a developer had to think about what you were doing and you had to show some discipline while programming.
With Objective-C 2.0 this is gone and you have boring and automatic garbage collection, so developers can be lazy again and don’t care about memory management anymore. That’s a sad day…

New Projects: Apache Sling and Apache Sanselan

Still, there are more and moe projects getting into the Apache incubator – I’m currently involved into two of them: Sling and Sanselan.

Sanselan is a pure-Java image library for reading and writing a variety of image formats. It has been started by Charles M. Chen some years ago and is imho a great open source java image library. There are so many of them out there and most of them are either outdated or unusable. But Sanselan is different, it has a simple api, the right license 🙂 and supports many things. I’m happy that I could convince Charles to move Sanselan to Apache.

The other project I’m involved with nowadays is the Apache Sling project – we currently call it web framework for content-oriented applications. So guess, what, it makes the development of JCR based applications much easier. Sling is meant to run in an OSGi environment, so we enjoy all the great dynamics and modularization of OSGi through Apache Felix. We have also contribed some stuff to Apache Felix – most notably the maven SCR plugin – which makes developing services for OSGi much easier.

If you attend ApacheCon US, you have the chance to hear some fast feather talks about these projects! And hopefully we’ll have some “real” session at ApacheCon EU in 2008 🙂

Cocoon GetTogether 2007 in Rome

On wednesday I’ll fly over to Rome to attend the next edition of the famous Cocoon GetTogether – with two days of Hackathon and one day of presentations this is a nice mix I’m really looking forward to. On Friday, it’s Bertrand and me, talking a little bit about the past (Avalon) and the future (OSGi) of web applications 🙂

It seems that I was too dumb to publish this entry weeks ago. 🙁
But as you’ve most likely seen from other blog entries the Cocoon GetTogether was a success and fun at the same time. Thanks to Daniel I could see the Spring OSGi stuff (Spring Dynamic Modules for OSGi) in action and I must say that I think its a configuration nightmare. Apart from your usual Spring bean configurations you have to additionally define which beans to export and what to import etc. I think this can be easily automated – I hope to have some time to look into this in December.

And as everyone else, I’m looking forward to the Cocoon GetTogether 2008 🙂