ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Modules vs Plugins

April 07, 2008 10:07pm

Subscribe [2]
  • #1 / Apr 07, 2008 10:07pm

    michaelb

    21 posts

    Hey all,

    I’m having a bit of trouble trying to understand the more appropriate architecture for modules and plugins. I’ve read the Knowledge Base article: _What is the difference between a Plugin, a Module, and an Extension?, and I basically understand the concept of Modules vs Plugins, but I’m having a bit of trouble classifying some of the medium sized functions. For example:

    1) Outputting a Google Map which relates to an article
    2) Creating a ‘Contact Us’ form
    3) Grabbing data from a Web Service or an API (e.g. getting images from Flickr)
    4) Allowing people to sign up for a newsletter

    (I’m not debating whether these already exist as modules/plugins, I’m trying to understand which of these are best developed as a module or as a plugin)

    From my research, I’m thinking that number 1 would be a plugin, since all it does is use latitude and longitude data to grab a map (and could be used heaps of times across a site), number 3 could be a plugin as well (since it doesn’t really do any actual data crunching), but 2 and 4 could be modules because they could potentially do lots of data access and processing.

    My general definitions that I’m basing the above on are that modules are used when you have heavy processing and/or database manipulation, where plugins are more-or-less places where external code is dropped, or small snippets of data are inserted.

    Can anyone else provide any more guidance on this? Thanks…

  • #2 / Apr 07, 2008 10:22pm

    Daniel Walton

    553 posts

    You’re spot on with your definitions. 1 and 2 would require user input to be handled appropriately which a module is better set to do, since they can be called via action ids in the site URL. I won’t argue that a plugin cannot achieve it also but that would be like taking the scenic route to the hospital with a heart attack.

  • #3 / Apr 07, 2008 10:28pm

    michaelb

    21 posts

    Sorry I’m a little confused…

    The Google Map would just display a location based on a custom field in the article, so is that better as a module? Or did you mean that 2 and 4 (the newsletter signup) would be modules?

    Regardless of the examples though, what you’re saying is that anything with user input could also be created as a module (in addition to my definition). Is that correct?

    Thanks for the speedy reply by the way!

    —Michael—

  • #4 / Apr 07, 2008 10:47pm

    Daniel Walton

    553 posts

    Aaargh, I meant 2 and 4. As a rule of thumb, yes, user input would be better set up as a module depending on your definition of user input (mine being forms). Of course a plugin can take data via the URL but that would generally be as parameters.

  • #5 / Apr 07, 2008 10:48pm

    michaelb

    21 posts

    Excellent, thanks for your help!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases