38 Comments
- bossman, on 10/12/2007, -0/+1Meh. This is just generating OOish code where 1 object = 1 record in the table you spec. Cool and all, but a quick look at it makes me wonder how can it handle relations between objects or relations between tables. Example: What if I have artists and albums, and songs, where an artist has many albums and an album has many songs? Do I still need to write that plumbing code? Its a nice start, but other frameworks are more advanced.
- gmccreight, on 10/12/2007, -0/+1For anyone who's interested, this type of database-backended object attribute scheme is called ORM (Object-Relational Mapping) persistence. It's a pretty standard technique which allows you to basically query and update a database using object syntax instead of SQL queries. The PHP code which is generated by this website is interesting, but it might work better as a superclass library, from which each of the objects inherits.
Why would this be the case?
The reason has to do with scalability and customization. If you have more than a couple of these objects then as you work with them, add your own custom methods, etc, you'll have to add those methods to each of the object classes, as opposed to a single, more abstract, superclass.
The reason POG does it this way is because a single script if far more easy to understand than object inheritance (the superclass stuff), and it only requires one file per object (as opposed to a single file and a library it needs).
Google for "ORM PHP". The top result is a very edifying wiki page about all the options for ORM in PHP. Heard of Ruby on Rails? There's a PHP ORM library based on Rails' ActiveRecord (One of the key components of Rails), which is far more powerful than POG. That library claims to be PEAR compliant ( I don't have a clue if it is or not), but there are others like DB_DataObject which is actually an official PEAR package.
So, what's good about POG? It's a piece of cake to setup and use, and it works well (I'm guessing, I haven't actually used it). What's bad about it? It won't scale nearly as well as a more standard ORM library. If you're serious about programming, you owe it to yourself to look into ORM in more detail. Looking at the code POG generates is a great introduction to the concepts, but don't stop there! - brianjking, on 10/12/2007, -0/+1@Weinstmd . . .
I agree! This would be highly useful! Creating your PHP around your existing database design. This would also allow for users to verify the integrity of their DB design and make sure they aren't carelessly forgetting an important aspect of the DB. Thanks for the post! - SystemLord, on 10/12/2007, -0/+1This is stupid. It's just plain database access code. Great for one form but since when are web applications one form. Writting that out would take 15 minutes and would probably be far more useful. If you want to program learn how to program. There is no IDE in the world that can beat proper design patterns.
- nsanity, on 10/12/2007, -0/+1It's a bit simplistic and unusable for my particular taste, but the idea, although not new, is at least accessible. No digg.
- Belgarath, on 10/12/2007, -0/+0Very very nice !!!!!!
- brianjking, on 10/12/2007, -0/+0Very interesting. Although I must say that the actual design of the database is incredibly important, and without that being implemented and properly designed no matter how well the PHP is constructed the data will not be organized properly. I very well may just be tired, although it's bookmarked and will be re-visited.
Thanks for the digg. dugg++ - joelwan, on 10/12/2007, -0/+0Thanks for the kind words. We've just added a video 4 min video that shows the new setup process.
http://www.phpobjectgenerator.com/plog/article/65/a-short-video-of-the-pog-setup-process
thanks again. - weinstmd, on 10/12/2007, -0/+0Wow. I've only been playing around with this for five minutes, but it looks amazing.
I'd like to see if there was a way to take an existing database schema and create the objects that way. But so far I'm very impressed with what they've done here. - PaleSpyder, on 10/12/2007, -0/+0Very cool Tool!!!! Made my life a bit easier anyway. Thanks!!!!
- DrSmooth, on 10/12/2007, -0/+0Is that a sperm cell on the "generate" button?!?! Nice touch.
- pooper12, on 10/12/2007, -0/+0haha, I for one don't like to do repetitive tasks, so if you want to code the same thing over and over, go ahead. no one's preventing you from doing so tm8992.
- mbelly, on 10/12/2007, -0/+0Very Impressive. +digg
- inactive, on 10/12/2007, -0/+0Nice!
- sandrejev, on 10/12/2007, -0/+0Somebody tell me what is OOP, good or evil?
- jonabarn, on 10/12/2007, -0/+0It generates CRUD methods in your class, not just classes.
- pooper12, on 10/12/2007, -0/+0It's following the object-relational mapping design pattern, so i don't see your point. This is the same programming design pattern present in many other web application frameworks such as RoR and CakePHP.
- mikaelhg, on 10/12/2007, -0/+0People who think this is cool need to take a look at Oracle JDeveloper and EJB3 persistence.
- jaytee33, on 10/12/2007, -0/+0OOP is object oriented programming. POG is cool.
- BlazinX, on 10/12/2007, -0/+0Niice.
- tm8992, on 10/12/2007, -0/+0Frankly, I'd prefer to code myself. In my mind, this is just for people who are too lazy to implement their own way of accessing a database...
- Mizark, on 10/12/2007, -0/+0This is sweet!
- zetsurin, on 10/12/2007, -1/+0Looks nice, but I am a PostgreSQL person myself.
- UpBeetRob, on 10/12/2007, -1/+0This looks like the start of something really awesome, can't wait to see what the future holds for this.
- mercnboy3, on 10/12/2007, -1/+0Good Idea, needs PHP 5 Support, Great Start!
- yogurtman, on 10/12/2007, -1/+0aaaawesome.!
- cprior, on 10/12/2007, -3/+1I just found symfony and besides the spelling I already embraced it. Being one of those guys which only know PHP and MySQL I am glad somebody brought Ruby On Rails into my syntax realm.
http://symfony-project.com - v3xt0r, on 10/12/2007, -3/+1POG = Pointless Object Generator
It's a nice start (err, concept)... but needs a LOT more work to be useful enough to build custom (real world) php objects.
There is far more to PHP than simply building a wrapper object for a database. - Eraser, on 10/12/2007, -3/+0Agreed veridicus... this is very lame
+bury - Nerfdude, on 10/12/2007, -3/+0i was really hoping this would have something to do with pogs. lame :(
- jool, on 10/12/2007, -3/+0It might be a starting point for those who have no idea of how to make code to access a database but it needs a lot of work to be seriously usable code. The coder really seems to lack experience with anything else than PHP 4. It generates compatible code but not much more for PHP 5 - 5.1
- ermau, on 10/12/2007, -3/+0OOP = Object Oriented Programming, and its good.
What in the world is the point of this generator? It's complete crap. Anyone that could understand the code it generates enough to use it would be able to make better objects in the first place. - timdorr, on 10/12/2007, -3/+0Ouch, that's a mess of code. Kind of excessive, don't you think? I don't know why every PHP developer is trying to be like a Java developer. Most of the overhead in coding in that way sucks. Look at Rails and you'll see why you can do better. It's why I developed my own low-overhead coding framework in PHP to gain a lot of the advantages of Rails while maintaining access to the ubiquity of PHP.
- veridicus, on 10/12/2007, -3/+0Come on... this is completely lame. No self-respecting software developer needs a rudimentary class generator. Anyone who develops code on a daily basis has a set of starter class files anyway to save some typing.
- JMJimmy, on 10/12/2007, -3/+0looks cool on the surface - actual code while correct is *excessive* and no self respecting developer would ever use this crap. lame.
- Xoligy, on 10/12/2007, -3/+0Anyone heard of copying and pasting previous code? It's a hell of a lot easier than using some 3rd party ***** generator.
- inactive, on 10/12/2007, -4/+0I almost thought someone made a code generator, but this is pretty ***** far from it.
- inactive, on 10/12/2007, -5/+0this is ***** dumb


What is Digg?
Check out the new & improved