What are the best resources if you want to create a modulated application?

In my analysis of new web platforms / applications such as Drupal, Wordpress and Salesforce, many of them create their own software based on the modulation concept: where developers can create new extensions and applications without changing the code in the "main" system, supported by leading developers. In particular, I know that Drupal uses a hook system, but I know little about the engine or design that implements it.

If you have to go the way of creating an application, and you need a system that allows modulation, where do you start? Is this a special design pattern that everyone knows about? Is there a guide to which this paradigm seeks to subscribe? Are they websites that discuss this type of development from scratch?

I know that some people point directly to OOP, but this does not seem to be the same, completely.

This particular system that I am planning is more oriented towards something like Salesforce, but it is not a CRM system.

In the name of the question, please ignore the argument Buy vs. Build because this consideration is already being implemented. Now I'm studying the build aspect.

+4
source share
5 answers

There are two ways to get around here, which one depends on how your software will work.

One way is the plugin route , where people can install new code in the application, changing the relevant aspects. This route requires that your application be installed and not only offered as a service (or you install and view the code sent by third parties, a nightmare).

Another way is to offer an API that can be called by the relevant parties and make the application transfer control code located elsewhere (a la Facebook applications), or make the application run, as the API commands allow the developer (a la Google Maps).

Despite the fact that the mechanisms differ and how to actually implement them, you must, in any case, determine

  • What freedom can I allow users?
  • What services do I offer programmers to configure the application?

and the most important thing:

  • How to include this in my code while remaining safe and reliable. This is usually done using a sandbox of code, validating input, and potentially offering users limited options.

In this context, interceptors are predefined locations in the code that call all hook functions of registered plug-ins, if defined, changing the standard behavior of the application. For example, if you have a function that creates a background, you may have

function renderBackground() { foreach (Plugin p in getRegisteredPlugins()) { if (p.rendersBackground) p.renderBackground(); } //Standard background code if nothing got executed (or it still runs, //according to needs) } 

In this case, you have a renderBackground hook, which plugins can implement to change the background.

In the API, the user application will call your service to get the displayed background

 //other code Background b = Salesforce2.AjaxRequest('getBackground',RGB(255,10,0)); //the app now has the result of calling you 

All this is also connected with the Hollywood principle , which is very useful, but sometimes it is simply impractical.

+6
source

The plugin template from P from EAA is probably what you need. Create a public interface for your service for which plug-ins (modules) can be integrated into ad-hoc at runtime.

+1
source

This is called component architecture. This is really a pretty big area, but some of the main important things here are:

  • composition of components (container components may contain any other component)
    • for example, the mesh must contain other meshes or any other components
  • programming by interface (components interact via known interfaces)
    • for example, a presentation system that can ask a component to visualize itself (for example, in HTML, or a visualization area can be transferred and ask for a view to directly insert
  • widespread use of dynamic registries (when a plugin loads, it registers with the corresponding registries)
  • system for sending events to components (for example, mouse clicks, cursor input, etc.)
  • notification
  • user management

and much more!

+1
source

If you host the application, publish (and dogfood) the RESTful API.

If you are distributing software, check out OSGi .

0
source

Here is a short video that will at least give you some tips; Lego process [less than 2 minutes]

There is also a complete recipe for how to create your own modulation-based framework ...

The most important key element to make modular software is to remember that this is a purely [mostly] question about how freely connected you can build your systems. The more loosely coupled, the easier the modulation ...

0
source

All Articles