CHARACTER CASE CONVENTIONS : # Only the stuff inside a function begins with lower case. Everything else that is part of the class begins with upper case. 1. Class names begin with upper case. 2. Class operations and attributes begin with upper case 3. Types local to operations begin with lower case NOTATIONAL CONVENTIONS //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// ARGUMENT SYNTAX ---------------- (+) - 1 or more (*) - 0 or more (n) - Exactly n (n is an integer) [x] - denotes that x is an optional field (GET) - used to signal a getter method (SET) - used to signal a setter method ATTRIBUTE SYNTAX ------------------ -> [(+)] PARAMETER SYNTAX ----------------- [ ((*)) [(GET)][(SET)] CLASS DESCRIPTION SYNTAX ------------------------- =============================================== -- [: (+) ] =============================================== [* ATTRIBUTES (+)] [* OPERATIONS (+)] [* TYPES (+)] [* FEATURES (+)] //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// FLOW OVERVIEW : 1. The GUI triggers a method of some sub-class of the EventHandler class. 2. The event handlers all have access to a RequestDispatcher instance (as they derive from the EventHandler class ). 3. Each EventHandler has a RequestID which is a field that contains the type of event (MEAL,CONTACT etc.) 4. Each EventHandler has a RequestTypeList which denotes the events (eg. create,update, delete) that are possible for the given RequestID. 5. The method of the event handler constructs the necessary parameters (including SessionID,RequestID and RequestType) and calls the DispatchRequest method on the RequestDispatcher object. 6. The DispatchRequest method checks the RequestID and RequestType and calls the HandleManagementRequest method of the appropriate ManagementRequestHandler. 7. HandleManagementRequest calls the appropriate Request method of the given ManagementRequestHandler sub-class based on RequestType. 8. The Request method calls the appropriate method on the Manager object (that is an attribute of the ManagamentRequestHandler sub-class) 9. The method of the Manager class updates the Database layer. To summarize : GUI -> EVENT HANDLER -> REQUEST DISPATCHER -> MANAGEMENT REQUEST HANDLER -> MANAGER -> DATABASE ADDITIONAL POINTS : 1. The DispatchRequest method first obtains UserName from SessionID using the same procedure as mentioned above (using the LoginManagementRequestHandler). 2. Then all subsequent processing uses UserName instead of SessionID (i.e. steps 6-9 above). 3. After the DB update, control returns to the RequestDispatcher and the RequestDispatcher can cause notificaions to be sent out to clients via the same process above using the NotificatoinManagementRequestHandler). 4. The client's GUI is updated via fetch from the server. POST VS NOTIFICATOIN CONVENTIONS : 1. A user posts to the server. 2. A server sends out notifications to all the recipients. 3. A user can accept or decline a notification. The server is notified of acceptance or rejection via a post (ContactAcceptPost). NOTE : The manager classes are one layer above the database layer. All client to server communication goes to RequestDispatcher. Interfaces,abstract classes etc. have not been explicitly labelled. These decisions have not been concretly made but have been hinted in the class glossary below The implementation will program to interfaces. Also, parameters for EventHandler methods have been omitted. There may be one additional layer (like a method that handles events called HandleEvent() and that then calls methods like CreateMealPostEvent()) of indirection in the event handling mechanism that have not been explicitly stated. The object of type Time hasn't been explicitly stated. This will be handled during implementation. Some fields have strings etc. as their type. This is NOT fixed and is subject to change during implementation. /////////////////////////////////////////////////////// ////////////////////////////////////////////////////// ============ UserAccount ============ * ATTRIBUTES * UserName -> String(1) * Password -> String(1) * UserEmail -> String(1) * OPERATIONS * UserName() (GET)(SET) * Password() (GET)(SET) * UserEmail() (GET)(SET) * FEATURES * The ability to locally get and set the username, password and user email =========== MealManager =========== * OPERATIONS * CreateMealPost(Post(1)) * UpdateMealPost(Post(1)) * CompleteMealPost(Post(1)) * CloseMealPost(Post(1)) * FEATURES * The ability to create,update,complete and close a meal post on the back end. =============== AccountManager =============== * OPERATIONS * CreateUserAccount() * DeleteUserAccount( UserName(1) ) * UpdateUserAccount( UserAccount(1) ) * IsValidUser( UserName(1) ) * FEATURES * The ability to create user accounts * The ability to delete user accounts. * The ability to insert and modify account information. * The ability to verify user account credentials. ================= ContactManager ================= * OPERATIONS * UpdateUserVisibilityList(UserName(1), ContactList(1)) * UpdateContactInfo(UserName(1), ContactInfo(1)) * RemoveContact(UserName(1), ContactInfo(1)) * AddContact(UserName(1), ContactInfo(1)) * SearchContact(UserName(1), ContactInfo(1)) * FEATURES * The ability to add a contact. * The ability to delete a contact. * The ability to search for a contact. * The ability to update contact information. * The ability to modify a user's visibility list. ============ LoginManager ============ * OPERATIONS * Login(User.UserName) * GetUserName(SessionID(1)) * Logout(sessionID(1)) * FEATURES * The ability to login and logout of user account. * The ability to retrieve user name of user that corresponds to a sessionID. ============ ContactInfo ============ * ATTRIBUTES * UserName -> UserAccount.UserName (1) * Email -> UserAccount.UserEmail(1) * Alias -> String(1) * Visible -> boolean(1) * OPERATIONS * Visible() (GET)(SET) * Alias() (GET)(SET) * FEATURES * Retrieve and modify contact's visibility status (i.e. whether or not the contact sees you as visible). * Retrieve and modify contact's Alias. ======== User ======== * ATTRIBUTES * Account -> UserAccount(1) * ContactList -> ContactInfo(*) * AvailabilityStatus -> boolean(1) * NotificationsList -> Notifications(*) * MealPostList-> MealPost(*) * OPERATIONS * AvailabilityStatus() (GET)(SET) * NotificationsList() (GET)(SET) * ContactList() (GET) * AddContact(ContactInfo(1)) * UpdateContactAlias(ContactInfo(1)) * SetContactVisibility(ContactInfo(1), boolean(1)) * RemoveContact(ContactInfo(1)) * FEATURES * The ability to set availability status locally. * The ability to modify visibility list locally. * The ability to delete contacts locally. ======================== ManagementRequestHandler ======================== * OPERATIONS * HandleManagementRequest(Object(*)) ========================================================= AccountMangementRequestHandler : ManagementRequestHandler ========================================================= * ATTRIBUTES * AccountManagerObject -> AccountManager(1) * OPERATIONS * CreateAccountRequest() * ModifyAccountRequest(UserAccount(1)) * DeleteAccountRequest(UserAccount(1)) * CheckValidityRequest(UserAccount(1)) * FEATURES * Handles all account management requests on the back end. ======================================================== LoginManagementRequestHandler : ManagementRequestHandler ======================================================== * ATTRIBUTES * LoginManagerObject -> LoginManager(1) * OPERATIONS * AuthenticateAndLoginRequest(UserAccount(1)) * GetUserNameRequest(SessionID(1)) * LogoutRequest(SessionID(1)) * FEATURES * Handles all login management requests on the back end. =================== NotificationManager =================== * ATTRIBUTES NotificationObject -> Notification(1) * OPERATIONS * CreateNotificationFromPost(Post(1)) * UpdatePostFromNotification(Post(1)) * PushNotification() * FEATURES * The ability to push notification to all contacts that are recipients of the notification and are currently available to the poster or become available to the poster before the notification expires or is closed manually by the poster. * The ability to inform (via push) the poster of the notification of which contacts have accepted and when the notification is closed. ========================================================== ContactManagementRequestHandler : ManagementRequestHandler ========================================================== * ATTRIBUTES * ContactManagerObject -> ContactManager(1) * OPERATIONS * UpdateUserVisibilityListRequest(UserName(1), ContactList(1)) * UpdateContactInfoRequest(UserName(1), ContactInfo(1)) * RemoveContactRequest(UserName(1), ContactInfo(1)) * AddContactRequest(UserName(1), ContactInfo(1)) * FEATURES * Handles all contact management requests on the back end. ======================================================= MealManagementRequestHandler : ManagementRequestHandler ======================================================= * ATTRIBUTES * MealManagerObject -> MealManager(1) * OPERATIONS * CreateMealPostRequest(UserName(1),Post(1)) * UpdateMealPostRequest(UserName(1), Post(1)) * CompleteMealPostRequest(UserName(1), Post(1)) * CloseMealPostRequest(UserName(1), Post(1)) * FEATURES * Handles all meal management requests on the back end. =============================================================== NotificationManagementRequestHandler : ManagementRequestHandler =============================================================== * ATTRIBUTES * NotificationManagerObject -> NotificationManager(1) * OPERATIONS * CreateNotificationRequest(Post(1)) * UpdateNotificationRequest(Post(1)) * FEATURES * Handles all notification management requests on the back end. ================= RequestDispatcher ================= * ATTRIBUTES * AccountManagementRequestHandlerObject -> AccountManagementRequestHandler(1) * LoginManagementRequestHandlerObject -> LoginManagementRequestHandler(1) * ContactManagementRequestHandlerObject -> ContactManagementRequestHandler(1) * MealManagementRequestHandlerObject -> MealManagementRequestHandler(1) * NotificatoinManagementRequestHandlerObject -> NotificationManagementRequestHandler(1) * OPERATIONS * DispatchRequest(Object(*)) * FEATURES * Dispatches the management request to the appropriate handler on the back end. ======= Request ======= * ATTRIBUTES * RequestTypes -> Enum * FEATURES * Properties class that contains the various request types that are handled by the application. ============ EventHandler ============ * ATTRIBUTES * RequestDispatcherObject -> RequestDispatcher(1) * TYPES * ContactEventHandler * MealEventHandler * NotificationEventHandler ================================== ContactEventHandler : EventHandler ================================== * ATTRIBUTES * RequestID -> String(1) * RequestTypeList -> String(+) * ContactRequestPostObject -> ContactRequestPost(1) * OPERATIONS * HandleSearchForContactEvent() * HandleAddContactEvent() * HandleEditContactEvent() * HandleDeleteContactEvent() * FEATURES * The ability to search, add, edit and delete contacts. ==== Post ==== * ATTRIBUTES * PostID * Poster -> User(1) * RecipientList -> ContactInfo(+) * StartTime * EndTime * [Message] * OPERATIONS * StartTime() (GET) (SET) * EndTime() (GET) (SET) * Message() (GET)(SET) * TYPES * MealPost * ContactPost * AcceptancePost * FEATURES * The ability to add a custom message or additional information. * The ability to add a list of recipients who will receive the post -- Subset of user's contacts. * The ability to add a recipient who is currently unavailable. * The ability to set notification post time -- The user can choose when the notification is posted (perhaps at a later time or date). ================== ContactRequestPost : Post ================== ===================== AcceptancePost : Post ===================== * ATTRIBUTES IsAccepted -> boolean(1) * FEATURES * The ability to accept or reject(decline) a post (meal or contact) =============== MealPost : Post =============== * ATTRIBUTES * Meal * OPERATIONS * Meal() (GET)(SET) ================================== MealEventHandler : EventHandler ================================== * ATTRIBUTES * RequestID -> String(1) * RequestTypeList -> String(+) * MealObject -> Meal(1) * MealPostObject -> MealPost(1) * OPERATIONS * HandleMealCreatedEvent() * HandleMealPostCreatedEvent() * HandleMealPostCompletedEvent() * HandleMealPostClosedEvent() * HandleMealPostUpdatedEvent() * FEATURES * The ability to create a meal post. (No longer accept replies) * The ability to update a meal post. (No longer accept replies) * The ability to close a meal post. (No longer accept replies) * The ability complete a meal epost. (Cancel the event) -- USER/MEAL NOTIFICATION MANAGEMENT FEATURES -- sent to contacts based on above visibility list. * The ability to receive meal notifications -- from contacts to whom the user is available (Determined by availability and visibility as noted above). ======================================= NotificationEventHandler : EventHandler ======================================= * OPERATIONS * HandleNotificiationAcceptedEvent() * HandleNotificiationRejectedEvent() * FEATURES * Ability to accept or decline a notificitation (meal or contact) ============ Notification ============ * ATTRIBUTES *NotificationID *Poster -> User(1) *[Message] * TYPES * Contact Notifications * Meal Notifications =============================== MealNotification : Notification =============================== * ATTRIBUTES * MealObject -> Meal(1) ====================================== ContactNotification : Notification ====================================== ==== Meal ==== * ATTRIBUTES * LocationObject -> Location(1) * StartTime -> Time(1) * EndTime -> Time(1) * MaximumCapacity -> integer(1) * IsExtendable -> boolean(1) * OPERATIONS * LocationObject() (GET)(SET) * StartTime() (GET)(SET) * EndTime() (GET)(SET) * MaximumCapacity() (GET)(SET) * IsExtendable() (GET)(SET) * FEATURES * The ability to set the location of the meal (Look at geo location features below) -- This CAN BE a custom location (someone's house for example). * The ability to set a duration (optional start and end time) for meal -- A user may be open for breakfast for two hours from current time OR the user says he/she can have breakfast between 8-10 a.m. * The ability to set maximum size of meal party. * The ability to set whether meal is open to extended contacts -- allows friends of friends to join in. ======== Location ======== * ATTRIBUTES * LocationName -> String(1) * StreetAddress -> String(1) * OPERATIONS LocationName()(GET)(SET) StreetAdress()(GET)(SET)s * USES Google Maps Autcomplete API * FEATURES *The ability to automatically find address of restaurant -- If poster type's subway, the address "Subway restaurant, xyz Street, ..." should automatically be filled in.