My gut feeling is that as an application developer I could make some
use of it but as a plugin developer I would much prefer to use
function/method calls and I would much prefer to expose only function
calls and not guarantee the nature of any global variables.

One reason is order of execution. What happens if the global is not
(and cannot be) set until a given keyword is called the first time?

Daniel

On 17 February 2015 at 12:56, Andrew Beverley <[email protected]> wrote:
> Hi guys,
>
> There has been discussion over the last few weeks about the plugin
> architecture having problems, in terms of using one plugin's functions
> inside another's.
>
> One area that this is particularly problematic is using a database
> plugin in another plugin, for example in an authentication module.
>
> For the latter scenario (but probably not the former), I thought it
> might be useful if a plugin could register global data, that could be
> accessed by other plugins. This patch does exactly that:
>
> https://github.com/ctrlo/Dancer2/commit/9383ade1e46691106e835cd9155976fa5247b541
>
> I'd like to ask for comments from the floor ;-)
>
> As an example, I have successfully used the above to create a DBIC
> provider for Plugins::Auth::Extensible, which uses a database connection
> handle from Plugins::DBIC
>
> Andy
>
>
> _______________________________________________
> dancer-users mailing list
> [email protected]
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to