Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Approach to developing web apps..

Options
  • 10-06-2009 11:56am
    #1
    Registered Users Posts: 2,228 ✭✭✭


    Hi There,

    I'm working on my second web app now and i'm just wondering should I be going down the Object Oriented road in the future. I have experience in OOD through Java.

    At the moment my app has an index page using switch on a pageId to decide what subpage to include.

    then in each sub page I have switch($_GET) to decide to what to actions to perform/pages to display.

    I'm just looking for an approach that will make my app easy to maintain and change without having to visit each php page to alter things.

    One thing I have done is make a php page called menus and make an array with links to be included in the nav bar. I then include this page and print out each item using a loop. Its pretty easy to include a new item, I just add an array item in menus.php and the menu is updated in all pages..

    Also, I've noticed different frameworks like ROR and Zend being mentioned..what do these have to offer??

    I'd appreciate any other tips on what you guys do.. thanks.


Comments

  • Registered Users Posts: 2,793 ✭✭✭oeb


    techguy wrote: »
    Hi There,

    I'm working on my second web app now and i'm just wondering should I be going down the Object Oriented road in the future. I have experience in OOD through Java.

    At the moment my app has an index page using switch on a pageId to decide what subpage to include.

    then in each sub page I have switch($_GET) to decide to what to actions to perform/pages to display.

    I'm just looking for an approach that will make my app easy to maintain and change without having to visit each php page to alter things.

    One thing I have done is make a php page called menus and make an array with links to be included in the nav bar. I then include this page and print out each item using a loop. Its pretty easy to include a new item, I just add an array item in menus.php and the menu is updated in all pages..

    Also, I've noticed different frameworks like ROR and Zend being mentioned..what do these have to offer??

    I'd appreciate any other tips on what you guys do.. thanks.


    Personally, I found the best way to get a better grip on how the various frameworks operate was to write my own simple MVC framework (using a tutorial like this one), this will give you a much better idea about the thought process required to code using something like zend or cake. I know that I personally, not having studied computing in college, found some of the MVC pattern stuff confusing and this helped an awful lot.

    In my day job at the moment I don't use any framework, but I am currently doing a load of playing with Zend at home, and I am hoping to have it learned to a level where I am happy to implement a work site with it soon.


  • Registered Users Posts: 197 ✭✭pauldiv


    It sounds like you have been putting in some time learning how to hand code php. Thats a great start.

    You mentioned include files. After learning about variables and loops etc I started looking at include files. I wrote the menu and footer in plain html and configured the server to parse html files.

    This pretty simple technique means that you only need to update things like the header, footer, menu once for the changes to cascade though the site.
    It also means you don't need to write extra scripts to process and display your menus. That kinda seems like extra work to me.

    I think you realise this and that is why you are now interested in frameworks. The idea is to get the most bang for your buck with as little coding as possible. That is why smart developers sometimes use frameworks rather than code everything from scratch.

    Frameworks are like pre-built plain vanilla web applications. All the hard stuff will already be built in saving you lots of coding time. For example CMSMadeSimple has hierarchical menus already built in. That gives you more time to get on with the more important development tasks such as any special modules you need to hand code; site design and usability; search engine optimisation etc.

    There are hundreds of these systems. They can all be customised and used for various web applications like blogs, carts, and brochure sites. You should only try to learn a few of the better ones that are well supported with excellent documentation and an active community.

    Like yourself I did Java OOP in college but have not used it much on the web. Rather than sweating over coding objects from scratch I look for a pre-built framework that ticks all the boxes and then plan it from there.

    If you focus too much on custom code then you might have problems 12 months down the line when one of your clients requests a change.

    Its just a case of enjoying the learning and discovering faster ways of doing things. If you master a couple of frameworks such as CodeIgniter and CMSMadeSimple then you will have more time for walking on the beach rather than slogging at the keyboard.


Advertisement