Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Provide a FW/1 facade to allow out-of-band requests to access some functions #439
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"
referenced this issue
Jun 1, 2016
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.