Yariv Sadan wrote:
> There is no generic way of doing it because ErlyWeb doesn't pass any
> information down to subcomponents aside from the information that the
> parent component passes. You can explicitly pass a flag from the
> parent component to the subcomponent. Out of curiosity, why would you
> want to do it?
> 

It doesn't really matter for what I'm playing with at the moment but it 
occurred to me that I must have written some methods that assume being 
encased in other components and don't know what the effect would be if 
called directly, eg, have I checked the parameters for sane values or is 
it open to being a path that a cracker could exploit. Alternatively, if 
the method is being used as a sub-component (probably a better term than 
embedded) I can skip some checks and lighten the load on the database. 
Doing this could result in a 20% or more reduction in database queries. 
This could lead to more readable code also as I wouldn't have to have on 
method called embedded_show/2 and show/2, but as both methods are 
exported both are open to the world. Perhaps, what's really needs is 
something like,


-erlyweb_component([
                     new/1,
                     edit/2,
                     show/2
                    ]).

-erlyweb_subcomponent([
                        embedded_edit/2,
                       embedded_show/2
                       ]).

need better terms than component and subcomponent. How about, 
export_world and export_app_only.


Jeff.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to