Tuesday, August 26, 2008

By feature or by layer? Neither and both!

It's one of those classical discussions that has been going on for years: should you organize your code by feature or by layer? What's the right answer to that question depends on the project and the way developers are going to work: will they have the need to look at the code from a layers' perspective, then the code should be organized by layer first. Will they use the features' perspective most of the time, then the code should be organized by feature first. But what if a group of developers will access the code by feature, and another group will access the code by layer most of the time? Or what if you would like to access the code by feature half of the time, and by layer the rest of the time? (Which is almost equal to saying that you really don't know.)

The problem may be that we're asking the wrong question. In stead of asking whether we're going to access the code by layer or by feature most of the time (or that we want to impose one of them on the developer team), we should be asking how we can allow the developers to access the code the way that suits them best at any time. Or in other words: if they need to access the code by layer now, and by feature for the next task, how can we accommodate for that? The answer is: by not organizing our code in a fixed, hierarchical manner, but by using tags and tools that allow to access the code by those tags. Unfortunately languages like Java don't support this yet, so we'll have to find a way around that...

Sunday, August 24, 2008

Tagarchy

I define the concept of a tagarchy as an arrangement of objects, people, elements, values, grades, orders, classes, etc., by tags. This contrasts to a hierarchy, in which the structure of the arrangement implies a sort of ranking: the collection is first divided by the most important property, then by the second most important, and so on. This does not mean that a tagarchy is a sort of anarchy either, because each element in the collection has multiple tags associated to it, and these tags can be used to create an ad hoc hierarchy, and there are some strict rules on how each element in the collection should be tagged.

Tagarchies are used in many Web 2.0 applications, Delicious and Flickr being two of them.