Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add README file

  • Loading branch information...
commit 3985f42c0c6c59b9404108a10e09bfd4413c3a87 1 parent cd089dc
Ionuț G. Stan authored October 25, 2010

Showing 1 changed file with 97 additions and 0 deletions. Show diff stats Hide diff stats

  1. 97  README
97  README
... ...
@@ -0,0 +1,97 @@
  1
+WHAT IS THIS PROJECT
  2
+====================
  3
+Nemira is a desktop client for Google Reader API. I've created it in order to
  4
+learn C# and WPF (Windows Presentation Foundation).
  5
+
  6
+
  7
+ARCHITECTURE OVERVIEW
  8
+=====================
  9
+The Nemira project is the one that handles all UI related stuff, like displaying
  10
+of windows and event handling. It delegates to classes in the GoogleReader.API
  11
+project when it has to read/create/update/delete (CRUD) subscriptions.
  12
+
  13
+The GoogleReader.API.Tests project contains a few tests I wrote while exploring
  14
+Google's API. The Nemira.Tests project is, unfortunately, just a skeleton.
  15
+
  16
+
  17
+The ReaderAccount class
  18
+-----------------------
  19
+The ReaderAccount class is the heart of the Reader API wrapper. Basically, it
  20
+exposes a set of methods that are direct corespondents of the methods exposed
  21
+by Google's Reader API. ReaderAccount is open for extension by having a constructor
  22
+that receives an HttpClient and an instance of a config object representing
  23
+endpoint URLs to the Google service.
  24
+
  25
+Because the HTTP client is pluggable, a lot of things are possible without even
  26
+touching the internals of the ReaderAccount class:
  27
+
  28
+  - local caching of subscriptions
  29
+  - use of stub subscriptions instead of real ones (see StubHttpClient class
  30
+    inside the Nemira project)
  31
+  - different forms of authentication
  32
+
  33
+For convenience, I've added a constructor that takes an user email and password
  34
+an uses them to instantiate some default dependencies.
  35
+
  36
+
  37
+Authentication
  38
+--------------
  39
+Authentication took advantage of the above design and was implemented as a
  40
+decorator (AuthorizedHttpClient) over the SimpleHttpClient class. Basically,
  41
+each HTTP request is decorated to include an Authorization header and a Google
  42
+Reader token.
  43
+
  44
+The Google Reader API provides two authentication and authorization methods:
  45
+  - using OAuth, which is the recommended option
  46
+  - using the so called Client Login, which makes use of custom HTTP headers and
  47
+    is deprecated in favor of OAuth.
  48
+
  49
+I chose to use the second method because it's easier to implement. OAuth would
  50
+have required a proxy or an embedded server to be implemented. However, because
  51
+the authentication and authorization mechanism is pluggable it shoulnd't be so
  52
+hard to provide an HTTP client that would decorate requests with OAuth info.
  53
+
  54
+
  55
+Reading Google's Responses
  56
+--------------------------
  57
+The ReaderAccount class makes a pretty big assumptions when it comes to reading
  58
+Google's responses. It expects JSON, and this thing is hardcoded inside the
  59
+internals of the class. Swapping to XML, for example, would require changes in
  60
+the internals of the class. However, I thought that this kind of flexibility
  61
+isn't yet necessary. Construnction of domain objects is also hard coded inside
  62
+the ReaderAccount class, and maybe it would have been nice to have some factories
  63
+for this, but... those objects are generally value objects. Even if they have
  64
+behavior, this is usually delegated back to a ReaderAccount instance (for example,
  65
+the Subscription class uses delegation in its Items property).
  66
+
  67
+
  68
+Error Handling
  69
+--------------
  70
+It's almost totally missing at this time. I've concentrated more on getting
  71
+some functionality up and running, than on treating HTTP network erros or JSON
  72
+parsing errors. This is an item on the TODO list though.
  73
+
  74
+
  75
+Performance
  76
+-----------
  77
+This is a weak point too. The main subscription tree loads items for *all* the
  78
+subscriptions as soon as the app starts up. Deferred loading, using the Expanded
  79
+event of TreeViewItem should solve this problem and it's on the TODO list too.
  80
+
  81
+Also, quickly navigating with the arrow keys through subscription items will
  82
+load cause that item's content to be loaded inside the content area without any
  83
+timeout at all. A timeout period of 4-5 milliseconds before loading the content
  84
+would be a nice thing to have.
  85
+
  86
+
  87
+Content Area
  88
+------------
  89
+Each feed item that Google sends contains HTML markup. For this reason I had
  90
+too use an embedded Internet Explorer browser as a display.
  91
+
  92
+
  93
+User Interface
  94
+--------------
  95
+Main entry point is the App class, which will show a LoginWindow when the app
  96
+starts up, the then the MainWindow instance. The other UI classes should have
  97
+pretty descriptive names for what they do.

0 notes on commit 3985f42

Please sign in to comment.
Something went wrong with that request. Please try again.