13
1. 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 F igure 1-1 Administrative Client The description of this module has been left out in this design e!ample User Client "lease see #hapter $ for a detailed description of this module Server "lease see #hapter % for a detailed description of this module &ser #lient 'e(uired )nterface "rovided )nterface 1 n Figure 1-1: High-Level Architecture *erver 'e(uired )nterface "rovided )nterface Administrative #lient 'e(uired )nterface "rovided )nterface 1 n

Module Interface Desc

Embed Size (px)

Citation preview

Page 1: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 1/13

1. 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

Administrative ClientThe description of this module has been left out in this design e!ample

User Client"lease see #hapter $ for a detailed description of this module

Server"lease see #hapter % for a detailed description of this module

&ser #lient

'e(uired )nterface

"rovided )nterface

1

nFigure 1-1:High-Level

Architecture

*erver 

'e(uired )nterface

"rovided )nterface

Administrative#lient

'e(uired )nterface

"rovided )nterface

1

n

Page 2: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 2/13

2. Server Design

SERVER MODULE

ur!ose

The purpose of this module is to provide a centrali+ed place where information

for the system can be stored, manipulated, and accessed

Rationale

This module is created to centrali+e and encapsulate all data storage and retrieval

duties on the system This includes user profiles, success stories, banner ads, pictures, and messages )t also provides some services, such as authentication,

networ communication and search

"ig#$Level Server Design

The server module is broen down into lower-level modules, as shown in Figure

%-1

As is obvious, all communications from the client come through the

communications module The provided interface of the high-level servercomponent and the server communications module are thus identical Two

modules in the server handle administrator and user functions, respectively achof these modules will be described in detail in following sections

'e(uired )nterface

"rovided )nterface

*erver 

#ommunications

.odule

'e(uired )nterface

"rovided )nterface

Administrative.odule

'e(uired )nterface

"rovided )nterface

&ser .odule

'e(uired )nterface

"rovided )nterface

Figure 2-1:

High-Level Server

Architecture

Page 3: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 3/13

Re%uired Inter&ace

This module has no re(uired interface

rovided Inter&ace

The provided interface of this module is the union of the provided interfaces ofthe following submodules/

• #ommunications

For more detail, please see these modules0 descriptions

2.1 COMMU'ICA(IO'S MODULE

ur!oseThe purpose of this module is to provide communication services between theclients of the system both administrative and user clients2 and the server This

module represents the part of the communications lin that resides on the server

Rationale

This module is created to centrali+e and encapsulate networ communication

duties between clients and the server

Re%uired Inter&ace

This module0s re(uired interface is the union of the provided interfaces of thefollowing components/

• Administrative .odule

• &ser .odule

rovided Inter&ace

The provided interface of this module is the same as its re(uired interface, e!cept

that the interface is made available for networ calls As such, it cannot berepresented by procedure calls, as this would unnecessarily constrain the

underlying representation to be 'emote "rocedure #all '"#2 oriented

Page 4: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 4/13

2.2 USER MODULE

ur!ose

The purpose of this module is to authenticate users, to provide user message

 bo!es and management functions for them

Rationale

This module is created to centrali+e services related to users

"ig#$Level Module Design

The user module is broen down into high-level modules, as shown in Figure 1-1

Re%uired Inter&ace

This module has no re(uired interface

rovided Inter&ace

The provided interface of this module is the union of the provided interfaces ofthe following submodules/

• "rofiles

• "asswords and Authentication

• .essaging

&ser .odule

'e(uired )nterface

"rovided )nterface

"rofiles

'e(uired )nterface

"rovided )nterface

"asswords 3Authentication

'e(uired )nterface

"rovided )nterface

Figure 2-2:

Architecture of

the User Module

.essaging

'e(uired )nterface

"rovided )nterface

Page 5: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 5/13

For more detail, please see these modules0 descriptions

2.2.1 ro&iles Module

ur!ose

The purpose of this module is to provide access to and a persistent data store for

all user profiles in the system

Rationale

This module is created to centrali+e and encapsulate data storage and retrievalduties and related to users

Re%uired Inter&ace

This module has no re(uired interface

rovided Inter&ace

void putUserProfile(UserProfile p);

Description:

*tores a user profile, overwriting the e!isting one with the same user )D if any2

Paraeters:

 p/ &ser profile to store in data store )f profile0s username is already stored, this

 profile overwrites the e!isting one

UserProfile getUserProfile(UserID userID) throws

NoSuchUserException;

Description:

4ets a user profile given the user0s )D

Paraeters:

user)D/ The &ser )D of the profile to retrieve

!eturns:

The re(uested user profile

"#ceptions:

 5o*uch&ser!ception/ )f the user)D did not represent an e!isting profile

UserProfile[] getllUserProfiles();

Description:

4ets all user profiles

!eturns:

Page 6: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 6/13

Page 7: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 7/13

Page 8: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 8/13

Page 9: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 9/13

*tores a given message in the specified user0s mailbo! Also sets their

has5ew.ail flag

Paraeters:

user)D/ The user)D who is the recipient of the message being stored

message/ The message being stored

"#ceptions: 5o*uch&ser!ception/ )f the given user does not e!ist

.ailbo!Full!ception/ )f the mailbo! of the recipient is full

!oole"n h"sNew."il(UserID userID) throws

NoSuchUserException;

Description:

Determines if a given user0s has5ew.ail flag is set

Paraeters:

user)D/ The user)D of the user being checed for new mail"#ceptions:

 5o*uch&ser!ception/ )f the given user does not e!ist

.ess"ge get.ess"ge(UserID userID+ int #ess"geNu#!er)

throws NoSuchUserException+

.ess"geNu#!er'ut'f-oundsException;

Description:

4ets a user message given a user )D and a message number #lears theirhas5ew.ail flag

Paraeters:

user)D/ &ser )D of the user whose message is being retrievedmessage5umber/ The inde! number of the message being retrieved .ust be

 between : and ;<, inclusive

!eturns:

The message, if it e!ists, or null  if the user e!ists but the user has stored no

message in the given message number0s slot

"#ceptions:

 5o*uch&ser!ception/ )f the given user does not e!ist.essage5umber9ut9f7ounds!ception/ )f the message number is out of the :-

;< bound

.ess"ge[] getll.ess"ges(UserID userID) throws

NoSuchUserException;

Description:

4ets all of a user0s messages given a user )D #lears their has5ew.ail flag

Paraeters:

Page 10: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 10/13

user)D/ &ser )D of the user whose messages are being retrieved

!eturns:

The set of messages, if any e!ist, or an empty array if the user e!ists but the userhas stored no messages

"#ceptions:

 5o*uch&ser!ception/ )f the given user does not e!ist

void re#ove.ess"ge(UserID userID+ int #ess"geNu#!er)

throws NoSuchUserException+

.ess"geNu#!er'ut'f-oundsException;

Description:

'emoves a message given a user )D and a message number )f there is nomessage at that message number, this function does nothing

Paraeters:

user)D/ &ser )D of the user whose message is being removedmessage5umber/ The inde! number of the message being removed

"#ceptions:

 5o*uch&ser!ception/ )f the given user does not e!ist

.essage5umber9ut9f7ounds!ception/ )f the message number is out of the :-;< bound

Module AD(s

&ser)D/ *ee "rofiles .odule

.ess"ge%

UserID senderID;

D"te d"teSent;

String text;

,

2.* ADMI'IS(RA(OR MODULE

The description of the administrator module has been left out in this design

e!ample

Page 11: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 11/13

*. User Client Design

User Client Module

ur!ose

The purpose of this module is to provide the user interface and view functions for

the system This is the software with which the user directly interacts )tcommunicates with the server to retrieve and modify persistent data when

necessary

Rationale

This module is created to provide the user interface to the system

"ig#$Level Module Design

The user client is broen down into lower-level modules, as shown in Figure =-1

&ser #lient

'e(uired )nterface

"rovided )nterface

#ommunications

.odule

'e(uired )nterface

"rovided )nterface

&) .odule

'e(uired )nterface

"rovided )nterface

Figure $-1:

High-Level User

%lient Architecture

Page 12: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 12/13

rovided Inter&ace

This module has no provided interfaces

Re%uired Inter&ace

The re(uired interface of this module is the same as the re(uired interface of the#ommunications module see section $%2

*.1 UI ModuleThe description of this module is not discussed in this design e!ample

*.2 Communications Module

ur!ose

The purpose of this module is to provide communication services between the

user client of the system and the server This module represents the part of thecommunications lin that resides on the user client

Rationale

This module is created to centrali+e and encapsulate networ communication

duties between the user client and the server

Re%uired Inter&aceThis module0s re(uired interface is the same as its provided interface, but it maes

calls to the server0s communication module via an implementation-dependentnetwor protocol

UserProfile getUserProfile(UserID userID) throws

NoSuchUserException;

!oole"n userExists(UserID userID);

void logoff(UserID userID) throws NoSuchUserException+

UserNot/ogged'nException;

void putUserProfile(UserProfile p);

void re#oveUserProfile(UserID userID) throws

NoSuchUserException;

void put.ess"ge(UserID userID+ .ess"ge #ess"ge) throws

NoSuchUserException+ ."il!ox0ullException;

.ess"ge get.ess"ge(UserID userID+ int #ess"geNu#!er)

throws NoSuchUserException+

.ess"geNu#!er'ut'f-oundsException;

Page 13: Module Interface Desc

8/9/2019 Module Interface Desc

http://slidepdf.com/reader/full/module-interface-desc 13/13

.ess"ge[] getll.ess"ges(UserID userID) throws

NoSuchUserException;

void re#ove.ess"ge(UserID userID+ int #ess"geNu#!er)

throws NoSuchUserException+

.ess"geNu#!er'ut'f-oundsException;

rovided Inter&ace

The provided interface of this module is the same as the re(uired interface of the&) module