Creating inline markup within an OpenSocial template can be an excellent option for small-scale applications, where developing simple tags may help provide some measure of reusability in the code base. Even though this is a fine approach, as the application logic increases in complexity and you create more and more custom tags, you may need to separate out a gadget’s reusable logic even further. Template libraries can help you do this.
Template libraries are standalone XML files that provide a gadget with functionality such as:
Simple custom tags with simple markup
A template library is a standalone XML file containing a number of sections that you can use to define fully enclosed custom tags or global functionality for the gadget. The XML template file follows a standardized template syntax with a number of potential sections and functions: