I am trying to grasp the factory design pattern in PHP. It is very hard doing so with the usual automobile, animal, etc. examples.
I would like to try and grasp it through a real life problem of concrete database object instantiation.
So my first question would be: How would a UML diagram for this problem look like? What would be the necessary classes / interfaces ?
class Database class DatabaseFactory class Mysql class Postgresql ?
Any help / suggestion / reference is welcome.