You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by qwe2 <gi...@git.apache.org> on 2014/04/04 12:04:17 UTC

[GitHub] cordova-android pull request: Support for PluginFactory

GitHub user qwe2 opened a pull request:

    https://github.com/apache/cordova-android/pull/97

    Support for PluginFactory

    Pull request based on this issue: https://issues.apache.org/jira/browse/CB-6384

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/qwe2/cordova-android plugin-factory

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/97.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #97
    
----
commit f69f6a2204ae821d9d7b7ac4228f6880da318be4
Author: István Gansperger <ga...@gmail.com>
Date:   2014-04-04T10:01:27Z

    Support for PluginFactory

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48955669
  
    Thanks István,
    I think what I was missing in your pull-request and problem description, is how your plugin uses the factory to do something that it otherwise could not.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48985460
  
    Sounds like maybe we abandon this PR.
    Plugins have an initialize() method that you can override to do extra constructor-time logic.
    I've tweaked the API of PluginManager on master to have it take in a list of PluginEntry objects. You can use this to give it a pre-instantiated CordovaPlugin object.
    
    Hopefully one of these two options addresses your usecase?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48951400
  
    init() has been recently deprecated.  I'm not convinced that this is solving a problem that we currently have.  I'm not in favour of having Factories just because it's a Java pattern.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by qwe2 <gi...@git.apache.org>.
Github user qwe2 commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48953658
  
    The idea was that I needed a more modular way of creating plugins that I had more control over than just relying on Cordova to instantiate arbitrary classes with their default constructor. I myself don't think this is the best or even a good solution to the problem – if there is a problem at all – but this seemed to be quite an idiomatic way to go about it. I do admit though that I did not think much about it architecture wise.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by qwe2 <gi...@git.apache.org>.
Github user qwe2 commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48957070
  
    The simplest example that comes to mind would be the need to be able to pass additional parameters to a custom set of plugins or do something with them at instantiation by overriding the PluginFactory's ``createPlugin`` method. That's something I could not solve in a sensible way in Cordova.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by qwe2 <gi...@git.apache.org>.
Github user qwe2 closed the pull request at:

    https://github.com/apache/cordova-android/pull/97


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48958012
  
    I recommend you continue to use a parameter-less constructor and provide some other interface for setting values in another plugin.  You are destined for pain, when your plugin requires factoryA to create it, and runs in the same project as a plugin that requires factoryB create it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48938359
  
    Change needs to be rebased & I need to you confirm you've signed Apache's ICLA http://www.apache.org/licenses/#clas


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by qwe2 <gi...@git.apache.org>.
Github user qwe2 commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-49001482
  
    Being able to pass pre-instantiated plugins sounds like what I presonally needed. Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: Support for PluginFactory

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-android/pull/97#issuecomment-48949233
  
    I think this needs to be discussed more before merged, this seems to potentially break stuff, and the benefit has not clearly been discussed. ( or alternatives ) 
    Essentially, Plugin creation code has been moved into it's own class ( cool ) ... which then must be passed all over the place ... ( less cool )
    
    I would like to hear more about the specific problem this is attempting to solve, and some discussion on potential other methods of solving it.
    
    Also, the fact that István clearly states 'I'm quite a newbie programmer ..' does not give me great confidence, although the code looks good, I fear architectural pitfalls.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---