RSS feed - Using POG with Flex
- Optimizing your web application
- Regenerating large objects
- PHP4 or PHP5
- New and Improved
- Evolution of a cube
- POG Museum
- POG 3.0 alpha
- Initial Performance results Part 2
- Initial performance results
- Proposal: POG 3.0 object model
- Suggest a feature
- A new year, A new POG release
- Many-Many relations
- POG 2.5 Released
- POG 2.5 beta
- Automatic table alignment
- New version: 2.1.2 released
- RSS should work well now
- RSS feed glitches
- What's new in 2.1.0
- PHP Objects 2.1.0 (preview)
- PHP Object relations FAQ
- PHP Object Relations
- Searching base64 encoded text
- How to debug POG-generated objects
- POG UI Tips
- Featuring Of Interest links
- PHP CRUD
- POG 2.0.1: A better code generator
- A look at the POG SOAP API
- POG 2.0.0 released
- Coming soon: Generate parent-child objects
- Generated abstraction v/s dynamic abstraction
- Zend Framework preview
- Coming soon: Generate Objects through SOAP
- Easily save images and files to a database
- PHP, Paypal & POG
- Five advanced Code Generator tips
- PHP Pagination using generated objects
- PHP Code Generator benchmarks
- Representing database objects using an AJAX Tree interface
- Using SETUP in a production environment
- Description of the generated object package
- Introducing PHP Object Generator version 1.6
- Using AJAX and PHP Object Generator
- When to use Object->SaveNew()
- Generating PHP objects in 2006
- Happy Holidays
- A short video of the POG Setup process
- A sneak peek at POG 1.6
- POG Tip: Field limits
- Previous versions.
- Searching the blog and tutorials sections
- Generating code with "Other" SQL data types
- Five general POG tips
- POG source code locations
- Microsoft SQL 2005 Express Edition
- Impatiently awaiting PHP 5.1 and PDO
- Php Object Generator goes open source
- POG generates PDO compatible code
- Oracle to offer free database
- POG Google group
- Database Wrappers and POG
- Revisions
- The generator blog
- An explanation of the 'Escape' function.
- Mirror, mirror
- Using POG to solve real world problems
- A php object-relational database tool
- A simple and flexible Object Oriented approach to PHP
Back to the Code Generator
The POG Google group
The POG tutorials/code samples
The POG mirror site
PHP CRUD
written 1390 days agoAs most of you know by now, CRUD stands for Create, Retrieve, Update, Delete and is one of the ‘philosophies’ behind POG, enabling PHP developers to generate the database abstraction required to perform these 4 atomic database operations (and more).
Now, POG is far from being the only solution when you want to use CRUD to ease your database application development. Here are some alternatives:
Using Stored Procedures
This approach is usually taken when you want to isolate database development from application development as much as possible. Teams are then usually split into a ‘database team’ and an ‘application team’. The database team is responsible for developing stored procedures that perform CRUD operations and the application team is responsible to create the stored procedure calls from within the application. Apart from achieving isolation, there aren’t any outstanding advantages to this method if it involves only CRUD operations. (and it actually defeats the purpose of CRUD in the first place). However, if you application relies on complex business rules and lots of tables and data transformation, stored procedures might be the way to go.
Dynamic CRUD libraries
There are a few dynamic CRUD libraries out there: PHP CRUD, Active Record (Ruby), MySQL table wrappers etc. These libraries analyze your tables and create dynamic, virtual ‘php objects’ that can be saved, deleted, created and updated. The code overhead is usually less than if you were using generated objects your entire application is then highly coupled with you data abstraction library. The CRUD operations are also slower than if you use code generation to create static objects that match your database.
PHP Frameworks
Another alternative is to download and learn one of the numerous PHP application development frameworks available out there. Frameworks usually provide a high level API to commonly performed coding tasks, database abstraction or CRUD usually being one of them. The Zend framework is an example of such frameworks. Frameworks are usually useful if you’re building large web applications and want to take advantage of a variety of different abstractions provided by the framework. So, frameworks are good if you take advantage of a lot of the components they provide, but too much if you’re only looking for database abstraction.
Back to Code Generation
Code generation, is, I believe, still very-much underrated as an option for tackling database abstraction and CRUD. I’ve had experiences with different database application development strategies over the years, as well as different programming styles ranging from eXtreme programming to formal, documentation-driven development. From these different experiences, I can honestly say that code-generation is the one I find the most efficient and productive. Example: One team I worked with consisted of 2 sub teams: The database guys and the application guys. Once every 2-3 months, the database team would make some schema changes to accommodate for new feature requests. At first, the application team used a dynamic object database library which worked well most of the time but because it was so tightly coupled with the application code, would break different parts of the application when it couldn’t handle the schema change, resulting in many hours of trying to figure out why the abstraction library was messing up. The application team then decided to spend some time to implement a simple code generator, which would generate once and for all the required objects and never have to think of it again until the next set of schema changes. They also used code generation to generate constant strings for table names, column names etc that are used by stored procedure calls, instead of keeping everything dynamic.
Keeping everything dynamic might seem cool at first sight, but it almost ends up with the developers wasting many hours debugging a library that they didn’t even write in the first place. The reason why I keep advocating for new developers to try POG and give us your opinion is because POG allows you to get away from all the woes mentioned above. In some cases, I do think POG is not the best solution. Sometimes, you have to use stored procedures and sometimes, using a framework makes more sense. Most of the time though, the developer only needs a simple and easy to use PHP CRUD library.

This is a weblog about the Php Object Generator (POG) project, OO PHP, databases and Php code generators in general.
Php Object Generator, (POG) is an open source PHP code generator which automatically generates clean & tested Object Oriented code for your PHP4/PHP5 application.
Subscribe to our RSS feed
Feedback, Feature Requests, Bugs to:
The POG Google group
Send us a Hello through email
A new entrant to the programming realm and PHP specifically.
Trying to better understand OO (Class and Functions). Your product /tutorials seem to be a way for me to improve my understanding and utility as a entry level PHP resource.
— TTDMan Sep 13, 08:59 PM #