next up previous contents
Next: 5 Resources Up: Rice version 0.1.1 Previous: 3 Starting Rice   Contents


4 Architecture

Rice is made up of three layers: the core, demo-specific subscription services, and the user interface.

4.1 The Core

At its core, any ICE implementation must speak HTTP, parse and output XML, and handle ICE data types like timestamps and URLs. In addition, it makes sense to provide behavior common to syndicators and subscribers.

Rice is no different. It uses Ruby classes to speak HTTP and retrieve URL contents. It relies upon NQXML to parse and write well-formed XML. It provides timestamp parsing and formatting. Finally, the Rice core contains classes that can build ICE messages and that implement common syndicator and subscriber behavior.

Logging, an optional part of the ICE spec

4.1.1 URL

The Rice::URL class represents a URL. It can parse strings to create URLs and can fetch the content of a URL based on its schema. Only HTTP and FTP fetching are implemented in Rice.

In Ruby v1.7, a URL class was introduced. The stable version of Ruby as of this writing is 1.6.5; version 1.7.X is a development version, though it is easily available via CVS. When Ruby v1.7 is released as a stable version and becomes widely used, Rice::URL may no longer be necessary.

4.1.2 HTTP

Ruby's Net::HTTP and Net::FTP classes provide transport and content retrieval support.

To use HTTPS (SSL), must download additional packages from the Ruby Application Archive.

4.1.3 XML

Building XML messages: payload => request/response => ping/confirmation/error

4.1.4 Timestamps

I may want to change the code so rice/datetime.rb extends Time class instead of using a static methods that take a Time object as an argument. For example, instead of using the class method DateTime.timeToICEDateTime which takes a Time object as one of its arguments, we could provide Time.to_ice_dt.

4.1.5 Common Behavior

Party: syn/sub superclass. ICEMachine (common ICE syn/sub behavior): pinging, returning repsonses, error responses and codes.

The Rice::Syndicator and Rice::Subscriber classes share many common behaviors that are implemented in their superclass Rice::ICEMachine. They are both implemented as Web-based services that listen for and receive ICE packages via a form POST to a URL and reply with the proper ICE package.

Error codes and I18N.

4.1.6 Logging

4.2 Demo-Specific Subscription Services

Ping, time, date, unknown, error

Inline and by reference; inline = ice-item, by reference = ice-ref

4.3 The User Interface

Syn. and sub. "mini-sites": Web pages using eRuby

Listener dispatches requests

Mini-sites: Interface plus role-specific behavior. Some behavior should be factored out of mini-sites.

eRuby is like PHP or JSP.

4.4 Rice::Syndicator

A syndicator...

4.5 Rice::Subscriber

A subscriber...

next up previous contents
Next: 5 Resources Up: Rice version 0.1.1 Previous: 3 Starting Rice   Contents
Jim Menard 2002-03-04