API Design Mood Tracker Updated
Transcript of API Design Mood Tracker Updated
8/21/2019 API Design Mood Tracker Updated
http://slidepdf.com/reader/full/api-design-mood-tracker-updated 1/1
Database
DB Handler
Server
Client
Users TableContextTableAnalysisTable
As a client-side developerIwant
(N) a functionto authenticate the user is authentic
(I) a function to send currentcontextinformation to the
(II) a function to ask forstart ofanalysis of the userda
(III) a function to check ifthe analysis is finished and if
User story"Mood Tracker!" (keep track ofwhen you’re happy!correlates mood
with contextfor self-analysis!).
Clients can store mood information on the server and access analysis
fromthe server on the user’s mood trends.
Architecture
Super AwesomeObserver™
Super AwesomeObserver™ isat the
forefront ofUbiquitous computing and
combinesa var ietyofsensorsincluding
GPS, Light Sensors, Wearablegadgets,
Sound recorder to generatemost relevant
contextual information!
Logic
APIHandler
APIHandler
Logic
submitContext(context, authToken)
fetchAnalysisResult(
jobID, authToken)
requestAnalysis(
date.range, authToken)
SherlockMood Analyser™
Sherlock Mood Analyzer™ uses a wide
arrayof contextual information and feeds
them into it’s sophisticated modelling and
inferencemachinery to extract trends in
user’s mood and recommends activities to
elevatemood in anygiven situation!
(UserID, ContextData)
Context g e t C o n t e x t ( )
authenticate(
userID)
// on client side
// When need to authenticate
// NOTE: This is an overly simple design
// brevity of the current document. Bett
// a formatted string (e.g., JSON) with
// TOKEN elements.
authToken = server.authenticate(userID)
if authToken == NULL
logThisFact();
// Authenticates the user, returns a aut
// REQUIRES: userID is valid and exists.
//
// …
// MODIFIES: The DB by storing the curre
// EFFECTS: Issuing an authToken and sto
//
// RETURNS: authToken string which would
string authenticate(stringuserID);
APISpec N
Use case N