I’ve some reusable code which depend on the presence of some database. So I need to ensure in my lib that a database exists. What’s the right method to do it ?
I was thinking about having a class that would setup the tables if they’re not present. Is there any good known design pattern or method to use ?
PS : I’m using ZF 1.
EDIT : By correct, I’m intending what we, programmers, put behind correct : elegant, which means : reusable, configurable, platform independent, few dependencies, low coupling.
EDIT : after the first comments and answers, I’ve changed that very poor choice of word “module” to “library”.
I would just create a single class like this:
Usage is: