Friday, June 10, 2011

Scan, OK = Betalt

Det slog mig den anden dag, da jeg var igang med at betale et indbetalingskort i min netbank at jeg da i den grad var træt af at indtaste alle de tal, der står i betalingslinien.

Hvad om der på hvert indbetalingskort var printet en QR-kode, man lige kunne aflæse med mobilen og igennem en mobil-app, få lagt indbetalingskortet ind i en indbakke i ens netbank. Så skal man bare vælge det, nu digitale kort, i netbanken og trykke på "betalt" og vupti...  betalt!!

Ja SparNord, stjæl I bare ideen :-)

Sunday, May 29, 2011

Side Effects - part 1

In my last post I mentioned the concept of side effects as one of my "pet peeves".

How othen have you implemented a method/function that does more than logically "task"?
It might have been an update of a persistent entity which also, in same method, added an audit log entry to the audit log. Or perhaps the "create" method of the Order service, also sends an email to the customer.

This is what I call side-effects, an effect of a task which has nothing really to do with the basic task at hand, in the above mentioned examples, update and creation of persistent entities.

Its often quite easy to implement the logic in the same method as the task to which it is closely coupled but I think it is a rather bad design.
In case of the Order service, how to differentiate creation of orders created by customers and e.g. system generated orders? Then you start to add booleans to method, signalling whether or not perform the side-effects and suddently you carry this information around from method to method.

Side-effects has no place in base logic, and its ALL in the context...

Part 2 : Side-effects and transactions

Thursday, May 19, 2011

Classes er dead - long live interfaces

The above headline is a catchphrase used by Qi4j. While classes are nowhere near dead, even in Qi4j, the Composite Oriented Programming paradigm Qi4j presents seems really promising.

While I have only used Qi4j in my small "Hello World" kinda examples, I must say it just feels right - compositions of fragments, side-effects (a long time pet peeve of mine) and mixins IS the way of the future of programming and software design.

Now I've been thinking about why Qi4j isn't very hyped or even mentioned in main-stream programming media's, and I think the fact that you have to more or less go "all-in" scares most. I mean, you can't mix Qi4j with a normal DAO kinda project, you HAVE to use their persistence framework and Unit-Of-Work setup. I feel the Composite part should have been separated from the UoW part, which would have given us a choice...

Saturday, April 09, 2011

Ain't it the truth...

Programming is like sex, one mistake and you have to support it for the rest of your life ;-)

Thursday, March 24, 2011

Gotta love it!

Well - need I say anymore :-) 

   def __str__(self):
        return ', '.join(['%s=%s' % (key,value) for (key, value) in self.__dict__.items()]) 

Thursday, March 17, 2011

Like forever

Wow - it's been like forever since I last wrote a blog entry.

My life has taken a serious detour in the last couple of months and, well - I'm just recently getting back to being myself.

Anyway - I've started on a new hobby project of mine, using Python, Google App Engine and GAE's Channel API - sometimes its like therapy if I manage to get into "the zone" :-)
Hopefully it won't be to long before I have something to show about the above mentioned project.. till then..

Monday, July 19, 2010

Torremolinos - well worth a visit

Hola,

My family and I just returned from a 7 days trip to Torremolinos, Costa del Sol in southern Spain. Danes used to flock to Costa del Sol in the sixties and seventies but not so much in the latest years.
We stayed at a hotel called "Puente Real" (Royal Bridge to the best of my limited spanish) which was very nice but you could tell it had seen the best years but still very clean and an excellent pool, well actually 3 pools including a childrens pool.

The coast and especially the long beach promenade on which we strolled many times is clearly one of the best things about Torremolinos. It wasn't really crowded and many used it for exercising in the evenings (when the temperature fell a bit) by running or roller skating, we merely walked :-)

One day we went to the centre of Torremolinos, to the pedestrian street called "San Miguel" which is a must see, not only for shopping but also for the "vibe" of being in the old part of the town.

Well, saturday and sunday many locals seemed to come to the beach and one thing that stroke me is how they park their cars.. In the curve in a round-about, up and down the streets though there were signs for no stopping and no parking. If both sides of the street were full of cars and there seemed to be enough space for other vehicles to pass they started to park besides the ones already parked in the outer lanes, leaving only one lane "open" for traffic. In Denmark they would all have been fined for illegal parking and perhaps even have their cars towed. Well, its a wonderfull world :-)

Ohh yes - we visited "den lille have" (The little garden / El Pequeño Jardín) and I had the "Monster Burger" which I couldn't finish, this have never happened before and it really is "MONSTER" :-)

I guess this is not the last time we visit Costa del Sol..