Shelley wrote:
I am working on a sns site, and now my practice is grouping classes of a
function

"classes of a function"... perhaps "classes related to certain functionality"?

(i. e. subscription) together. When I need it, just load the "package":
subscription.

Right? ;)

Hm... I do not know your project, but to have many classes just to handle subscription, sounds a bit too much to me. Why don't you have a class called "subscription", which might even extend a class called "person" or "user" - the "subscription" class can have methods, for instance "subscribe" and "unsubscribe", and because "subscription" extends "person" or "user" - it already "knows" who is the "person"/"user".

And then, for example, to subscribe a "person"/"user", you do -

$subscription->subscribe($list_id);

Other possible actions -

$subscription->un_subscribe($list_id);
$subscription->is_subscriber($list_id);
$subscription->lists();

etc.

This way class "subscription" "packs" the methods needed to handle subscription related activities, so in your own jargon, this "class" is a "package".

Of course, if the subscription process is extremely complicated, you can have more classes.

Iv

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to