Package net.commerce.zocalo.experiment.config

The classes in this package provide an interactive editor for configuring experiments.

See:
          Description

Interface Summary
ConfigHolder Collection of values for configuring an experiment.
RoleValueGroup Objects that contain collections of fields.
RoleValueHolder Classes holding values related to roles in a lab experiment.
ValueGroup Collections of fields grouped together either semantically or for convenience.
ValueHolder Objects holding values or collections of values.
 

Class Summary
BooleanField Field containing a boolean value.
ChoiceField A field that provides a choice which may specify further configuration parameters.
ConfigEditor Controller for editing configuration parameters for an experiment.
ConfigField Abstract parent of all classes representing individual fields.
ConfigManager Main entry point for interactively editing experiment configurations.
DoubleField Field containing a double value.
ExperimentConfig The root of an object structure representing the specification of an experiment.
FieldGroup A named group of value associations.
IntField Field containing an Integer value.
IntListField Field containing a list of integer values.
RoleFields A collection of values for a particular named role.
RoleGroup A collection of descriptions of roles for an experiment.
StringField Field containing a String.
StringListField Field containing a list of String values.
TimeField Field containing a duration (written as xx:xx or just xxx).
TypeMisMatch Exception thrown when an inappropriate request is made for a particular ConfigField.
 

Package net.commerce.zocalo.experiment.config Description

The classes in this package provide an interactive editor for configuring experiments. ConfigManager contains the main() entry point, while ConfigEditor connects to the servlet hierarchy to manage interactions between the browser and web server. ExperimentConfig holds the root of a branching tree of objects that represent the nested hierarchy of cascading choices that are used to configure an experiment.

The architecture of the hierarchical representation provides a collection of named fields with values that can be nested so that some choices control the circumstances in which other choices are available. The expectation is that those choices are never cyclical, so a singly-rooted tree can represent them. Individual objects in the hierarchy either represent a single field with a name and a value or a collection of fields that either have a semantic relationship to one another (all related to a role, all enabled by a choice made at the next level up, or grouped together as a list at a particular location in the hierarchy. In the case of a single field, the object is responsible for accessing and modifying the field's value.

The leaves of the tree represent actual values that might be booleans, strings, numbers or the like. These are all specializations of ConfigField, which is the parent to the single field subclasses of ValueHolder. ValueHolder is an interface that specifies that its descendents hold values and have a title. Other subclasses hold values that are Strings, but have a more restricted syntax. These include TimeField, IntListField which holds lists of numbers, StringListField, and DoubleField which holds doubles so they can be parsed in java rather than in javascript.

The other branch below ValueHolder is ValueGroup, which is the parent for classes representing collections of fields grouped together for different reasons. ChoiceField provides a radio button style choice, with separate groups of fields that are only valid according to the currently selected alternative. FieldGroup is a container for multiple fields (or more FieldGroups) without representing any particular semantic relationship among them. RoleGroup represents a set of roles required for a particular style of experiment. Different experiments may require subjects that have unique configuration requirements. Each of these is a role and fields assigned in a RoleGroup will be duplicated for each role and be able to take a different value in each role. An example would be messages that get displayed to different subjects during an experiment. If every user should see a unique message at some point in the exeriment, then each user will need a separate role. But if there are groups of users getting common messages, then those messages can be defined in one common role and multiple user names can be assigned to the role.

ConfigHolder is the base of the hierarchy and specifies that everything can be rendered to HTML and that they all contain values that can be set by an HTTPRequest.

RoleValueHolder is the base type for classes that contain fields specific to particular roles in an experiment. The methods here are parallel to those in ValueHolder, but with an extra parameter to specify the role. Group-related objects below RoleValueHolder know how to pass requests down the containment tree, while Field objects access the value in their own field directly.


© Copyright 2009 Chris Hibbert. All rights reserved.

This software is published under the terms of the MIT license, a copy
of which has been included with this distribution in the LICENSE file.