PNASoft
RSS feed

Summarize

Galleries: 68   Photos: 2224
Folders: 67   Files: 2221
Members: 34756      


Apress - Beginning CakePHP From Novice To Professional

Apress - Beginning CakePHP From Novice To Professional

Introduction

Programmers have used frameworks for years, though for web development the use of frameworks has been more recent. Probably the main advantage of using a framework in any project, be it web-related or not, is explained by the concept of “inversion of control.” Many programs operate in such a way that the code is in control. In other words, the code decides when one operation should appear, how it should handle the user’s response, and so forth. Imagine if this order of control were inverted. Rather than have a script or library that contains a series of operations, the program has a series of objects that can do nothing until you extend them (even though they may contain tons of tools you could put to use). In this way, the framework calls on you, not the other way around.

For example, let’s say you are looking for a way to install a voting program into your web site. You browse the Internet and find a handful of useful PHP scripts that all promise to do that for you. After plugging in some unique settings, you place one of these scripts onto your server and launch the program. The program runs just fine, but if you wanted to change anything, you would have to go into the script, locate where the operation occurs that you want to change, and work the adjustment by hand. The script manages the flow of control in the sense that all of its operations are executed when the program runs, and if you want to control the program, you have to alter the script.

A framework, on the other hand, has an inverted flow of control. To produce a voting application in a framework, you would have to add to the framework those objects that would handle the voting. The framework would automatically pull together several resources to make the voting process happen, and you would have to intercept those resources or extend them to add your own functionality. A library will behave on its own, like the script example, and any changes must be made directly in the code. A framework is different in that it will wait for you to extend or add to it before it can really do anything for you. You will not need to go directly to the framework’s code to make changes; instead, the framework will take your extensions and use those instead of its own libraries.

CakePHP (or, for short, Cake) is a framework, not a set of libraries, even though it contains dozens of functions and methods that simplify web development much like libraries do. As such, Cake waits on you to extend its objects and add your own customized resources. With Cake, gone are the days of individually scripting each and every function. Instead, developers are using a bundled package of scripts, libraries, and conventions that are designed specifically for web development.
Tags:,

Google bookmark Yahoo bookmark Digg bookmark Furl bookmark Reddit bookmark Slashdot bookmark Stumbleupon bookmark Technorati bookmark Blinklist bookmark Newsvine bookmark Netvouz bookmark Wists bookmark Blogmarks bookmark Spurl bookmark Shadows bookmark Facebook bookmark
Placeholder for Google Adsense
Placeholder for Google Adsense



Comments

ngeleven said:

i like it

February 8, 2009 6:40 PM
PNASoft.com does not store any files on its server.
Please contact the content providers to delete copyright contents. Copyright by PNASoft.com