[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[dtp-dev] Design Proposal - Work Offline Mode
|
Hey all,
I'm looking at adding hooks within the framework to support an offline
mode. The following describes the user interaction as well as some details
regarding API. Please let me know if this is adequate or if you have any
suggestions as to how this should work, what API should be involved, etc.
Actions/commands: The following describes the actions, their enablement
and behavior, required for offline support.
Connect:
connection state == disconnected
enablement: enabled.
behavior: An attempt to connect to the server is made. If the
connection attempt was successful, the connection profile is moved to
a "connected" state. This does not differ from the current connect
action behavior.
connection state == connected
enablement: disabled.
behavior: none.
connection state == offline
enablement: enabled.
behavior: An attempt to connect to the server is made. If the
attempt is successful, the tree is updated to reflect the state of
the server. The provider is responsible for synchronizing the
offline model with the connected model (e.g. propagating offline
changes onto the server). While no support (including API hooks) for
performing this task is provided by the framework, the provider will
be able to determine that the connection state is changing from
"offline" to "connected." If the connection attempt is successful,
the connection profile is moved to a "connected" state.
Disconnect:
connection state == disconnected
enablement: disabled.
behavior: none.
connection state == connected
enablement: enabled.
behavior: Disconnects from the server. The connection profile is
moved to a "disconnected" state.
connection state == offline
enablement: enabled.
behavior: The connection profile is moved to a "disconnected" state.
The provider must determine whether or not it is appropriate to
persist any modifications made to the offline model.
Work offline:
connection state == disconnected
enablement: enabled.
behavior: If a persisted "snapshot" of the server's state exists, it
is loaded and presented to the user and the state of the connection
profile is moved to "offline." If a persisted snapshot does not
exist or cannot be loaded, the state of the connection profile
remains unchanged.
connection state == connected
enablement: enabled.
behavior: A snapshot of the server's state is persisted prior to
disconnecting from the server. If the persistence operation was
successful, the connection to the server is closed the connection
profile is moved to an "offline" state. If there was a problem
persisting the state, the connection to the server will remain open
and the connection profile's state will remain unchanged.
connection state == offline
enablement: disabled.
behavior: none.
Save offline:
connection state == disconnected
enablement: disabled.
behavior: none.
connection state == connected
enablement: enabled.
behavior: A snapshot of the server's state is persisted. The
connection profile's connected state remains unchanged.
connection state == offline
enablement: enabled.
behavior: The persisted snapshot of the server's state is updated.
The connection profile's connected state remains unchanged.
API Modifications:
IOfflineConnectionFactory - an extended version of IConnectionFactory that
provides hooks for integrating with offline actions.
IOfflineConnection - an extended version of IConnection that provides hooks
for integrating with offline actions.
Sequence diagrams: (or the best approximation in text form)
Connect action:
connected state == disconnected
IOfflineConnectionFactory.createConnection(IConnectionProfile)-->returns
new IOfflineConnection
connected state == connected
no action
connected state == offline
IOfflineConnection.attach()
Disconnect action:
connected state == disconnected
no action
connected state == connected
IOfflineConnection.close()
connected state == offline
IOfflineConnection.close()
Work offline action:
connected state == disconnected
IOfflineConnection.createOfflineConnection()-->returns new
IOfflineConnection
connected state == connected
IOfflineConnection.detach()
connected state == offline
no action
Save offline action:
connected state == disconnected
no action
connected state == connected
IOfflineConnection.save()
connected state == offline
IOfflineConnection.save()
Please let me know if you have any questions, comments, concerns, etc.
Best regards,
Rob Cernich
DTP Connectivity Project Lead