- 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
1. More Planning
Since POG will generate your database access layer in less than a day’s work, consider spending more time designing other aspects of your project.
If you’re building a website:
- spend more time on the content, layout and design of the pages themselves. Don’t worry about the code for now. When you’re done designing the web forms, POG will generate the code for you. For example, we have a tutorial that shows how to generate PHP code to create a registration system that you can use as an example.
If you’re building a web application:
- is the work flow of your application complete?
- what framework/design pattern will you use? MVC? Factory? Take the time to plan your entire project more thoroughly, because now, you can afford to!
In other words, feel free to ‘forget’ about how you’re going to store/retrieve/update things to/from your database for now. Let us take care of that for you
2. Incremental Programming
Once you have a pretty good idea on what type of objects to generate, go ahead and do it. Don’t wait for everything to be finalized. There’s a balance to strike between being thorough in the design/analysis part of your project and choosing when to start implementation. Let’s face it, requirements will inevitably evolve at some point, your objects will have to change, but you can’t wait for everything to be set in stone before you start coding. We’ve got you covered though. Whenever you need to make a change to your object, simply use the @link tag found in the header of every object generated by POG. After all, getting a prototype up and running fast is what POG is all about.
3. Naming Conventions
POG lets you name your object and attributes any way you want. However, for best results, we suggest you generate all your objects using the same naming conventions. For example, for our own projects, we follow these naming guidelines for POG:
- Capitalize the first letter of the object name.
- Use camel casing for your attributes. You don’t have to use these exact naming conventions, but if you do, you’ll achieve consistency between your different objects. This will make your code cleaner and easier to maintain.
4. Smaller Objects Equals Faster Code
Keep your objects relatively small. Having smaller objects equals faster code. For example, if you’re designing a registration system where users can upload a picture of themselves, the easiest way to do this is to create a User object with a picture attribute. There’s nothing wrong with that, and it works fine. However, if you want faster code, you should split your object into a User and an Image object. In this case, you would have an image id attribute that links the user object to the image object. This way, whenever you’re trying to get a list of user names from the User table in the database, you’re not retrieving large amounts of data unnecessarily.
The rule of thumb is: Whenever you’re storing multimedia files as such as video, pictures and music, do not store them as attributes of another object. Instead, store them as objects themselves.
5. Ask For Help
Finally, in case you have a question for which you can’t find an answer to in the POG Blog or POG tutorials, feel free to post it at the POG Google group. You’ll usually get an answer within 24 hours.
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