Hi Taco, Am Sonntag, den 28.12.2008, 12:12 +0100 schrieb Taco Jung: [...] > This way, I thought I could separate the public and admin even more. > But as stated, it causes more problems then it solves.
Not necessarily. There are often reasons why a single application works on different databases. One of the reasons might be legacy data or - if carefully thought out - an admin panel requiring additional data. There are two ways how to do that with the Zend Framework. The first way would be to request your business objects from factories. The factories know which database adapter must be passed. I don't really like this approach because it spreads too much knowledge about the database structure in the overall application. Another way would be to write your custom database adapter implementing the same interface as Zend_Db_Adapter (sadly, there is no interface for Zend_Db_Adapter implementations so you must extend the abstract class). The connection adapter is a composite of all of your required database connections. Plus it decides which concrete adapter needs to be used for the concrete query. It could even implement more complex stuff like sending queries to different servers and merging the results and so on. cu, Lars
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
