Skip to content

Mapael plugin architecture enhancement #117

@Indigo744

Description

@Indigo744

Dear Neveldo,

If I may, I would like to suggest some internal change about the plugin architecture.

Right now, the plugins architecture, from top to bottom, is:

  • (some processing for lazy loading and such)
  • Creation of a function named Mapael:
    • accepts an Options parameters, and parse it
    • performs a huge processing on each elements targeted
  • Listing of Mapael internal function Mapael.xxx() used all along
  • Listing of default values Mapael.defaultOptions and so on
  • Assign $.fn.mapael to Mapael for jQuery

The biggest problem here is the Mapael function, and the huge foreach processing inside of it.

I would like to suggest to implements a slightly different architecture pattern: https://github.com/jquery-boilerplate/jquery-patterns/blob/master/patterns/jquery.basic.plugin-boilerplate.js
The difference will not be so big actually. The main thing is that there will be an Init() function, and that we check against an already existing Mapael on the container.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions