[Israel.pm] separate logic from the data storage

rami doqa rod082 at yahoo.com
Tue Jun 20 05:41:08 PDT 2006

Hello Perl programmers, I need a help in how I can
separate the Perl class from the data storage access
if I want to access the database (add new , update or
delete customer records ) how can I implement this in
the best OOP way. for example:
if I have a Customer.pm class and I want to add new
customer to the system , is this a good way :  
Customer->new('...customer info')
and then access get and set methods.
or I must use overloading : if a new customer then
call the constructor with customer parameters , or if
I want to access an existing customer then call the
default constructor with empty parameters and just
call the get methods.

Is the access to the database and the queries and
connection located inside the class methods and in the

Dakka rami

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Perl mailing list