I am creating a series of objects which will persist to a SQL database. The question comes into play with how I should design these objects.
Right now I have a PERSON object which has all kinds of basic info (name, address, etc). Then I took this object and used it as a base class for an EMPLOYEE object (adds SSN, Title, etc).
This works fine, but here is where I lost it. I have a few more types to add and lets say I have a CUSTOMER who is also a VENDOR. So I want this entity to have the properties and functions of PERSON, VENDOR and CUSTOMER.
The only thing I can think of is to make PERSON inheret the other two... Each object supports its own Save method which will persist its data to the correct tables in the database.
So from the code I need to be able to create a new person and tell it what types they are (EMPLOYEE, VENDOR, etc)
Any advice would be greatly appreciated.
Vuud
"I'm never going to work another day in my life. The Gods told me to relax... I'm gonna be hooked up right"
In reply to Objects in PERL by Vuud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |