[geojquery] Desireable plugin pattern

Volker Mische volker.mische at gmail.com
Thu Jul 29 15:53:45 EDT 2010


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



More information about the Mapquery mailing list