Web Design Forum: TUTORIAL: How to manage plugins - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

TUTORIAL: How to manage plugins Rate Topic: -----

#1 User is offline   php_penguin 

  • richthegeek
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,471
  • Joined: 06-August 07
  • Reputation: 7
  • Gender:Male
  • Location:Liverpool
  • Experience:Web Guru
  • Area of Expertise:Coder

  Posted 12 August 2007 - 04:04 AM

This isn't gonna be a huge tutorial, rather it's just meant to explain a method which isn't initially obvious to newbies ;)

When developing an application, it is often useful to be able to add features easily without disturbing the rest of the site or control panel area. The concept of a "plugin" fits nicely into this stage, the idea being that it is installed, activated, and it works without fuss.

To do this requires a couple of somewhat odd ideas, which sometimes take a while to grasp. These are:
* each section is entirely seperate as code.
* each section shares common ground
* each section can have an effect on another section
.. also ..
* the underlying code has 3 sections - the framework, the controller, and the printer. (MVC basically)
* the framework provides the common functions to all plugins
* the controller is each of your plugins - they add the functionality to the site.
* the printer is what outputs your site to the browser.

So lets look at these in some more detail...
* each section is entirely seperate as code.
this means that each plugin should not "collide" with other plugins, unless you explicitly tell it to do so. this can be achieved through keeping each plugin in its own seperate file, and keeping strict naming protocols. For example, each plugin may have its own prefix for each variable (eg for a gallery plugin, it might be glry or even gl

* each section shares common ground
basically this means that writing a plugin should be made easy by using framework functions to access/modify data, in order to create a similarity between them.

* each section can have an effect on another section
what use is an image gallery plugin if you can't use it in other sections? there should be an easy way to modify the front and back end of other plugins

* the framework
This provides common functions to all plugins, in order to speed up plugin creation and make it easy to edit plugins in the future. This also aids with file size

* the controller
functions/code which ensures the plugins required are used in the correct places

* the printer
this has functions which allow you to modify page sections, specifically page sections related to individual plugins


So what does this all mean? I still don't know how to make plugins and now my brain hurts!!!

Well I'll cover all the code stuff when i'm not so knackered - it is 5am after all...
0

#2 User is offline   Daemon Byte 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 198
  • Joined: 05-August 07
  • Reputation: 0
  • Location:Gillinghan, Dorset, United Kingdom
  • Experience:Web Guru
  • Area of Expertise:Coder

Posted 12 August 2007 - 03:38 PM

I like classes and the MVC model but sometimes it can be slower to run. still it's much better for maintaining code so I still use it.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users