in reply to How to implement set-style membership lists in my obejcts
Ordinarily, sub-classing is an "is-a" relationship (a 'Dog' is-a 'Animal'). I wouldn't say that a User is-a Site. This is more properly a 'has-a' relationship. (A Site has Users). Other than that, Site and User are unrelated (neither inherits from the other).
RDBMSs can happily and efficiently express has-a relationships, and there are ORM wrappers to allow you to do this in perl. I don't have a particular recommendation, but reading the docs for Class::DBI might give you a fresh perspective, and others might chime in with advice.
So I'd say: "Don't try to force your data into a purely hierarchical system if it isn't, and don't try to model all hierarchical relationships as OO inheritance."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to implement set-style membership lists in my obejcts
by clinton (Priest) on May 16, 2007 at 12:19 UTC |