Dygear, let me criticise some of your code. I support your efforts, even though I was (and maybe will continue) making my own class.
Here is your code for message sending:
$MSO = new MSO();
$MSO->UCID = $UCID
$MSO->PLID = $PLID
$MSO->UserType = MSO_USER;
$MSO->Msg = "Welcome to the Race, {$PName}^9 ({$UName})!";
// Setup Option 2 - Array, Fast, and Short, but Ugly.
$MSO = new MSO(array(
'UCID' => $UCID,
'PLID' => $PLID,
'UserType' => MSO_USER;
'Msg' => "Welcome to the Race, {$PName}^9 ({$UName})!"
);
In this code you repeat MSO so many times. Maybe do something about that? The 2nd option isn't that ugly, but still you repeat some names. The 3rd way is almost the same as 2nd, just written a bit differently: you m,oved array parsing from constructor to
send method.
Think of it: any time you send a message to a connection, you need to supply all the 3 parameters: UCID, message text and message type. You need to remember them exactly and to put them in the right place: in case of an associative array you have to give them proper indexes. In case of a special method you need to supply them in a proper order. This is the same in it's essence. But what is easier to code: this
$MCO = new MCO(array("UCID" => $UCID, "PLID" => $PLID, "Message" => $myMessageText));
(BTW, you'll need to keep and pass global variables for the connection, right? That's why I made my plugins as objects that have links to the connection class and $connection resourse Id)
or this (let it be, as you prefer, a call of class method):
MSO::send($UCID, $PLID, $myMessageText);
As you see, the code is still readable, unless you step away from naming conventions and write something like
MSO::send($sdkjslkj, $saadasda, $mmmmmm);
In my opinion, there is no need to type the array keys to remind to yourself another time what parameters are supplied. You just have keep your variables names neat and also, anyway there is the function definition there in the code. If you don't know what parameters to supply, go there and read it. No need to repeat partso of the function definition in the code, right?
I'm not a guru in programming, but I've tried the "nice" style like that in option 1, and it appeared to be too labour-intensive to code. With years I've got an idea that the less you repeat pieces of code, the better.
Of course, it is my opinion, you may choose whatever way you prefer.