GX Technology : Application "Rules"

Application "Rules"

DRAFT

This is a work in progress, and represents Dave's notes/thoughts thus far

This documents what I feel should be basic dreamtools client application-level rules, components and context for all components within the application to adhere to/use.

Common application elements

Shared Services

AMF Remote Service Manager

Provides a global level amf remote service manager instance to inject into all controllers/components that require the use of remote amf apis

    • this is effectively a service "factory" small-s singleton that should be instantiated upon application startup, and a reference to the application's service manager instance injected to dependant components
    • dependants ask Servicemanager for a service instance to use to make remote API calls
    • service instances only handle a single remote request at a time
    • service configuration will use application state defaults for language and virtuial world, unless explicitly overridden

Log Manager

Provides a global level log manager service for all components within an application to use

    • small "s" singleton, references injected into dependant components, typically mediators, controllers, models
    • supports local logging, remote logging, or both
    • depends on both ServiceManager and Application settings for language, virtual world
    • requires standardized LogMessage/LogError VOs

Alert Manager

Provides a global level service to handle display of pop-up alert messages

    • small "s" singleton, references injected into dependant components, typically mediators, possibly controllers?
    • global instance instantiated on application startup
    • application instance should be injected into components needing to display alerts, typically mediators.

AMF response handler

Top level amf response handler that defines/executes common response behavior

    • validates response, datatypes
    • handles common error responses (logged out, server error, network error, not authorized/invalid permissions, invalid request,etc)
    • does initial response processing, then delegates validated response data to user-defined function for final processing. This allows response consumers to focus on specifics of response data rather than all generic case response handling
    • not yet sure whether this should be a stateless static utility class or small-s singleton

UI Elements

Navigation Bar

Defines available languages, virtual worlds, tasks, and logout action that can be performed in the application

    • changes in state update shared application-level data models, which should fire standard events that all application components listen to and handle
    •  

Login Page

Provides the only interface to log in/authenticate

    • displayed in any application state where user is logged out or not authenticated
    • modal, cannot be bypassed without authenticated user
    • allows default language selection, which cascades to overall application setting

Application Scope Events

Example:
State change for language, virtual world, task, login, logout, permission change, settings change

  • common event listeners, handler functions in base classes, i.e. basemediator, basecontroller
    • must be implemented/overridden in extended classes

Shared Data

Question

Is there really a difference between "models" and "Dictionaries"??
should we just make them all proper models with updateable state, and events that fire when updated??

"Dictionaries"

    • small "s" singletons, references injected into dependant components, typically mediators, controllers
    • cached, generally stable-state (i.e. non-dynamic) lookup data
      • loaded once at application startup, cached for duration of application life
      • not dynamically updated at runtime
      • do not fire events that need to be listened for
    • possibly lazily instantiated, i.e. loaded upon first use such that we only populate dictionaries we need

"Models"

    • small "s" singletons, references injected into dependant components, typically mediators, controllers
    • shared dynamic data structures that cache stateful data subject to change/reloading at run-time
    • support on-demand refreshing/updating
    • fire events when contents updated

Application settings

A shared model that contains app and user settings relevant to this instance of the application

User settings/preferences
    • default language
    • colors
    • search result limit
    • default task
    • filters
    • sort order
    • loaded and applied onece user is authenticated
    • changes applied and persisted both locally, and remotely
Application settings/preferences
    • default checkout limit
    • etc
    • loaded and applied upon application startup
    • changes applied and persisted locally only (not remotely), valid only for the app session