Tuesday, December 23, 2008

Is Smart UI what we need?

I just read a very perturbing section in Domain Driven Design called "Smart UI". This unthinkable, heretical pattern advocates that you put your business logic in the UI and that sometimes, it might even be worth it.

It was too late. I knew that the seeds of reason had started growing inside of me, like a vine on steroids. Soon, one of the thorns pierced my heart and I gave up.

According to Evans, Smart UI is useful for small projects or for teams that are not sophisticated enough to handle the complexity of Domain Driven Design. In that case, putting all the business logic in the UI will at least isolate it in the sense that all one has to do to modify it is to replace the UI. Of course, this means trouble in the long run. Things will get progressively harder and harder to change and you will end up with a monolithic beast that demands too much attention and sleeps on your side of the bed. But...

What if this is the best my team can do? Should I embark on a crusade to teach them Agility when I know deep inside that they don't really care? As far as they're concerned, they think things are just fine the way they are right now.

Why don't I think the same thing? Why am I on this quest for new methods and patterns?

I want to have fun programming like I used to in high school. This is a deep motivation of mine. Every company that I've worked for so far has somehow succeeded in making it more of a burden. I love the pureness of the craft, the manipulation of concepts, the massaging of data. On the other hand, I find that trying to make things fit is a bother. I love Quality things that just work.

This is who I am. I'm attracted by the beauty of mathematics, the usefulness of Ruby and the creativity and science of cooking food.

I'm put off by by the monotony of building data centric web applications that simply mirror the database schema with some extra validation and business rules sprinkled all over the place. I'm put off by anything that takes time and requires me to stop my creative flow, by things that create friction and that refuse to work even though it seems like you did everything right.

I also hate getting off track like I did just now... But it had to get off my chest. Sometimes I don't even know why I do it; why I sit at a desk and try to make code behave. This little rant helped me refocus on what makes me tick and on why I might want to go the Smart UI way with my team. In the end, it is the customer that counts. I might not become the equivalent of a Michelin three stars chef this way but at least I'll make some people happy... in the short term. The future, fortunately, will force us to change. By this time, I might gain enough influence and wisdom to help my team migrate towards a more... educated way of doing things.

0 comments: