[geojquery] Desireable plugin pattern

Christian Wygoda arsgeografica at googlemail.com
Thu Jul 29 16:14:16 EDT 2010


I understand not wanting to have DOM objects returned (which jQuery UI
doesn't if the called function returns anything (other than "this")).
Personally I could live with using the jQuery UI approach of having the
first arg as function name and then the real function arguments - at least
it keeps the jQuery namespace clean.

What would you like to see instead of

$('#mymap').map('addLayer', LayerDefObject);
$('#mymap').map('getNumLayers')

I'd be happy to learn what you envision!

Cheers,
  Crischan

On Thu, Jul 29, 2010 at 9:53 PM, Volker Mische <volker.mische at gmail.com>wrote:

> On 29.07.2010 21:44, Christian Wygoda wrote:
>
>> Hi folks,
>>
>> I was looking at the available code examples offered on the mailing list
>> and keeping in mind that there will be a Core plugin and UI plugins I
>> came to the question which plugin pattern should be embraced.
>>
>> I think for the UI plugins it will be the natural to use the jQuery UI
>> widget factory.
>> For the Core plugin we would like to stay clean of jQuery UI
>> dependencies, right? So we need to write our own plugin. But maybe we
>> should use the same pattern as the jQuery UI widget factory? This could
>> have two advantages:
>>
>> First, any project using the full set of GeoJQuery Core & UI magic could
>> reuse the jQuery UI widget factory to build the core plugin and thus
>> remove some lines of "redundant" code.
>> Secondly, using the same pattern would make life a little bit easier for
>> folks hacking both in Core & UI.
>>
>> To get our feet wet we could even start using the jQUery UI widget
>> factory now (!) for the Core plugin and later "write" (a.k.a. c&p) the
>> dropin for the widget factory. Or just point to the jquery.ui.widget.js
>> in the install instructions then - depending on how lazy we will be. ;)
>>
>> Let me hear your thoughts.
>>
>> Cheers,
>>   Crischan
>>
>
> Hi,
>
> the core system should use something like the jQuery UI widget factory, but
> in my opinion not exactly the same. I don't like the way way jQuery UI uses
> the first argument as function name, and the the rest as parameters. For
> jQuery UI it makes sense to always return a DOM object, for geojquery it
> doesn not.
>
> geojquery is not about DOM manipulation it is about maps.
>
> Cheers,
>  Volker
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geojquery/attachments/20100729/c1325b37/attachment.html


More information about the Geojquery mailing list