cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-6384) Easier way to manage plugin creation on the native side
Date Mon, 14 Jul 2014 20:06:05 GMT

    [ https://issues.apache.org/jira/browse/CB-6384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14061143#comment-14061143
] 

Joe Bowser commented on CB-6384:
--------------------------------

I'm not convinced that a Factory is needed.  This adds extra complexity for no reason.  Why
can't you do this in the constructor of the plugin?  Why is there an instance of the communications
interface existing before the plugin is initialized, and where did it come from?  Is is an
edge case at best, and probably shouldn't end up in Cordova.

> Easier way to manage plugin creation on the native side
> -------------------------------------------------------
>
>                 Key: CB-6384
>                 URL: https://issues.apache.org/jira/browse/CB-6384
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android
>    Affects Versions: 3.4.0
>            Reporter: István Gansperger
>            Priority: Minor
>
> In my current project, I needed an easy way to write an HTML/Javascript GUI for my Java
backend and I chose Cordova for this task on Android. It occured to me that I couldn't find
an easy way to customize my CordovaPlugins beyond the initialize and exec methods. For example
I needed to provide my plugin with an instance of another object implementing my communication
interface. I didn't find a plausible way to do it in the current implementation so I wrote
my own PluginFactory object and readjusted some of the source files to take such on object
instead of providing a hardcoded default implementation. I'm curious if such a feature would
be deemed to be necessary by others.
> I'm quite a newbie programmer but my proof of concept can be found here: https://github.com/qwe2/cordova-android/tree/plugin-factory



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message