warthurton has asked for the wisdom of the Perl Monks concerning the following question:

I need to create some Class::DBI classes to do data import/export/munging for many clients.

I would like to bundle some Customer specific business logic into the classes. I was curious as to how I should do this.

Let's say that I'm making Accounting::OrderHeader, Accounting::OrderLine but I want to have specific business logic for OrderHeader different for each client. But want to use the same Object Names for each client.

Whould I make.

Accounting::DBI || Accounting::OrderHeaderModel || Accounting::OrderHeaderClient <== Change for each client. || Accounting::OrderHeader

Or is there a better way to do this?

Replies are listed 'Best First'.
Re: Class::DBI and Business Logic
by perrin (Chancellor) on Aug 01, 2003 at 20:39 UTC
    Typically you would either just make a different subclass for each client and use that in your code (not appropriate if the code using this module is the same for every client), or make a factory method that looks at some config to determine which class to use. SuperSearch for "factory" or look at Class::Factory.