This confuses me, in the most simplest terms what does it do? Pretend you are explaining to your mother or someone almost please.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
This answer is in relation to other post in which Daniel White said to use factory for creating MySQL connection using factory pattern.
For MySQL connection I would rather use singleton pattern as you want to use same connection for accessing the database not create another one.
Factory Design Pattern (Factory Pattern) is for loose coupling. Like the meaning of factory, data to a factory (produce data) to final user. By this way, the factory break the tight coupling between source of data and process of data.
A factory just generates an object or objects.
You may have a factory that builds a MySQL connection.
http://en.wikipedia.org/wiki/Factory_method_pattern