-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a FW/1 facade to allow out-of-band requests to access some functions #439
Comments
Copying this gist over from #438 as a first run at some ideas: |
As noted, I'd probably put a reference to "the whole FW/1" rather than just the application key. That way any facades only need to know about the |
That would allow access to subsystem bean factories and any other part of the FW/1 API you might want. |
Is there value in making it a request variable vs something like FrameworkOneFacade.cfc? I sort of like the idea that I know I am safe using FrameworkOneFacade regardless of how things are stored internally (app score, request scope, etc). Once you declare that special request scope variable people will start coupling into it in their apps and it may become harder to change in the future. Other questions I ponder - if you are making "the whole FW/1" available, then what happens about lifecycle events like before()? Did they fire yet? Will people need to know this? The beanfactory is a less complex animal then "the whole FW/1" but you know way more about that than I do. |
I would provide As for lifecycle events, that's definitely "caveat programmer" if you're doing stuff out of band. In the use case of #438 you would be accessing the facade as a normal part of the request lifecycle anyway -- this would just provide a bridge to access certain FW/1 API calls in places where it would otherwise be extremely difficult to do so:
|
I do like that approach. Seems to basically satisfy the core need that I personally have when I am working with ORM. The |
This comes out of discussions in #438 around a standardized way for non-framework code, called during a FW/1 request, to be able to call into parts of FW/1 (to get the bean factory etc).
The most feasible approach would seem to be for FW/1 to stash a reference to itself in a "publicly documented"
request
scope variable for such facades to be able to access?The text was updated successfully, but these errors were encountered: