From: <an...@io...> - 2005-07-28 02:05:34
|
I once again started wondering what is the role of the action class.. Action implements many functionalities but I think many of them are not necessarily core action functionalities.. Questionable ones are imo content generation, message carrying, url creations, task validation+ url_additional setting and even caching or security. I know that you can turn the above functionality off or just ignore that it is there, but as Chris said, the Action class is quite huge already. If I recall correctly, OI1 had a different class for "handlers" and "actions".. I think handlers were more like special actions with the above functionality.. Why was this separation dropped? I think it would make the structure easier to understand if it would be made clear that "handler"-actions are only one way to use actions. As I have said before, I think that finding a valid task and setting url_additional would IMO be more like actionresolvers task than actions. Also message carrying might be wise to be moved elsewhere since it might be nice to be able to show messages also when redirecting away from an action, or showing messages that sub-actions (like box beneration) produce. Url creation is pretty useless if the action isn't a "handler" and content generation is only needed if the action is supposed to output processed data instead of perl structures. Caching is a good property in an action, but on many occasions it is not used since it is quite a hassle to invalidate caches. Sometimes even security is not needed for an action. I think it would be easier to grasp the concept and usage if there were several action classes instead of just one with a lot of configuration options. I think we might have at least OI2::Action OI2::Action::Cached OI2::Action::Secured OI2::Action::Generated OI2::Action::Handler (unifies the above and adds url handling) Actions execute could then check if the action ->can the extra functionality and thus they could be added just by using the wanted classes as base without bloating the actual Action code. OI::A::Generated could for example pass the return value of the task to a content generator automatically if $self->skip_generate is not specified. Any of you have other views on the subject? =) - Antti |