Feb. 21st, 2016

Model spec

Feb. 21st, 2016 04:22 pm
marnanel: (Default)
[personal profile] marnanel
Here's a draft specification for the model in Dwim. It's written abstractly rather than WRT any particular implementation. There's a lot of functionality missing because this is only for the first iteration. Suggestions and comments are very welcome.

class Fetcher
This fetches files over HTTP(S). It deals with caching according to the HTTP headers, and maintains the cache (including an upper limit on the cache's size).
It also uses Shrinker to degrade incoming images.

class Shrinker
This optionally scales incoiming and outgoing images down, to save space and bandwidth. It can be disabled in settings.

class Dwlib
This fetches HTML from Dreamwidth using Fetcher, and returns results represented by various classes, given below.
Its constructor requires the username of the account to log in with.
It caches cookies and passwords for each known account.
Any method, other than the login method and the constructor, can throw an exception if the cookies are unknown, stale, or rejected by the server.

class Post
A post. It may be someone else's post, retrieved from the server; it may be this user's post, waiting to be sent as soon as we get back online; it may be a draft post.
The class allows us to know only part of the information about the post, and to download other information about it as requested.

class Timeline
A chronological series of posts-- a user's timeline, a reading page, or a community.
Most Timelines represent the newest "n" posts for a particular timeline. But they can also represent posts made by a particular user in a particular month.
There is a method to return the number of posts currently known.
If you try to access posts beyond this number, the Timeline will attempt to fetch more.
There is a method to retrieve all posts on a timeline made since the last fetch.

class User
A user. This will only be rudimentary in the first iteration.

class UserSet
A set of Users. Used for making filters and reading-circles.

Profile

dwim: the dwim logo (Default)
Dwim the Android client

June 2016

S M T W T F S
   1234
56 7891011
12131415161718
19202122232425
26 27282930  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 25th, 2017 08:50 pm
Powered by Dreamwidth Studios