Phoenix.pm: Decisions, decisions
Beaves at aol.com
Beaves at aol.com
Thu Jun 22 02:27:13 CDT 2000
Hello, yous'all (Jersey boy visits Texas)
OK, I'm looking for some input. I am wondering the best way to set up a
certain MySQL table column (or columns).
In my Internet Contact Manager, each group record currently has about 10
integer columns that indicate various customized priviledege levels for
certain funtions (such as search, email, invite, postmessage, etc). Theses
privililedge levels will not usually be searched, but will of course be
called up each time that group is accessed.
In general database terms, what are the pros and cons of:
1)Keeping the current modus apparandi (most certainly mispelled...)
versus
2)Changing the priviledges to a single column of a (currently) 10 digit int
or char, and parsing the privilidges each time the group is accessed.
Just wondering.
To make this a legitimate Perl Post, I'll add an intersting tidbit from
Damian Conway's book "Object Oriented Perl". I always wondered exactly how a
method was searched for before finally giving up. My concern was usually
centered around where a given package's AUTOLOAD routine fit in to the
heirarchy. The term for this procedure, as I came to find out, is called
'dispatching' a method.
If $obj->method() is called:
1: Look in the objects class for sub 'method' (simple enough)
2: ELSE, Search @ISA, stepping through each parent class, depth first, left
to right.
3: ELSE, Look in UNIVERAL for the sub 'method.'
4: ELSE, do steps 1,2,3, but now look for the sub 'AUTOLOAD'.
5: Give up and throw and exception. ("Can't locate object method "method"
via package "Class")
If this piques your curiosity, you might want to grab the latest TPJ. Conway
has a neat article about Multiple Dispatching and Dispatch Tables, which can
be used to 'improve' the dispatching of methods to suit your needs.
Lastly, I just finished 'objectizing' the code that my ICM message board
uses. I used a lot of the techniques from Conway's book. It might make for
topic of interest to some of you on some hot muggy Tuesday night, and I'd be
glad to stumble through my design (or plagiarism) steps. I am curious to see
how others approach the initial design phase of programming.
OK, Yous'all can go now...
Tim
shameless ICM plug:
http://www.azwebs.com/cgi-local/icm/icm.cgi
100% perl generated, and MySQL used exclusively
More information about the Phoenix-pm
mailing list