Difference between revisions of "Examples of Modularity"

From Opentaps Wiki
Jump to navigationJump to search
(Salesforce.com)
Line 33: Line 33:
  
 
Salesforce.com also has the [http://wiki.developerforce.com/index.php/Apex_Code:_The_World%27s_First_On-Demand_Programming_Language Apex programming language] for more complex application.  This appears to be database triggers but in Java-like syntax, with objects such as Lead, Email, etc.
 
Salesforce.com also has the [http://wiki.developerforce.com/index.php/Apex_Code:_The_World%27s_First_On-Demand_Programming_Language Apex programming language] for more complex application.  This appears to be database triggers but in Java-like syntax, with objects such as Lead, Email, etc.
 +
 +
==Eclipse==
 +
 +
See [http://en.oreilly.com/oscon2009/public/schedule/detail/8262 How to write your own Eclipse plug-ins]

Revision as of 18:33, 5 November 2009

This is a high-level review to help understand how different systems support add-on 
modules or plug-ins. This is not meant to be a programming guide.

Joomla

A Joomla module is a combination of an XML file and a PHP file. The PHP file is a PHP code fragment enclosed. The XML defines the module, meta data about the module such as its name and author, and its parameters. They are uploaded into Joomla and then associated with a position on the Joomla template. The Joomla template is a full web page in PHP and uses the mosLoadModules command to define where a position is on that page. Where the mosLoadModules is called for a position name, Joomla renders the modules at that position.

See How to Write a Joomla Module and Understanding Joomla Template Positions.

WordPress

In WordPress, you would upload your plug-in into a plug-ins directory. Then, you can go to the plug-ins menu in Word press and activate your plug-in in there. The metadata for your plug-in is defined in a comment block at the top of its PHP file. WordPress provides hooks for your plug-in to interact with WordPress: You can obtain the title and content of blog posts, filter the posts, or perform actions when other actions happen. A widget can be registered with WordPress on the sidebar and then associated with an action. For both widgets and plug-ins, you would write your logic as a function and pass it to WordPress.

See How to write a simple WordPress Plugin, Your First WordPress Plugin, and WordPress Plugin API. See How to Create a WordPress Widget.

Magento

Magento seems to use a page templating scheme similar to Joomla. You define something called a "block", and your template lays out where the blocks appear on a page. When you write a custom module for Magento, you have XML configuration files, a PHP controller file (Magento is object-oriented and uses a controller class), and a layout for your module.

See Create New Module Hello World in Magento and Designing for Magento

Facebook

To incorporate face book widgets into your webpage, you just need to load their JavaScript into your page, and then use the Facebook XML tags like <fb:comments> </fb:comments> This is similar to the way GWT works in opentaps: a JavaScript widget is loaded on the page and then interacts with a target point on the page.

To build an application to run in Facebook, you would host an application on your server, then interact with Facebook through a Facebook library you download. Your application loads the library, instantiates a Facebook object, and then sends your output back to Facebook as HTML. Your application needs to use an API key combination to communicate with Facebook, and you would register a "vanity" facebook application URL to mask your real server's URL. See How to Write a Facebook Application in 5 Minutes.

Salesforce.com

Salesforce.com gives you the ability to define new data objects and their relationships and then automatically generates screens and forms for them. You can also define security and triggers for your data objects. You can then add the screens to your application as a "tab." Thus, a simple application could be created without programming. See Salesforce Native Functionality

Salesforce.com also has the Apex programming language for more complex application. This appears to be database triggers but in Java-like syntax, with objects such as Lead, Email, etc.

Eclipse

See How to write your own Eclipse plug-ins