Keep in mind I know nothing about the specifics, but let's say, for example, you have a Forum::Format module. This module has the methods:
You can also define the abstract or stub methods:$f->formatPost() $f->outputPost()
If some other class is calling the $f->formatPost() method, make sure it calls $f->preFormatPost() before and $f->postFormatPost() after. Even if the abstract versions of these classes do nothing, future module writers can have their classes inherit from Forum::Format and override these methods or even rewrite your Forum::Format module without changing a thing except for these two methods. I realize your system may be a bit more complex than this and having future writers rewrite one of your base classes is a bad idea, but the idea of leaving "hooks" for pre/post formatting (or other actions) is still sound.$f->preFormatPost() $f->postFormatPost() $f->preOutputPost() $f->postOutputPost()
Additionally, anything you do inside the Format method could call other methods that can be overridden. So if, within Format, you call $f->modifyHTML($text) or something similar, that method can be overridden to modify HTML differently in a child of the Forum::Format class.
In reply to Re: Best way to 'add modules' to web app?
by DBX
in thread Best way to 'add modules' to web app?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |