Welcome Guest, Not a member yet? Register   Sign In
Reoccuring code
#7

[eluser]esra[/eluser]
You could build a library based on the use of the factory design pattern. A factory is composed of get and set (create) methods and is designed to delegate responsibilities to other libraries. You can then load the factory in your base contoller. The factory can delegate to other libraries without loading those libraries until they are delegated (called) by the factory.

You can find information about the Factory pattern on the web. For a good example used in another PHP MVC framework, look here:

http://api.joomla.org/Joomla-Framework/JFactory.html


Messages In This Thread
Reoccuring code - by El Forum - 07-02-2007, 04:07 AM
Reoccuring code - by El Forum - 07-02-2007, 04:28 AM
Reoccuring code - by El Forum - 07-02-2007, 04:30 AM
Reoccuring code - by El Forum - 07-02-2007, 04:50 AM
Reoccuring code - by El Forum - 07-02-2007, 05:24 AM
Reoccuring code - by El Forum - 07-02-2007, 06:09 AM
Reoccuring code - by El Forum - 07-03-2007, 04:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB