I've been thinking about POOP a lot lately.
I'm looking to pick a RDBMS-OO mapper to use as a standard tool for (most) of my projects, and I am pretty sure that Class::DBI is the way I want to go. But one thing bothers me, how do you handle inheritance in Class::DBI (or other POOPy modules, if you have one that you really like)?
Consider a class hierarchy with three classes: Host, MailServer and WebServer.
Class: Host Properties: ID, name, IPAddress, location, OS Class: MailServer ISA Host Properties: MTA, version Class: WebServer ISA Host Properties: httpd, version, CGI
How do I go about structuring my database for this? What if I want to have a method in Host that can return a list of all hosts (including WebServers, MailServers, and other subclasses of Host) that match some criteria? Must I keep each subclass in a separate table? Is there some obvious solution that I am missing?
TGI says moo
In reply to Inheritance, Class::DBI and POOP by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |