Friday, November 25, 2005

Complexity

Once of the things I struggle most with in programming is managing applications as they become bigger and more complex. The temptation is to develop for the here and now, but we all know that whether it be your employer or a customer, they'll always want more and they want their application to evolve and do things you never thought they would want.

In my opinion, the trick is to build flexibility and customisation into every part of the application you need. One can guarantee that if the ask for a particular thing to be changed, they will soon ask for something else to be changed. The second trick is to build abstraction into every part of the application, especially where specific entities are concerned; OOP makes this easier, but there is no reason why this cannot also be done with modular programming.

So as an application evolves, need it become more complex? In my opinion, it is inevitable that it will, just as with the evolution of life. With software development however, it is a lot easy to allow things to get out of hand and do too much, adding those "nice to have" features, which will impress your employer or customers, but neglecting the main requirements. I am saying this to myself for future reference as well as anyone out there who may be reading this. Whether it be a new project or an evolving project, write down some requirements, which "must" be implemented, tested and working before adding those extra bits.

Thursday, November 10, 2005

Brian's Braindump: PHP Object Casting is Cool

Brian's Braindump: PHP Object Casting is Cool

This is an interesting feature I have not seen before. I have just finished writing an API which serves as an adaptor which encapsualtes the $_POST, $_GEt and $_REQUEST super globals. Although I have documented it and posted the source, the real test will come when I use it in the sit I manage at work.

Heres the code and a short description I posted on PHP Builder:

http://phpbuilder.com/board/showthread.php?t=10312690

Friday, November 04, 2005

wosser's world

wosser's world Check it out; wossname's blog ..... its way better than mine :D

OOP

I have realised in the past months how reliant I have become on object orientated design. I was asked to write the website for work using a modular approach; which I have found quite difficult. When I look at the way I have structured things, I have tried to obtain the highest possible level of abstraction as I possibly can. I have done away almost entirely with global variables, using them only for the most important of variables; in most cases these variables are objects.

You saw right, the site is not entirely modular; I have succumbed to the temptation of using OO design for the sever side sessions, the template system and error handling. In fact I cannot imagain trying to program a polymorphic database abstraction layer using a modular approach.

Not only have I come to realise my reliance on the OO design methodology, I have also found a soft spot for it. The more I utilise it in my applications the more logical the approach seems, especially when it comes to modelling high level problems which such as those which you are likely to encounter in web development. While developing my site for work I think myself saying "this would be so much easier, if I were to use a Singleton to achieve this functionality" or "This data would be a lot better encapsulated in a class which manages the collection, validation and updating of the data by interfacing with the database abstraction object."

At university, we have started learning Java and we are doing another module to accompany it, which focuses on object orientated design in software engineering. So, I believe there may be some exciting times ahead and hop soon to buy a book on OO Design patterns to help further my knowledge. When I get the time, I will redesign the site I am working on using OOP, I do not believe this will be too difficult, because of the way I have written it - and if it is difficult it will serve as a learning experience.

Thursday, November 03, 2005

VmWare

My license for my trial version of VMWare has no expired. I must say I have been very impressed by the power and simplicity of this software and intended to migrate my current home server to multiple VM's so improve both security and reliability.

I think the best feature of VMWare is the ability to add as many or as few hardware components to each VM you like. While my host PC had only one network card with only one IP address, I was able to set up one VM with Smoothwals, which contained 3 virtual network card, each with it's own IP address. Not only could the Smoothwall VM connect to the Internet through my existing network set-up, other PC's on my existing network could also see it. Additionally I set up three other VM's, Debian Linux, Windows 2000 and an copy of Windows 2003 Enterprise Server R2 which I acquired via the MS Beta testing program, all these exist on their own Internal Network and although a little sluggish at times (bearing in mind the host PC is a PIII with 700Mb RAM and a 1Ghz processor) it worked perfectly.

Another neat feature of VMWare is the ability to take snapshots of an entire VM should you need to make a critical change. If anything goes wrong you just revert back to the snapshot. No orphan registry keys no having to fath about deleting files and finding out how to under the mess you make.

You can limit the amount of memory each VM can have, specify how much hard disk space it is allowed, have several virtual disks set up as a RAID array if you like and as many CD drives as you wish as you have the option of using ISO images in place of real CD's.

The best part of all, is, the VM has no idea that is is in fact a VM running off a host PC with Windows or Linux, it thinks its a real PC and in my opinion its this degree of isolation which makes VMWare ideal when hosting multiple websites; perhaps one for an Internal LAN and one for the Internet and a dedicated mail server and FTP server. Should any of these servers be compromised, the attack can only do very limited damage and if you take regular snapshots then you will be able to use your time on figuring out how the system was compromised instead of using it to restore and reconfigure your system.

Although I am seeking a student discount on the license, I would be quite happy to pay the full $189 for the license and would urge any other web developers and software developers out there to give it a try themselves.

www.vmware.com

Monday, October 31, 2005

Ajax

If you have ever used Google Suggest you will appreciate why AJAX looks so promising.

The functionality do do this has actually been around a long time, since Internet Explorer 6 I believe. What it enables you to do is make HTTP requests to the server in the background using Javascript. As it uses Javascript, the request can be invoked by any event on the page.Once the request has been made, the Javascript can pick up the response as either plain text or XML.

This enables you to update only the areas of the page which require updating and doesn't require that the user reload the entire page and all its content. In my opinion, a web site implementing AJAX in their pages will not only save a lot of bandwidth, but also create sleeker
experience for their users.

I did some playing around with AJAX today, creating a simple form with a PHP back end. It is very simple and just asks questions, but you'll notice it is HTML and the page never loads. I hope that once I get the current phase of my works website done, I can have a go at using AJAX
there. Anyway, this is my little test:

http://adam.codedv.com/examples/ajax_form/ajax_form.html

The age of true event driven client server apps which run in the browser are upon us.

More than just a Blog

The idea of a Blog isn't that unique. This site alone must host millions - you have probably arrived here from VBForums, because I posted a link in my signature. Don't be fooled, this blog doesn't exist for any purpose other than to help me.

The idea here: I am programmer, buy many peoples standards, probably not a very good one. I have knowledge of over 5 languages and regularly use 4. I also spend a lot of time configuring web servers, mail servers and well just PC's. I often find myself confronted with a problem I have seen and know I have solved before, but at the time was too lazy to write down how I did it.

So I created this blog to help document a few of the problems and solutions I have come up against in my personal experience. In contradiction to my previous comment, I am probably wasting my time, because I have up until now been too lazy to write things down in the past.

Should this blog be of any use to you, that is great, if not, and you need help solving a problem, please don't post here, post on VBForums - there are people there so much more knowlegable than me.