14.06.2013 Views

Databases and Systems

Databases and Systems

Databases and Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

258<br />

<strong>and</strong> updates a model accordingly. When the model is updated the view receives<br />

notification <strong>and</strong> updates its representation accordingly.<br />

In our case, the model is defined as a set of Java interfaces. An interface is<br />

an abstract specification of functionality in the form of a set of method signatures.<br />

Using interfaces allows us to define a model without detailing how the model will be<br />

implemented. A critical step in defining a widget is defining the model of which it<br />

will be a view. Because a widget is designed for reuse throughout the genomics<br />

community, its model must be generic enough so that it will not be inconsistent with<br />

data models used by would-be consumers. The philosophy therefore in defining<br />

models for bioWidgets is to keep them as simple as possible.<br />

Here is the interface that defines the model of (ungapped) sequence used by<br />

our sequence widget:<br />

public interface SequenceReadOnly {<br />

public int getFirstChar();<br />

public int getLastChar();<br />

public String getSubSeq(int first, int last);<br />

public Interval[] getSelectedIntervals();<br />

}<br />

In this case, sequence is viewed simply as a string that can easily provide substrings<br />

<strong>and</strong> that also has a set of selected sub-intervals. Because this interface is easy<br />

to satisfy, it allows data to be read into the bioWidgets from flat files, databases<br />

(possibly using the JDBC[11] database access specification), or even directly from<br />

other widgets or applications, using remote communication protocols such as MI or<br />

CORBA[12]. Components called transducers do the job of translating data in<br />

disparate formats into objects satisfying the interface specifications recognized by the<br />

widget. Note that, in terms of performance, the above interface does not require that<br />

the sequence be stored as a string. It could be stored in a compressed format <strong>and</strong><br />

decompressed on the fly in response to getSubSeq requests. It is the widget’s<br />

responsibility to ask for only that part of the sequence it needs, so that the entire<br />

sequence need not be duplicated in every view.<br />

In addition, the MVC approach ensures that any updates to the underlying<br />

databases or data sources are immediately propagated to the widgets’ displays.<br />

Another feature of the bioWidget architecture-the use of multiple concurrent<br />

Threads of execution—ensures that the widgets will not freeze while performing<br />

such updates; the user will be able to continue to interact with the widgets while they<br />

incorporate new or updated data into their displays.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!