Using the factory pattern (mad rantings of a mind without coffee)
View Single Post
04-05-2008, 07:57 PM
Join Date: Apr 2008
this is my first post and I'm not an native english speaker so i will try to do my best.
I'm not seeing the right purposes of using factory pattern. You are trying to hide the specific type of the object when instantiating it. But you have to specify which type of database you want to use.
You made something like this :
so, now imagine that you are connecting with this method in 100 different pages. and now you want to change from mysql to oracle.
You need to open all the 100 files and change the $factory->connect('mysql') to $factory->connect('oracle') :s
or am i wrong ?
View Public Profile
Send a private message to Gurzi
Find More Posts by Gurzi