Welcome Guest, Not a member yet? Register   Sign In
factory pattern?
#3

[eluser]Cro_Crx[/eluser]
Have you considered using an Object Relational Mapper ? The features you've described are available with an ORM as well as many other benefits. They generally tend to minimize the amount of code you'll write as well.

I use DMZ ==> http://www.overzealous.com/dmz/pages/toc.html It's really great.

There is a bit of a learning curve as you'll need to write your models differently to use DMZ.

Those examples of the Factory class above can be done with DMZ. Here's the top example done in DMZ

Code:
//$mynewobj = ci::Factory(array(‘type’=>‘contact’,‘fname’=>‘bob’));
    $contact = new Contact();
    $contact->where('fname', 'bob');
    $contact->get();


Messages In This Thread
factory pattern? - by El Forum - 01-13-2010, 06:04 PM
factory pattern? - by El Forum - 01-14-2010, 03:46 AM
factory pattern? - by El Forum - 01-14-2010, 04:11 AM
factory pattern? - by El Forum - 01-14-2010, 07:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB