Changes between Version 2 and Version 3 of HackageDB/2.0/Architecture

Show
Ignore:
Timestamp:
08/06/10 00:30:07 (3 years ago)
Author:
mgruen
Comment:

add section on design todos

Legend:

Unmodified
Added
Removed
Modified
  • HackageDB/2.0/Architecture

    v2 v3  
    1616 
    1717This is a work in progress. Nearly everything here was implemented this 
    18 past summer (2010). 1800 words and counting... 
     18past summer (2010). 1800 words and counting. 
    1919 
    2020== Types == 
     
    142142 * Filters are generally called before an update happens, with the ability to stop the event, or inject some value into it. They can also take any number of arguments, and return a typed IO result. They use the same internal representation as Hooks, but have more specific utility functions. 
    143143 * Basic and digest authentication. This authenticates an access control list against the user database using a stateless approach. 
     144 * Backup. One of the more complicated backup types is RestoreBackup, which each feature wanting to import data should implement. (explain) 
    144145 
    145146== Core Hackage types == 
     
    174175 * !UserFeature provides: 
    175176   * packageMutate :: Filter (!UserId -> IO Bool). Called whenever updating any kind of package index, even a non-main one. This can be used to let anyone use the social features, but only let approved people upload packages, which is the current system as of August 2010. 
     177 
     178== General deficiencies == 
     179 * Routing is untyped (stringly typed), a common but unfortunate situation for most routing libraries which vanilla Happstack manages to avoid. This is a necessary evil when Haskell lacks inclusion polymorphism and subtyping (e.g. the Restlet approach [http://www.restlet.org/documentation/1.1/tutorial#part11 hides some of the complexity] with subclasses), but combinator functions can help alleviate it. For example, withPackageName converts a list of string path components into a !PackageName, and other variants of with* functions do data querying as well. 
     180 * Server-side and client-side caching is only ad-hoc presently. 
     181 * grep -R 'TODO\|FIXME' .  —and expect a screenful or two 
     182 * User groups have a messy interface. Although each feature should define and manage their own, it is still desirable to map a user to the groups they are in. Presently this is done by mapping a !UserId to a bunch of URIs, and each URI to a group description. 
     183 * Too many cross-cutting Happstack queries. Features should hide Happstack queries and updates in their own wrappers, which may also call hooks and do any related maintenance. 
     184 * The system of relying on hooks and filters to keep features in sync is fragile, and it's easy to miss something and get inconsistent results. Perhaps there should be a package mapping which has the express purpose of syncing with the main index. 
     185 * As ever, eliminate as much boilerplate as sanely possible.