I have had a similar need but I didn't actually prevent these methods from being exported -- I just gave them names that crackers aren't likely to guess -- not great for security but good enough for me at the moment. I think your suggestion makes sense, though, because it's not always convenient to create new components just for the private functions. I'll add it to the todo list, unless you want to implement it yourself.
Yariv > 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 -~----------~----~----~----~------~----~------~--~---
