Module Interface Desc
Module Interface Desc
Introduction
[An overview of the system as specified in the Design assignment, followed by
the discussion of the high-level architecture and style of the system]
The high-level architecture for the system is shown in Figure 1-1.
Figure 1-1:
High-Level
Architecture
Provided Interface
Provided Interface
Administrative
Client
User Client
Required Interface
Required Interface
1
Provided Interface
Server
Required Interface
Administrative Client
The description of this module has been left out in this design example.
User Client
Please see Chapter 3 for a detailed description of this module.
Server
Please see Chapter 2 for a detailed description of this module.
2. Server Design
SERVER MODULE
Purpose
The purpose of this module is to provide a centralized place where information
for the system can be stored, manipulated, and accessed.
Rationale
This module is created to centralize and encapsulate all data storage and retrieval
duties on the system. This includes user profiles, success stories, banner ads,
pictures, and messages. It also provides some services, such as authentication,
network communication and search.
Communications
Module
Figure 2-1:
High-Level Server
Architecture
Required Interface
Provided Interface
Provided Interface
Administrative
Module
User Module
Required Interface
Required Interface
Required Interface
Required Interface
This module has no required interface.
Provided Interface
The provided interface of this module is the union of the provided interfaces of
the following submodules:
Communications
For more detail, please see these modules descriptions.
Rationale
This module is created to centralize and encapsulate network communication
duties between clients and the server.
Required Interface
This modules required interface is the union of the provided interfaces of the
following components:
Administrative Module
User Module
Provided Interface
The provided interface of this module is the same as its required interface, except
that the interface is made available for network calls. As such, it cannot be
represented by procedure calls, as this would unnecessarily constrain the
underlying representation to be Remote Procedure Call (RPC) oriented.
Provided Interface
Passwords &
Authentication
Figure 2-2:
Architecture of
the User Module
Required Interface
Provided Interface
Messaging
Required Interface
Provided Interface
Profiles
Required Interface
Required Interface
Purpose
The purpose of this module is to authenticate users, to provide user message
boxes and management functions for them.
Rationale
This module is created to centralize services related to users.
Required Interface
This module has no required interface.
Provided Interface
The provided interface of this module is the union of the provided interfaces of
the following submodules:
Profiles
Passwords and Authentication
Messaging
Rationale
This module is created to centralize and encapsulate data storage and retrieval
duties and related to users.
Required Interface
This module has no required interface.
Provided Interface
void putUserProfile(UserProfile p);
Description:
Stores a user profile, overwriting the existing one with the same user ID (if any).
Parameters:
p: User profile to store in data store. If profiles username is already stored, this
profile overwrites the existing one.
UserProfile getUserProfile(UserID userID) throws
NoSuchUserException;
Description:
Gets a user profile given the users ID.
Parameters:
userID: The User ID of the profile to retrieve.
Returns:
The requested user profile.
Exceptions:
NoSuchUserException: If the userID did not represent an existing profile.
UserProfile[] getAllUserProfiles();
Description:
Gets all user profiles.
Returns:
Module ADTs
typedef UserID String;
UserProfile{
UserID nickname;
int age;
String countryOfResidence;
int zipCode;
Enum sex {male, female};
Int heightInInches;
Enum hairColor {bald, gray, black,
darkBrown, lightBrown, darkBlond,
lightBlond, red, purple, blue, green};
Enum hairStyle {traditional, spiky, wavy,
Rationale
This module is created to centralize and encapsulate password management and
authentication services.
Required Interface
boolean userExists(UserID userID);
Provided Interface
void setPassword(UserID userId, Password password)
throws NoSuchUserException;
Description:
Stores a user password of the given user ID.
Parameters:
userID: User ID of the user whose password is being stored.
password: The password for that user.
Exceptions:
NoSuchUserException: If the given user does not exist.
boolean logon(UserID userID, Password password) throws
BannedUserException;
Description:
Determines whether a given user/password combination is valid or not. For
security reasons, the incorrect portion of the combination (i.e. user or password) is
not given.
Parameters:
userID: User ID of the user whose password is being checked.
password: The presumed password for that user.
Returns:
True if the user ID/password combination is correct, false otherwise.
Exceptions:
BannedUserException: If the given user has been banned.
void logoff(UserID userID) throws NoSuchUserException,
UserNotLoggedOnException;
Description:
Logs a user off the system.
Parameters:
userID: User ID of the user who is logging off.
Exceptions:
NoSuchUserException: If the given user does not exist.
UserNotLoggedOnException: If the given user is not logged on.
Module ADTs
UserID: See Profiles Module
typedef Password String;
Rationale
This module is created to centralize and encapsulate message management
services.
Required Interface
boolean userExists(UserID userID);
Provided Interface
void putMessage(UserID userID, Message message) throws
NoSuchUserException, MailboxFullException;
Description:
Stores a given message in the specified users mailbox. Also sets their
hasNewMail flag.
Parameters:
userID: The userID who is the recipient of the message being stored.
message: The message being stored.
Exceptions:
NoSuchUserException: If the given user does not exist.
MailboxFullException: If the mailbox of the recipient is full.
boolean hasNewMail(UserID userID) throws
NoSuchUserException;
Description:
Determines if a given users hasNewMail flag is set.
Parameters:
userID: The userID of the user being checked for new mail.
Exceptions:
NoSuchUserException: If the given user does not exist.
Message getMessage(UserID userID, int messageNumber)
throws NoSuchUserException,
MessageNumberOutOfBoundsException;
Description:
Gets a user message given a user ID and a message number. Clears their
hasNewMail flag.
Parameters:
userID: User ID of the user whose message is being retrieved.
messageNumber: The index number of the message being retrieved. Must be
between 0 and 49, inclusive.
Returns:
The message, if it exists, or null if the user exists but the user has stored no
message in the given message numbers slot.
Exceptions:
NoSuchUserException: If the given user does not exist.
MessageNumberOutOfBoundsException: If the message number is out of the 049 bound.
Message[] getAllMessages(UserID userID) throws
NoSuchUserException;
Description:
Gets all of a users messages given a user ID. Clears their hasNewMail flag.
Parameters:
Module ADTs
UserID: See Profiles Module
Message{
UserID senderID;
Date dateSent;
String text;
}
Rationale
This module is created to provide the user interface to the system.
Provided Interface
User Client
Provided Interface
UI Module
Required Interface
Figure 3-1:
High-Level User
Client Architecture
Provided Interface
Communications
Module
Required Interface
Required Interface
Provided Interface
This module has no provided interfaces.
Required Interface
The required interface of this module is the same as the required interface of the
Communications module (see section 3.2)
3.1 UI Module
The description of this module is not discussed in this design example.
Rationale
This module is created to centralize and encapsulate network communication
duties between the user client and the server.
Required Interface
This modules required interface is the same as its provided interface, but it makes
calls to the servers communication module via an implementation-dependent
network protocol.
UserProfile getUserProfile(UserID userID) throws
NoSuchUserException;
boolean userExists(UserID userID);
void logoff(UserID userID) throws NoSuchUserException,
UserNotLoggedOnException;
void putUserProfile(UserProfile p);
void removeUserProfile(UserID userID) throws
NoSuchUserException;
void putMessage(UserID userID, Message message) throws
NoSuchUserException, MailboxFullException;
Message getMessage(UserID userID, int messageNumber)
throws NoSuchUserException,
MessageNumberOutOfBoundsException;
Provided Interface
The provided interface of this module is the same as the required interface of the
UI module.