Friday, 28 February 2014

The Art of Simple Operation in a Complex Application

What's one of the first things a web application needs? A login and user management, of course! It is easy, just an html page with a form, a simple server-side script that checks that the password is correct, and maybe a link to log out a user.

Or not.

Our software has user accounts, which are tied to a company. Which in turn might be tied to a larger organization. Each user account might have multiple roles, both administrative and operative. A user has status, dashboard, history log, and a lot of other information.

Just to present a simple login form (just presenting, not even submitting), we need a template view, a template processor, a service class, and a bunch of Java libraries. And little things like a Java Application Server and an actual server that hosts all of the mentioned stuff.

In addition the login function needs a database server, some tables (hopefully with some data, too), cryptography algorithms, another view, multiple domain classes, service logic, and database access classes for our domain classes.

This leads to a rather complex setup just for a login. Good thing our application does a lot more than just logs users in and out!


(After seeing this awesome image, it probably won't be unclear to anyone why I am a programmer and not a graphic designer.)

Wednesday, 19 February 2014

Starting from scratch

Starting something completely new without any previous code is difficult. It sounds nice; "Cool, I get to decide what conventions to use, and will not - never ever - do (insert your most hated bad programming habit)!". What sound even nicer, is the fact you get to choose what language, platform, and framework is used, instead of spending your days cursing some innocent designer from the dawn of the software about the "poor" choices he/she made.

But in reality, it is scary, and hard.

Trying to form a good overall plan based on other people's thoughts and white board scribbles. 

Trying to select the best possible programming language / framework / database that will adapt to your current and future wishes. Combing through hundreds of pages of hate-love -posts on forums and blogs.

Trying to be agile and modern and everything, while supplying "the customer" fixed estimates, roadmaps, and promises of a release date.

What if I make the wrong choices, and I'm unable to fulfill the requirements without tripling the estimates? What if someone else comes along, and says how stupid I have been? What if...

First lesson for me in this new position was that every choice can be remade. It is better the sooner I realise that a particular solution is not optimal, and the sooner I find a new solution. Even if it means losing days of worth of code, and missing my (self set) deadline. At least this way I wont have to put of with my own poor solutions next month - or next decade!

I have started this current software project last fall, so I've gone far from the initial empty Java project. I have made a few poor choices (which I hope I have corrected all), but some good ones too. I'm trying not to get too fond of my choices and solutions, 'cause one day someone will find a better solution, and I have to be able to let go or "my babies".