Viewer Stories
On the Project Ideas page I’ve listed a number of suggestions for extending the Naked Objects framework. Some of the larger projects are around building a generic viewer OOUI in various technologies (Android, JavaFX, GWT, etc).
To help understand what it takes to develop such a viewer, here’s a list of user stories / features. I’ve ordered them in the probable order of implementation.
In addition, you might want to check out the codebase for WicketObjects. This is a viewer I’ve been working on recently; its design would – I think – make a good basis for any viewers that are web-based.
- bootstrap Naked Objects
- start the app using the viewer technologies normal mechanism (e.g. from web.xml), but bootstrap Naked Objects in its initialisation
- application services
- provide a representation of application services (as registered via nakedobjects.properties file), e.g. as an icon or a link
- application service actions
- display the actions for application services, e.g. as links or drop-down menu items etc
- invoke no-arg action
- invoke an (application service) action, taking no arguments
- display entity summary
- display the icon and title of an entity
- i.e. resultant from invoking an action
- display entity properties, read only
- display the properties of an entity, in read-only mode
- just handle basic types (integer, string, date, boolean) initially
- display entity collections, read only
- display each of the collections of an entity, in read-only mode
- display actions for an entity
- render actions available for an entity, e.g. as menu items or links
- invoke action on entity
- invoke a (no-arg) action for entity
- display collection of entities, read only
- i.e. resultant from invoking an action
- handle actions returning void
- render a meaningful view for an action returning void
- render action with parameters
- display form to capture arguments
- handle basic types only
- invoke action with parameters
- … and handle results using existing mechanisms
- handle contributed actions
- ensure contributed actions invoked on contributor (application service), not entity
- automatically default the contributed entity as an action param
- combine infrastructure for action arguments and entity properties
- they’re basically the same thing… scalars
- validate individual action arguments
- as per validate[N]Xxx() method for argument N
- validate all action arguments
- as per validateXxx() method
- display entity for edit
- editable properties for values
- editable references
- allow property or parameter that references another object to be set
- allow property or parameter that references another object to be cleared
- entity object-level validation
- validate object prior to saving, as per validate() method
- support all built-in value types
- remaining built-ins, e.g. java.math.BigDecimal
- action argument defaults
- when bring up action parameter form, default any action arguments if exist, as per default[N]Xxx()
- action argument choices
- in action parameter form, display choices for parameter if exist (as per choices[N]Xxx()]
- entity property defaults
- when bring up entity edit form for newly instantiated entity, default any properties if exist, as per defaultXxx()
- entity property choices
- in entity edit form, display choices for property if exist (as per choicesXxx())
- support any value objects for action parameter or entity property
- Support all value types (as per @Value annotation), so long as are parseable/encodable
-
handle actions returning values
- display “results” (a meaningful view) for an action returning a value
- For action parameter form for reference parameters, provide drop-down of recently-used entities of correct type
- For entity properties form for reference properties, provide drop-down of recently-used entities of correct type
- Lazy load entity collections rather than eagerly load
- allow entities to be added to or removed from collection if not @Disabled
- validate entities being added to or removed from entity collections, as per validateAddToXxx() and validateRemoveFromXxx()
- handle actions returning transient objects
- do not allow editing of immutable objects
- ensure multi-threading concerns dealt with (e.g. NakedObjectsContext implementation if required)
- handle various errors conditions, e.g. optimistic locking
- allow new renderers for properties, for entities, for values
Pingback: Project Ideas, Viewer Stories and Wicket | Domain Driven Design, Quickly