Web Tutorials     [RO]  [EN]  
| HOME | Tutorials | News | SERVICES | Directory | Tools | FORUM | About | SITE MAP | CONTACT | SEARCH |
.....................................................
.....................................................
User happy birthdayToday we celebrate one day of birth.
(dannyb0y)
.....................................................
Login
Register
I forgot my password
.....................................................
Put your ad here
.....................................................
Online
In total there is
9 visitors online,
of which:
1 invited
8 are bots
.....................................................
Put your ad here
.....................................................
.....................................................
.....................................................
.....................................................
.
Home - Organize your project in a broad way

<< Useful Opera widgets for web developers   -   Google's Closure Compiler >>
Rate this article(Members only)
1 2 3 4 5
A - A Announced this way the site administrator for any problems observed on this page.  Print this page as PDF  Email  

Organize your project in a broad way


Publishing date: 23-02-2011 - Copyright © Andrei Avadanei

An interesting problem that appears in programming is STRUCTURING. It is useless to have a project well done but isn't perfect organized and offers no possibility of returning in time on it. Most times we crash on projects and great ideas which fail because of a few simple reasons, reasons personal experienced:

  • We don't have enough time to work on the project.
  • We are discouraged by the excessive complexity.
  • The project's structure began malfunctioning.
  • We work poorly organized and when we get back on the project we're stuck at some developing problems.
  • We're working in a team and we can't find a common organization of the project.

All these problems can be resolved if the structure and organization of the project is done with a sense of responsibility. This article will follow the presentation of one of the sub-structure issues: The poor development which creates problems when we want to get back on the project with improvements.

Problem

Let us imagine that we're trying to develop a platform that will target students (we're not going into unnecessary details). The problem that arises is the speed with which the Internet grows. An application that would be up to date with all things today, will be overcomed in a few months. We have to find an effective solution from several view points: organization, efficiency, rapid integration etc..

Solution

The best solution, adopted by many online and standalone applications is creating a system of extensions. The first impression is the complexity of such a system. Fortunately, for a simple system everything is reduced to a few clearly defined basic operations that must work together.

Advantages

  • We will create an independent language of the host 
  • We may allow third-party interfaces to interact with the application
  • Requires very little additional code to integrate with the host
  • Requires very little additional code for integration with the host interface
  • Ability to make versions of the application 
  • Developing and extensibility become virtually unlimited 
  • Promoting the application by third party developers
  • Ability to create a community around an Open Source project

Description and implementation

An extension (also known as a plugin, addin, addon or snapin) is a system from the host application, that provides a dynamic interface to let various external applications to run (more or less) in a controlled space, using a well-defined protocol.

Sample

  • the Wordpress Plugins
  • Mozilla's Firefox addons, plugins and extensions as well as other browsers such as Chrome.
  • Media players use plugins to support new formats
  • if we broaden the perspective, operating systems can be considered host applications that run applications (extensions).

Implementation

From the tests i've done in various applications I have concluded that the most effective way is the one based on events (I prefer to say actions). When an action is triggered this starts all registered extensions on that action in a certain way. I will describe a "class" that will cover all basic functions of such a system. This description will be made in pseudocode to be understood by everyone.

CODE:
class ExtensionService {
   // Upload all the resources, register events, attach extension events
   function constructor();
   // Remove extensions attached, delete and remove events allocated resources.
   function destructor();
   /* ---------------------------- ---------------------------- */
   // Create a new event (action).
   function event_register();
   // Delete an event (action).
   function delete_event();
   // Control the current event.
   function current_events();
   // Runs all the extensions are attached to an event.
   // Practical extensions must announce it's their moment.
   function raise_event();
   /* ---------------------------- ---------------------------- */
   // Extension to register host (to be taken into account in future releases of events)
   function extension_records();
   // uninstall extension from host
   function remove_extension();
   // attach an extension to an event in order to join a waiting list this event
   function extension_attached_to_the_event();
   // remove the extension from an event queue
   function extension_releases_the_event();
   /* ---------------------------- ---------------------------- */
   // information stored in the host cache (which can be processed by the extensions) - Standing cache / temporary
   function add_cache();
   // retrieve information stored in the cache of host
   function extracted_from_the_cache();
   // modify the information stored in the host cache
   function edit_cache();
   // delete information stored in the host cache (unless it is just temporary or if
   // are permanent and have permission to delete plugin)
   /* ---------------------------- ---------------------------- */
   // search for resources stored in various information system extensions according to various
   // criteria (events, attachments, extensions, current events, resources, etc.)
   function search(); 
   /* ---------------------------- ---------------------------- */
   // monitor system status extensions, treats exceptions, errors,
   // special cases, provide stability
   function event_monitors();
   // monitors the status of extensions, treats exceptions, errors, special circumstances, provide stability
   // extension and ends its work in extreme cases
   function monitors_the_extension();
}

 

Publishing date: 23-02-2011 - Copyright © Andrei Avadanei   
Click here if you want to see other articles by the same author
There are no comments on this article. Be the first to say your opinion.

Add a comment on this article (members only - login on the site):
Put your ad here