This week we needed simple internal webapp, and we needed it quick. Nothing fancy, it's main goal was to replace an Excel table and allow ~10 people to edit a basic database simultaneously and provide the rest of the staff with the appropriately filtered results. This is a problem a lot of frameworks aim to make easy and painless to solve -- Ruby on Rails or JSF are nice examples -- but all of these need some time to get started with (I've actually played around with JSF a couple of years ago and we have a Ruby expert on the team but it'd have simply taken too much time to set up a proper environment before we could start hacking code).
So we thought: hey, we do have a framework that provides us with the low-level scaffolding that a web-based application needs: an MVC scheme, proper check of inputs to avoid SQL-injections or XSS secholes, a usable database abstraction layer, a ready-to-use templating engine, session handling, an authentication layer, and so on... all those lots of small things that you spend a lot of your time with if you start off using "low-level" tools like PHP and don't want to create a completely unmaintainable and messy code. We have already designed, written and tested such a framework for Shell Control Box which we re-used for syslog-ng Store Box -- that's what we call X Control Box or XCB (and that's the XCB I've mentioned in my previous post), a generic base for our appliances. And we also happen to know it quite well and have a ready-to-use development environment for it.
Of course XCB knows a lot more than what a small database-oriented webapp needs and it'd have been quite ineffective to use such a complex system for something that simple. So I sat down, copied the XCB codebase to a new dir, and started to hit the button "d" in vi. Hit it hard and long. Half an hour later, there it was: the initial commit of something that can best be called XCB lite -- a framework that provides all the beforementioned basic foundations for a webapp without the overhead caused by the advanced features needed by an XCB-based appliance. And the best part is that only tiny changes were needed to make it work and it kept 95% class API-level compatibility with the original, so if any new features are needed (such as XML database or SQLite support) they can be added by simply copying the related classes from the XCB codebase. I think this was the most bizarre way I've ever created a new application -- by spending nine-tenth of my time deleting code.
Oh, and just as a side note: if you ever need to add a simple JS-based DHTML date picker to your app, don't spend a single minute of your time evaluating the various options (or, oh horror, write your own). Use the very first Google hit for "javascript date picker" and go with it. It will only get worse, seriously.
Newcomer at marketing department
-
I am pleased to inform you that a marketing trainee begins on Monday in our
team. Balázs Antal is a graduate at Colleague for Modern Business Studies
and h...
0 comments:
Post a Comment