>> If it's only returning something, it should be a subroutine in
>> a module anyway.
>
> I think that that is not your call. I think it is perfectly
> legitimate to use Mason components instead of, or alongside modules
> to return stuff.
>
> It's precisely for that ability that I still use Mason.
>
> Of course, if you want us to all piss off to Catalyst and
> Template::Toolkit, that is your prerogative ;)
>
> Alternatively annotate all references in the manual to say that you
> can return values but that you shouldn't ;)

I agree with Alex here.  There are 2 cases where I prefer to use a  
component returning a value, rather than moving the subroutine to a  
module.

1. When I want to have the flexibility to override the component  
implementation for a particular cobrand.  In our work, we have an  
extensive component root for the "base" site, and then have an  
additional component root that includes overrides which are "cobrand- 
specific" for particular specializations/clients that are customers  
of our customer.  Components that return values let us make special- 
case versions of functions for a particular cobrand, without  
reinventing the whole inheritance / overrides thing in our .pm  
hierarchy too.

2. When I want to be able to work on a function, and get it right,  
without restarting the webserver every time.  It may be just me, but  
I have not been able to get mod_perl to force recompliation of  
changed .pm modules reliably, even in our dev environment.  That  
means that when we change code in modules, we have to restart the  
webserver, but when we change code in Mason components we don't.   
Obviously, this gives a big incentive to leave code in Mason modules,  
at least during debugging.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to