In my previous post I outlined a plan to write a GAE+GWT application. (See goals section in the previous post). In this post I will specify the product and give a high level design.
Product Definition
The application will be a Social Network Navigator. It will
- navigate a person's list of social network connections
- show each connection's information (extracted from or linked to some social networking sites)
- allow the connection to become the person so their connections can be navigated
UI Components
- Main person (one line of summary info: name, address, description).
- List of person's connections (one line of summary info per person).
- Panel with details of selected person or connection.
- Navigation buttons (next, previous, first, last screen of connections)
- Selecting a person or connection shows their details in the Details panel.
- Clicking on a selected connection makes the connection the main person.
- Navigation buttons move between screens of connections
The server will be fetching data from somewhere, either a data store or from some other website or web service. This is going to be slow compared to desired UI response time so we will need to keep a client side cache with the data people will be likely to be requesting. The client cache needs to fetch data from the server before the user requests viewing them. One way to arrange the cache is in terms of the number of mouse clicks a person is from being visible on the main screen.
- Visible
- 1 click from being visible
- 2 clicks from being visible
- ...
- N visible persons
- <= 4*N 1-click persons (next, previous, first, last)
- <= 4*N 2-click persons (next-next, previous-previous, first-next, last-previous
High Level Design - UI and Client Cache Interaction
The previous section outlined a cache that depended on the UI state. This leads to a simple set of interactions between the UI and cache.
- User sets new UI state
- UI sends the m-click hints to client cache and disables user controls (effectively freezing the state of the UI)
- Client cache signals UI when visible persons are in cache.
- UI enables user controls.
The effectivenees of the cache will depend on how often it fetched the m-click-away persons from the server before the user makes those clicks. There are some obvious trade-offs.
- Fewer navigation controls in the UI makes caching easier but leads to a less flexibiltiy
- Bigger caches are faster but use up client side memory and may waste server fetches.
This is simple in principle. Fetch data from the server. Some things will need to be tuned
- number of people fetched per server interaction
- timing of feches for different client cache levels (all at once or m-click before m+1-click)
Each person will have some possibly data and some searchable meta-data.
- Person = summary (name, address, ...) + detail + list of connections (other persons)
- Fetch data from datastore (and store it memcache)
- Fetch data from memcache.
High Level Design - Person Data Structure
The person data structure is mostly straightforward, a big chunk of data with some meta-data. The obvious wrinkle is the relationships between persons. Each person has connections to other persons. If there needs to be any work on connections, such as sorting the connections by the connections' meta-data then we have to decide how much meta-data to store with each connection, or see how the datastore can assist in one to many relationships.
You can watch this project's progress here.
0 comments:
Post a Comment