[Solar-talk] Method-Based Actions
Paul M Jones
pmjones at solarphp.com
Sat Jun 24 10:44:40 PDT 2006
On Jun 24, 2006, at 11:07 AM, Travis Swicegood wrote:
> Paul M Jones wrote:
>>> As far as being able to pick up a Solar app and figure out what's
>>> going
>>> on. A long term solution might be some sort of introspection that
>>> goes
>>> through all of the configuration values and spits out what's
>>> happening.
>>> I've seen this used in Java apps where you can add all sorts of
>>> custom
>>> things.
>>>
>>
>> That's fine for the long-running app instances that Java provides,
>> but in a shared-nothing architecture like PHP, the introspection has
>> to happen on every request, which can be terribly slow in relation to
>> everything else. Yeah, you could cache it after the first
>> introspection and read the cache, but even so I think that particular
>> tradeoff (speed for flexibility) is not one I'd like to make right
>> now.
>>
>
> I meant more as in the introspection that Reflections allow. It's
> there
> if someone wants to use it to figure out how Solar is configured, but
> Solar is smart enough to know what to do without using them. Example:
> It knows to load whatever is the configured ActionMapper class to
> handle
> mapping, but the introspection can load the ActionMapper and return
> how
> it would map basic actions.
I just realized this whole conversation might be moot.
Solar_Controller_Page::_actionMethod() takes an action and returns a
method name; it can be overridden in subclasses.
Thus, Travis_Controller_Page::_actionMethod() can convert $action to
anything it likes and return that. Is that helpful at all?
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list