- 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
- 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
A couple weeks ago, we announced that POG 2.0 will allow medium-advanced programmers to generate POG objects programmatically through a SOAP web-service.
There’s also a 2nd important feature which has been implemented in POG 2.0 and we’d like to talk about it in this post: Generation of parent(s)-child(ren) objects. This has been a much demanded feature for a while now, and we’re very happy to finally provide a solution.
As usual, our focus has been to implement the cleanest, simplest and most elegant solution possible and this is what it boils down to:
Preserving POG’s simplicity
One of POG’s core strengths is its simplicity and almost-zero learning curve. And the reason behind this simplicity is that generated objects only have 5 essential CRUD methods: Save, SaveNew, Delete, Get and GetList.
POG 2.0 preserves this simplicity by generating parent-child code only when it is requested. That is, if you choose not to “connect” your objects upon generation, the objects generated in POG 2.0 will be exactly identical to POG 1.6 or any other prior version.
Moreover, when objects are connected, POG generates the minimum amount of code possible to keep your objects small and easy to maintain:
Parent – Child relationships
POG 2.0 allows you to generate objects that are related to other objects. We’ve added 2 new attribute types which can be assigned to your object attributes: Child and Parent.
Let’s say you intend to generate 2 objects: Author and Book. When you’re defining the Author object, simply add ‘Book’ as one of its attributes and assign the attribute type ‘Child’ to it. This tells POG that Author is a parent object and will be connected to a Book object. Next, while defining the Book object, add ‘Author’ as one of the attributes and assign the attribute type ‘Parent’ to it.
You’ve essentially connected two objects. Pretty simple, no?
The assumption here is that the developer is responsible for generating the correct relations because we wanted POG to remain stateless and didn’t want to over-complicate the UI. So for instance, if a developer generates an Author object and assigns a Book object as child, then he/she needs to generate a Book object and assign Author as parent. POG does not enforce any rules upon generation and will not tell the developer what he/she needs to do.
So, what does the developer get at the end of all this? The added benefits of generating code relations is that POG generates additional helper methods that accelerate web development even more. The following is a summary of the exact benefits:
The developer can simply call Object -> Save() and all the children associated with that object will be saved recursively.
Allows recursive deletion of children objects. For example, calling Delete(deep) on an Author object will also delete all the Book objects associated with that author from the database.
Associates a child object to the parent object.
Retrieves all children associated with parent object.
Associates a parent object to the child object
Returns the parent object associated with the child object
Note that a developer can very well manually implement relations between objects and could implement the same type of functions. As with the 5 essential CRUD methods, POG simply generates the above list of Relations function to accelerate development even more.
POG 2.0 will be released around April 1st 2006. In the meantime, you can find a preview at http://beta.phpobjectgenerator.com
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