http://www.cytoscape.org/images/logo.png http://www.osgi.org/www/osgi_logos_supporter_final.png http://static.springframework.org/images/spring25.png

Cytoscape 3 Developer's Guide

Introduction

Cytoscape 3 is based on new technologies such as OSGi or Spring to provide maximum flexibility and expandability for all plugin writers. These technologies are very powerful, but you need to understand some new concepts to utilize them. The purpose of this document is to introduce new concepts you need to understand to develop Cytoscape 3 code and giving you a hands-on introduction to actual Cytoscape 3 code development.

Why Do We Have To Learn These New Technologies?

Cytoscape 2 has several architectural problems. They are:

The main purpose of new technologies we use is solving these problems.

OSGi

OSGi is relatively complex technology, but important points you need to understand for Cytoscape 3 development are only four:

  1. OSGi framework manages modules as bundle. Bundle is a new kind of JAR files with set of metadata.

  2. In Cytoscape 3, everything is a bundle. The border between plugin and core is very ambiguous.

  3. You can explicitly define which classes are accessible from others. Also, you can define which classes must be imported to run your bundle. This includes version numbers of the library, so different versions of the same library can exists on the same JVM.
  4. You can export any object as OSGi Service to the OSGi Service Registry. All bundles can access those registered services.

These solves lots of problems we had in version 2.x:

   1 public interface ClusteringService {
   2     // Run my clustering algorithm and return clusters as a set of CyNetwork
   3     public Set<CyNetwork> getClusters(CyNetwork network);
   4 }
   5 

Spring Framework and Spring Dynamic Modules

Spring is the defacto standard of lightweight container for dependency injection. Tons of books and documents are available for Spring, and you can learn its mechanism by reading them. The role of Spring in Cytoscape 3 is simple: defining relationships between objects.

Wiring Objects

spring1.png

The diagram above shows the relationships between objects in Cytoscape 3 desktop application. In Spring, objects are defined as beans.

spring2.png

This diagram represents the cytoscapeDesktop bean, which is defined in a Bean Configuration XML file:

<bean name="cytoscapeDesktop" class="cytoscape.view.internal.CytoscapeDesktop">
    <constructor-arg ref="cytoscapeMenus" />
    <constructor-arg ref="networkViewManager" />
    <constructor-arg ref="networkPanel" />
    <constructor-arg ref="cytoscapeVersion" />
</bean>

Cytoscape Desktop is the main GUI component which includes some other components such as Network Panel or Menu Bar. To create an instance of Cytoscape Desktop, we need to provide those objects prepared somewhere outside of it. Instead of creating new instances of those required objects or using static class,

Separate Implementation from API

Spring is a powerful tool, but if we use Spring Dynamic Modules (Spring DM), we can take advantage of both Spring and OSGi.

If we use Spring DM, Cytoscape 3 code is independent from OSGi API and Spring API. This means all of the Cytoscape objects are POJOs and we can replace the framework later when necessary.

The most important design concept you need to understand to develop Cytoscape 3 code is Interface-Oriented Design. Since Cytoscape 3 is a platform rather than a stand-alone desktop application,

Related Frameworks and Technologies

From 3.0, new technologies/frameworks will be used for implementation. The following is the list of links to documents related to those frameworks/technologies.

Developer's Tutorials and References

For Eclipse Users

Basic Tutorial

Optional

For Netbeans Users

Other OSGi Tools and Technical Notes

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux