One of the simple and very useful pieces of code in Pherret (a PHP 5 framework) is the setProperties() function in the base Object class. The name originally came from Java Beans and works in a similar manner. I’m sharing it because it could be used in any code with PHP 5 or PHP 4.

Class for the DOM

It’s alive!! I have created a very cool, very simple, function to create new javascript objects that are (not just act upon) HTML DOM elements. Let me explain. Say I have a cool new tree menu I’m creating (true story), and I want others to be able to just start creating the menu items and adding them in via javascript if they need to. The ideal way would be to just say myItem = new MenuItem('Cool Item'); and have it return to me the actual menu item (the TR tag or LI tag) which can be inserted into the menu.

Creating Objects (4 of 5)

In the previous three object oriented programming articles written for, we introduced object oriented programming, spoke of thinking about a system object oriented, and discussed the importance of planning, even if only in one’s head. The next two articles, Creating Objects and Reusing Objects, delve into the meatier subject of writing objects. We will be discussing how to implement the plans we’ve made and the systems we’ve conceptualized. Without these principles, object oriented programming can become a mess instead of a blessing.

Very Suprised

I recently watched an email discussion comparing object-oriented programming and procedural programming in PHP. I was very surprised to see how many people there are that don’t understand the benefits of object-oriented programming and feel procedural is usually the best tool for the job.

Planning Systems (3 of 5)

Object-oriented programming gives us many new ways to create an application. It makes many things easier to do. One of these things is planning. Planning is an important and oft overlooked part of an application, but it is as essential to the success of the application as the coding of it.

Thinking Object-Oriented (2 of 5)

One of the more difficult jumps of the several leaps and bounds from procedural to object-oriented programming is conceptualizing the system you are programming. Thinking object-oriented is the real power of object-oriented programming, and even if we always program procedurally we may already be thinking object-oriented. We need to be able to see a system, a problem, or a program in terms of objects and their relationships to one another. When we do this any program will be much more simple and easy for us to grasp. It will be easy to picture how it works in our minds.

« Previous PageNext Page »