Although this post might not appeal to my customer base, it should however peak an interest in avid developers who are starting out and wanting to take up web development as a career.
The web is forever changing and at such a fast pace that you really need to keep up with latest technologies and embrace them, else you going to be left in a cloud of dust. Web development or web design is sometimes perceived to be a hobby and the general consensus that anyone can simply build a website, is completely rubbish. People are wisening up to the fact that more and more business is being conducted over the web and that websites are an integral part of the process.
I always believed that web development should be classed as software. In some ways it is actually a lot more complex than programming a simple system application. For instance, you need to make sure your website is view-able on all browsers, it needs to be compatible on all devices with different screen sizes, it needs to conform to standards for people with certain disabilities, security is a huge issues and your site needs to be locked down from intruders, and many more. I’m not talking about a simple website with general content pages, although CMS platforms, such as WordPress, Joomla and Drupal, have come to the party there and make it really simple to get a basic site up and running with minimal effort, with super structured and tightly refined software. The type of websites I am talking about are the custom built applications that I have been building for businesses over the years. You can almost call them custom cloud solutions that manage a certain aspect of the particular business. These consist of stock ordering systems, staff attendance, a lot of general reporting systems, etc.
My approach to development in the past has always been a presentational type of structure. I would generally get an idea on how the software would all come together and dive right in. This meant I would be coding as I go and having to come up with naming conventions for folders, functions, files and all sorts. Sometimes having to repeat code only because the structure ended up being all over the place, especially when it comes to major changes in the systems I built and something the client requests that I hadn’t even thought of.
These problems are soon to be a thing of the past as I have started looking into building these applications on a framework, in particular Zend Framework. Zend has been around for a while now, but I never really took the time to understand what it did. The definition of a framework according to Wikipedia is as follows:
A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities used in web development. For example, many frameworks provide libraries for database access, templating frameworks and session management, and often promote code reuse.
Let us dissect this definition:
Basically dynamic websites are composed of three components: the data, the presentation and the logic. In Web Frameworks these components are referred to as Model, View and Controller. If you have heard of MVC Frameworks, that is what it stands for. Most websites can intermingle these components, which is acceptable for smaller projects, but it becomes extremely difficult to manage as the project grows in size and gets more complex.
Some advantages of Zend and how intermingling these components affect a project?
1. Suppose you get a designer to improve the general look and feel. They don’t know PHP at all, the last thing you want them doing is messing with the code. The framework separates all elements, so a designer can just be working on the HTML and CSS and visa-versa.
2. I know this probably won’t happen, but suppose you need to change a database type from MySQL to SQL. The controller manipulates the data while the model takes care of the connections. So changing a database type is painless.
3. Code always evolves, so if there are new ways of doing things you can implement changes immediately by modifying the model.
4. Testing environment, Zend has a build in features for this sole purpose. I must admit, it is quite a pain having two different sites and making sure both are updated when a change is made. This alone will save months of work.
5. Another great feature that Zend has is that it integrates with different API’s. There are built in API’s for all Google apps for instance, you can embed Google maps, pick up your mail, etc.
6. Code is tightly structured and has been developed by absolute geniuses, so you know it’s good.
7. It’s open source so it’s free. Although there is a commercial licensed version.
So, how does Zend avoid the universal problems and hassles?
It seperates these components into distinct parts right in the very beginning and has code which loosely couples these components together. By doing this you’ll create a more manageable, testable and scalable website.