Tags

outch

March 27th, 2006

Just read over Kimchy’s Blog that pointed to an article by Martin Fowler which dates back to the end of 2003…
Oh my god this was definitely ahead of my time. As I started my current project I had been well aware of it (I am not sure anymore - I think I even read it shortly after it had been originally published). In fact we moved a system having an anemic domain model to a more object-oriented system (very sucessful by the way - perhaps the thing I am most proud of in my whole career).

Well I had been aware of it. Or I had been occupied by to many things at the “outer rim” to notice: Now we have “Assistants”, “BusinessProcesses” and “Calculator” that stripped out functionality from the business (or domain) objects. They now became more an more a bogus layer between the procedural code and the database*.

*Please note:

…which typically results in a whole layer of O/R mapping. This is worthwhile iff you use the powerful OO techniques to organize complex logic

“Iff” means “if and only if” - so you should employ OO-techniques to do the mapping and not only for the sake of having a mapping layer. In a non-trivial application you will have the need for it so plan for, do not take it too lightly

… the last sentence is perhaps the obligatory detail where I disagree with Martin:-)

Parametrization of a System

March 26th, 2006

Or The limit of a paradigm.

When build a system you usually have to deal with different classes of data. There is the production data that the users enter or gets calculated, the settings of the environment and something I’d like to call meta-data for the moment.

Meta-data tells the system how to perform an action. Templates as here in WordPress are a good example. When the page you are looking at gets prepared a “index.php” dispatchs the original GET request from your browser to some generic Loop that in turn call some scripts for the header, footer, etc.

There is always more than one way to do it. For example, the template I made for this site does not use header.php for calculating the header, I use the templating mechansim of Dreamweaver for generating code for page.php, home.php and so on.

Back to a broader look on the layers of a typical system (not complete):

  1. Operating System
  2. Runtime
  3. Actions
  4. Interface

The OS you usually don’t change (unless you have an OpenSource OS, you simply con’t), but you can set environment variables, define user-groups and that. You are pretty limited there, because you don’t want to break other apps by using too weird settings.

For your runtime you set some global properties, like the classpath/librarypath, encodings down to the names of the database tables. Yes this is already a kind of parametrization.

I skip the actions for a second, so let’s have a look at the interface: You user have different profiles, different languages and use perhaps different presentations (WebBrowser, a batch control system, CLI). It is obvious that this requires a bit of flexibilty from your action layer.

The action layer - we assume here some clean MVC implementation - ties this all together. And - not having a simple CRUD application - it implements somewhere the business-logic.

Here the problem gets interesting as the lines of business-code superceed the lines of the rest by one or two magnitudes - Welcome to the world of systems where you don’t care for the few lines more to write the web-app with RoR or J2EE, because all of this code is virtually nothing compared to what the system really has to do.

Though we can learn something from it for doing the really hard part - or at least understand why it can become that hard.

Read the rest of this entry »

Renaissance (F 2006)

March 25th, 2006

Animation oder nicht Animation. Der europäische Blade Runner.

Handlung

Die Handlung ist nicht das Wichtigste: Illona Tasuiev, Wissenschaftlerin, 22 Jahre, wird entführt und der Renegade-Cop Karas versucht sie und die Hintergründe der Entführung zu finden. Das Ganze im Paris des Jahres 2054.

Warum sollte man den Film sehen?

Herausstechend ist das visuelle Konzept: Hartes Schwarz/Weiss nur Reflektionen und Transparenz erzeugen Grautöne. Man denkt an animierte Tuschzeichung - allerding zu perfekt um gezeichnet zu sein.

Damit erklärt sich warum IBM als Technologiepartner ganz am Anfang des Vorspanns genannt wird. Im Making Of sieht man, dass hier nicht die Animateure für die schaulspielrischen Leistungen verantwortlich sind sondern wieder richtige Schauspieler (die auch im Abspann genannt werden). Die Gesichter sind dann wiederum echte Animation of Retusche.
Anstatt zu imitieren und zu zitieren, wie in fast allen computeriesierten Filmen, hier die Technologie mal als Stilmittel statt als Selbstzweck.

Der Sound ist exceptionell!

Was nervt?

Ein Problem der harten Kontraste: Kameraschwenks “zittern”, daher auch nur 2 Schwenks über das futuristische Paris. Am schlimmsten ist allerdings, das man sich fragt, wie sie das gemacht haben.

What Web 2.0 is

March 24th, 2006

The unbearable rave on it needs some captive definitions, doesn’t it?

this is Tim O’Reilly’s thing

- Javaposse PodCast (please someone help me out with the number of the episode)

cool idea - mostly with no real business plan - that use some AJAX + dynamic html

-Hed

Larger e-mail form == Web 2.0

- Stéphane Lee

…but “Web 2.0” is not a design approach. Rather, it’s a silly reference to contemporary stylistic fad.

- Andy Rutledge

when you google for “depression” and you’ll receive a recommendation from amazon.com: “Ways out of depression”

- (prefers to stay anonymous)

web applications that let you do crap around them and take advantage of organic growth, collaboration, blah, blah…

- Jose Sandoval (he references also to some more serious definitions- as serious as Web 2.0 might be)
…to be continued

Web 2.0 is the building of the Interstate Highway System in the 1950s

- “Architect Corner” (continues with: “Social Computing is everything that resulted next (for better or worse): suburban sprawl, energy dependency, efficient commerce, Americans’ lust for cheap and easy travel.”)

Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform.

- Tim O’Reily

Web 2.0 was the moment when we stopped using computers and started using the Internet.

franticindustries, putting O’Reily’s defnition above in a more catchy form

Use minimal interface

March 23rd, 2006

Two things to notice:

Even a class that does not implement an interface has an interface! In fact the interface of a class is its collection of public methods (for extending classes you have to add also the protected methods and fields to it, and for package siblings even default visibilty).

The declaration “implements interface” is the merely the subset of methods you really want to be used (sometimes to have to make methods public for technical reasons, but these are implementation details)! That is the point behind programming against interfaces.

The declaration of an interface and the consequent use makes clear which methods should be called by the user of of class and which not.

If you don’t declare an interface you are missing this part of expressivity.

What about the title of this post? Sometime (in pre-Java5 code) you have to cast down. When use restrict yourself to to minimal interface that suits your job, you’ll make refactoring easier for the generations of programmers that have to deal with your code after you got happily(?) rid of it. OK, we should you care? Because sometime you get the benefit even yourself by having less ClassCastExceptions:

short sAshort = ((Short)getObject(col)).shortValue();

Well, if your getObject() decides to simply construct a Long for each integer value, your code will crash always. Downside: you won’t have the ClassCastExceptions anymore, so need something like

if (sAshort != ((Number)obj).intValue()) throw new NumberFormatException();

but this is a different story.

Unfortunately though Java made the concept of interfaces popular, it has some short-comings:

  1. When creating an anonymous class you can only implement a single interface or extend a class.
  2. A return type declares only a single-type, something like Readable,Writeable getAccessor() would be nice.
  3. In turn you should be able to declare parameters like setRWAccessor(Readable,Writeable accessor)

This would make the code much more clear because you’ll define less interfaces that just aggregate existing interfaces (normally one needs a lot of them, because you don’t want to violate the minimality principle again; also fewer casts would be needed.

XJava-Applet

March 22nd, 2006

Some new idea for a project that came from a problem I encountered at work.

A client uses our web-application at remote sales-points. By remote I really mean remote. The connection is via a X25-line with some 40kbps (bits not bytes!) and a significant latency. We did some tweaking on the Apache to set Expiry and compression so that we have now reasonable response-times.

So far so good. Or not? We had been thinking of moving to an Applet or even a WebStart application instead of a browser based solution. Browser is not browser, for example we had a mysterious bug with IE and Apache when a cached paged tried to load a non-existent JS-resource - the HTML-response got inserted …

Our main goal is to use the same codebase for the applet/webstart as for the server, which will allow more efficient testing and debugging and also avoid duplicate implementations of functionality once in Java once in JS.

At FJA we had an Applet-client which was a bit problematic because it virtually refreshed itself after each keystroke. Our current application has a different approach  that minimizes the number of communications. Though this seems nice, it causes long delays on transitions in the workflow and besides that it makes the data-exchange between client and server very complicated.

Ajax is not really an option perhaps, since we have quite complex rules and many inderdepencies in our UI - the management code we have right now is perhaps already beyond the limit of complexity we can handle, since its JS; we need either other developers who can cope with JS-projects having >200kloc or we put it into something “engineerable” - like Java.

But the communication problem persists. Having simpler exchange means having more frequent communications and there is for sure some lower bound for the mean bandwidth we need. As I had a look at X11 today (a collegue needed to do some debugging on a remote Linux-box) I remembered this as very efficient way for remoting and this brought me to the idea of a XApplet.

XApplet is some Swing wrapper that can smoothly switch between an X11-terminal mode and native processing. This means that the client runs either as an ordinary Applet on the client or that it just provides some Terminal-facilities that exchanges tiny messages like key-strokes and mouse movements to an Applet running on the server. Perhaps the full client can have regions of terminal and native components (given they are sufficintly independent).

What is the benefit of a terminal-mode, you might ask? The terminal-mode can easily implement some “asynchronous”  behavior and the bandwidth usage is quite evenly distributed. Software like Citrix (and within some limits Window’s Remote Desktop) have proven to be well functioning remoting tools in low-bandwidth environments. When you think of a typical mobile application this approach is perhaps not so bad…

Du Jour Au Lendemain (F 2005)

March 21st, 2006

Zuviel des Glücks kann einen in den Wahnsinn treiben.

Handlung

Für François  läuft es nicht gut, seine Frau will die Scheidung er sitzt in einem mäßigen Apartment in einer Trabantenstadt, es regnet, die S-Bahn ist überfüllt und die Pizza mit Ei (sehr verbreitet in Frankreich - ich hasse das auch, aber was solls). Ein ewiger Montag.

Von einen Tag auf den anderen wendet sich das Blatt.

Warum sollte man den Film sehen?

Seit Podium bin ich Benôit Poelevoorde Fan. Leider ist er etwas auf Loser programmiert, aber nun hat er ja mal Gück - hat er wirklich? Jeder erträgt nur ein gewisses Mass an Glück, man möchte sich auch mal was verdienen, wenn Alles einem nur zufliegt bleibt doch wieder ein unbefriedigendes Gefühl. Selten angefasstes Thema mit viel Humor erzählt.

Was nervt?

Die Alle Sagen I Love You Tanzszene war etwas zu viel des Guten, wir verstehen auch so, dass nun der Bonheur die grenze des Erträglichen erreicht hat.

Safari without a Mac

March 21st, 2006

100% useful http://www.danvine.com/icapture/

When developing a page without a Mac at hand you can get a PNG of the site to see if everything looks as intended.

I recommend that you donate some money to the creator (there is just a tiny link (”beer does not grow on trees, yet” or “your donation will keep this site alive”) to send some money via

There is also a version to have an IE7 preview!

Look how this post looks like on Safari:

Click to enlarge

Das macht Sinn

March 14th, 2006

Wer gerade selbst eine Website entwickelt hat, guckt sich manchmal auch gerne die Websites der anderen an. Gestern stieß ich dabei auf die Seite der Übersetzungsagentur Semantis: www.semantis.be. Dort machte es ganz schön Sinn:

“Eine Übersetzung ist dann gut, wenn man nicht merkt, dass es eine ist.”
Sagen wir mal so, ich halte das zwar für eine notwendige, keinesfalls aber für eine hinreichende Bedingung. Es gibt nämlich sogar Übersetzungen, die dermaßen schlecht sind, dass man noch nicht einmal mehr merkt, dass es Übersetzungen sind.

“Die Leser sollten den Inhalt verstehen, ohne die Form erraten zu müssen.”
Hä?! Welche Form jetzt eigentlich?

“Unsere erste Priorität gilt der Qualität.”
Nee, das glaube ich Euch irgendwie einfach nicht. Früher hieß es außerdem immer “höchste Priorität”. Sonst könnte man ja mehrere Prioritäten nebeneinander haben, und das wäre doch ein Widerspruch.

“Semantis Translation ist die gesammelte Erfahrung zweier Profis, die total seit 15 Jahren in der Branche arbeiten und die sich entschieden haben, dass ihre gebündelten Fähigkeiten dem Kunden noch mehr nützen.”
Das macht natürlich wirklich Sinn. Ich arbeite mit meiner gesammelten Erfahrung ja auch total gebündelt in der Branche.

“Ausbildung: Übersetzerlizenz”
Hätte ich auch gerne, wo gibt es die?

“Ihnen einen Service zu bieten, der Sie rundum befriedigen wird.”
Das kommentiere ich jetzt mal lieber nicht.

Nach diesem rundum gelungenen Opening füllte ich selbstverständlich das Formular für kooperationswillige Übersetzer aus. Die Felder “Spezialitäten” und “Beilagen” haben mich ehrlich gesagt etwas verwirrt. Ich würde sagen: Jungs, da müsst ihr noch total nachbessern. Sonst muss man ja erst die Form erraten, um den Inhalt verstehen zu können. Und dass das keinen Sinn macht, habt Ihr ja selbst schon gemerkt.

Fauteuils d’orchestre (F 2005)

March 2nd, 2006

Junge Frau in Paris - If I can make it here, I can make it everywhere - mal anders

Handlung

Jessica tut es ihrer Grossmutter gleich und versucht ihren Platz im grossen Leben zu finden. Ihr Anspruch ist nicht “gross rauszukommen”, sie will nur am Leben “teilnehmen”, dicht dran sein an den Reichen und Berühmten - es selbst zu sein ist gar nicht wichtig.

Warum sollte man den Film sehen?

Cécile de France is einfach klasse! Die junge Miou-Miou unserer Tage. Vielleicht ein Must-See im Zeitalter der Superstar, Supermodel, Superwas-weiss-ich. Das wahre Leben ist nicht der sichtbare Erfolg, schön das einmal zu sehen wie es von einem Protagonisten angegangen wird, der nicht sein Leben schon hinter sich hat (à la Wim Wenders)

Was nervt?

Was soll an einem perfektem Film nerven?