Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release")
| From: | Tomas V.V.Cox | Date: | Sat, 31 Aug 2002 14:32:03 +0000 |
| Subject: | Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release") | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8781@lists.php.net to get a copy of this message | ||
Markus Wolff wrote:
>
> On Fri, 30 Aug 2002 10:21:28 -0500 (CDT)
> Brent Cook <busterb@mail.utexas.edu> wrote:
>
>
> I think it would be a wise idea in general to extend the PEAR coding
> guidelines with suggestions for some common method names.
>
> I´ve been (forced to) working with the .NET framework lately and a big
> advantage is that most classes follow a common method naming system.
> This makes it easy to work with a new class because you can rely on some
> common method names to be always present and doing almost the same (or
> at least accept and return the same variable types).
>
> So I guess it wouldn´t be too bad to introduce something like this to
> PEAR. Say, a common method "get()" for getting a string representation
> of a class´ output, "show()" for printing it to the browser.
You mean get/print the data that the class is supposed to return, no?
> Those methods could commonly accept an optional parameter where
> applicable, that determine the type of output (if the class supports
> multiple output types). This can be one of several common constants like
> i.e. "PEAR_OUTPUT_HTML", "PEAR_OUTPUT_XML" and the like...
As Alexander suggested before: connect() and disconnect() too.
> Just an idea.
Please propose others, I'm always happy with strict coding standars :)
> > Sorry, that was a little OT. Hi everyone, BTW. I'm back and married now!
>
> Congrats! :-)
Congrants from here too Brent!
Tomas V.V.Cox