Tuesday, November 21, 2006

KISS, my dear friends...

Today I was asked to look at a new piece of software that we would be using on a project. No biggie. It is a piece of server software, so I figured it would be "query the server and you will get data."

How wrong I was.

While the demos mostly worked, I could not find out how to access it. I looked at all the documentation and tutorials I found on the web site and I'm quite lost. It was especially difficult because it used some "magic" to handle the requests. Therefore, when I looked at the examples and looked at the URL that was called to make the request, I found nothing in directory that it should be pointing to.

Needless to say, this got me thinking about some of the things I've done in the past year. Most recently, I've been reworking an API to make it easier to reuse. Essentially, there are several libraries with some, but not a lot, of dependencies between each other. One of the problems was that each one was a singleton, therefore there was a good deal of code duplication. I pulled the singleton functionality out into its own library and set it up so you can "register" either an object or just the functions within the object with the singleton. This way if a developer wants a singleton, all they have to do is create a library with the functionality they want and register it with the singleton library. The registration functions have also been designed so that you can in one statement make all the public methods and, if you register the entire object, members accessible through the singleton. Not hard at all.

This experience also got me thinking of several things I came up with some time ago. While I would love to say that I was inspired to create these things, they were really born out of potential necessity. A client I'm dealing with has been known to change their minds on almost a whim, therefore I needed to come up with a way to rapidly build functionality. Therefore, I ended up building three different frameworks, for lack of a better term. All three were very different in what they are meant to do, but they all have one thing in common: it is very easy to add functionality. They are all set up so that you can add functionality without having to modify any existing files by using a plugin-like architecture. Piece of cake.

The final thought I had was "why isn't this software easy to use?" "Why can't I simply write a little bit of code, call it remotely, and see my data?" "Why isn't this EASY?!?!?!" I understand that many APIs, frameworks, architectures, etc. do things for some reason deemed valid by their creators and there are those who love it, but I find many to be convoluted. Why aren't they easier to work with?

Well, as a final thought, I plan on posting some of the code I mentioned earlier. One is an RPC library that I started and another is an architecture for building a web site. I never got to use the RPC library, however the web site architecture is working out very well. Compared to Fusebox, which I have used and hated, I feel this has improved my ability to make web sites quickly. If nothing else, at least I worry less about how my code fits into the architecture and focus on building site. Anyway, I'm going to try to get this stuff onto Sourceforge or something else. Suggestions? The problem is I am pretty busy with a Master's program and I want to try to finish the RPC library and create examples on how to use both of them, so it may be a while. Sorry.

*Apologies for the vagueness at times. I didn't want to accidentally bad mouth a product in the event it may be my own dumb fault that I couldn't get it to work.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home