To Make Scalable Applications Or Not?

When making a live mock up for an application (with flex) you want to get it done as soon as possible, with the least amount of frustrations… but what do you do when it expands… do you either invest the time in re factoring the application to make it scalable, or you just do it up front from the start?

Have you ever had an application not grow? Have you never had a customer ask for something relatively simple, but then all the sudden they say, “well heck, you did that so quick that it must just be that easy! or your just that damn good!”

At some point a customer says more magic words after they ask for something like:

“That should be pretty easy, right?” or “That won’t take long will it?” (of course this depends on one’s perception of long).

At the point of them saying that, you either do one of two things… you say “no problem at all!” or you say to yourself:

“I thought this application was supposed to be simple, now we’re going to have to integrate a business tier, and then a database, and then we’re going to have to do this… and do I put all of my remote objects in one file or do I try to create result functions for every single one, how am I going to manage this, I wonder if I should have thought of this from the beginning…”

This is exactly how you start to make unmanagable code… it certainly doesn’t start off bad, but buy the time you integrate a backend, and introduce CRUD (create, read, update, delete) operations, you’ve now added probably at least 8 operations (or functions) to your file, one for sending the request, maybe validating the data client side, and one for the result functions to do updates after the data comes back…

You can end up with HUGE unmanagable files this way… and it certainly doesn’t take long… Imagine a simple application, one where you have contacts and a task list, and all you want to do is create a way to edit each, create new contacts, and delete them as well… same with tasks… so we call this CRUD in the programming world, it involves Create, Read, Update, and Delete functions… and lets imagine you start by creating TWO remote objects in your application file, and then you include all your methods, and result functions for each one… or maybe you have a huge switch statement with some sort of “action” variable, and it says if i’m on this action, do this result after the data comes back…” either way you end up with some logic blocks that grow so quick, the bottom line, is that you could easily end up with 16 functions here… and you wonder how to manage this, as well if you start to get a lot of visual components, you wonder how to pass your data to each component…

you can already see just in my writing, you may be confused… I gurantee your already confused as the developer doing this… because once they discover a situation this won’t work for, they will change it to adapt… and then they will have 2 projects that are different code bases, and another month or two goes by and you develop another simple app, and figure out that the fix you made worked for that situation, but doesnt work for this one… so you adapt again, and you consider yourself quite clever… which you are, for being able to adapt, but then lets bring up another situation… lets say now you have the first customer come back, and they want you to adapt the first program you did to integrate something else, and now you have to bring yourself back up to speed on the code, and you try to integrate the change, but your flustered at the situation, because your not in the groove of the application anymore, and your code is just sloppy and different… there is that another point in time, where you say to yourself “WHAT THE HELL WAS I DOING!” but you remember thinking to yourself at that time, that you were a genius… what happened?

Frameworks – Cairngorm

The whole point of this post is that there is a good solution to this problem called FRAMEWORKS, and it’s not easy to implement, there is a fairly strong learning curve, but if you look at the way you program, and you take a step back, and look at yourself from project to project, and you ask yourself… “did i learn anythihng on this project? was it easy? what work arounds did i have to create? did i make up a new ‘coding standard’ for myself?” or was it just another day at the office, and i developed the same way i did for another project, and i can easily toggle from project to project, no matter if you made it a year ago, or 2 years ago. (2 might be stretching it, with the way things change in the technology field)

Page 1 of 2 | Next page