Project Design

profilelvlupnow
group_7_project_design_v7.0_reference2.docx

Group 7 Project Design

Project Design- Group 7

Version: 5.0

By:

Terry Coughlin

Justin Dillinger

Joshua Zink

Ferdinand Landry

University of Maryland University College

CMIS 495

Revision History

Revision number

Date

Description

Name

1.0

June 24

Add traces for scenario 1, 2, and 3.

Justin Dillinger

2.0

June 25

Add Startup and shutdown trace

Added Pseudocode for Event, Event Manager, Wish List, and List

Ferdinand Landry

Terry Coughlin

3.0

June 26

Added Pseudocode for remaining subsystems

Terry Coughlin

4.0

June 26

Add traces for scenario 4, and 5

Ferdinand Landry

5.0

June 27

Add error trace 1, 2, and 3. Add scenario 6 trace

Ferdinand Landry

6.0

June 27

Combined both Event Trace Diagrams and Pseudocode. Formatted newly formed document. Added Risk section

Joshua Zink

7.0

June 28

Removed coding for Trace Diagram. Improved formatting.

Joshua Zink

Section 1: Class Diagram

(pending)

Section 2: Event Trace Diagrams

Startup

Shutdown

Scenario 1: Logging in and creating an event with a date and wish list assigned to the specific date:

Scenario 2: Managing Current Wish List:

Scenario 3: Creating New Wish List:

Scenario 4: Update e-mail address

Scenario 5: Notify user of special event

Scenario 6: Display events list:

Error scenario 1: User tries to display an empty events list :

Error scenario 2: User tries to display an empty wish list :

Error scenario 3: Return user’s profile file is not in specified directory:

Section 3: Pseudocode

A) App System

B) Display System

C) Event System

D) Event Manager System

E) List System

F) Notification System

G) Profile System

H) Wish List System

A) App System:

Class App

{

Display display;

EventManager manager;

Notification notifier;

Profile profile;

WishList wishlist;

String profileFile = "user.txt";

String eventFile = "events.txt";

String listDir = "\wishlists\"

String curDir; // Current working directory

String userEmail;

void Main()

{

curDir = System.GetWorkingDirectory()

profile = new Profile(profileFile);

manager = new EventManager(eventFile);

wishlist = new WishList(curDir + listDir);

notifier = Notification();

profile.startUp()

userEmail = profile.getEmail();

if(userEmail == null)

{

New JFrame Notification - Get Email Address;

userEmail = Read Email from JFrame;

profile.newProfile(userEmail);

}

display = new Display(profile, manager, wishlist);

manager.startUp();

wishlist.startUp();

notifier.startUp(manager.getNotifyEvents, userEmail);

display.startUp();

}

}


B) Display System:

Class Display
{
	Profile profile;
	EventManager manager;
	WishList wishlist;
	
	String userEmail;
	Display(Profile profile, EventManager manager, WishList wishlist)
	{
		this.profile = profile;
		this.manager = manager;
		this.wishlist = wishlist;
	}
	
	void startUp()
	{
		userEmail = profile.getEmail();
		mainGUI();
	}
	
	void mainGUI()
	{
		Create Main Window;
		{
			new titledJPane("Upcoming")
			{
				populate JPane with manager.getUpcomingEvents();
			}
			
			new JPane
			{
				Populate with userEmail;
				populate with Button("Change Email");
				populate with Button("Add Event");
				populate with Button("Manage Wish Lists");
			}
			
		}
		
		new ButtonClick("Change Email")
		{
			profileGUI();
		}
		
		new ButtonClick("Add Event")
		{
			eventGUI();
		}
		
		new ButtonClick("Manage Wish Lists")
		{
			wishlistGUI();
		}
			
	}
	
	void profileGUI()
	{
		Create Profile Window;
		{
			new JPane
			{
				Populate with userEmail;
				populate with Label("New Email");
				newEmail = populate with TextBox();
				populate with Label("Confirm Event");
				confirmEmail = populate with TextBox();
				populate with Button("Submit");
			}
			
		}
		
		new ButtonClick("Submit")
		{
			if(newEmail == confirmEmail)
			{
				profile.newProfile(newEmail);
			}
			else
			{
				new WarningBox("Emails Do Not Match");
			}
		}
		
	}
	
	void eventGUI()
	{
		Create Event Window
		{
			new titledJPane("Calendar")
			{
				date = populate JPane with Calendar;
			}
			
			new JPane
			{
				populate with Label("Person's Name: ");
				name = populate with TextBox();
				populate with Label("Event: ");
				event = Populate with DropDown("BirthDay, Anniversary, Mother's Day, Father's Day, Other");
				custom = populate with TextBox();
				populate with Label("Notify me in ");
				range = populate with TextBox();
				populate with Label("day(s)");
				populate with Button("Manage Wish Lists");
			}
			
			new JPane
			{
				populate with Button("Create/Edit Wish List");
				populate with Button("Save Event");
			}
			
			new ButtonClick("Save Event")
			{
				if(event == other)
				{
					event = custom;
				}
			
				manager.newEvent(date, range, name, event);
			}
			
			new ButtonClick("Create/Edit Wish List")
			{
				wishlist.newList(name);
				wishlistEditListGUI(name);
			}
			
			
		}
		
	}
	
	void wishlistMainGUI()
	{
		Create Main Window
		{
			new titledJPane("Available Lists")
			{
				workingList = populate with wishlist.getLists
			}
			
			new JPane
			{
				populate with Button("Edit List");
				populate with Button("Create New List");
			}
		}
		
		new ButtonClick("Edit List")
		{
			wishlistEditListGUI(workingList);
		}
		
		new ButtonClick("Create New List")
		{
			wishlistNewListGUI();
		}
		
	}
	
	void wishlistNewListGUI()
	{
		Create Main Window
		{
			populate with Label("Person's Name: ");
			name = populate with TextBox();
			populate with Button("Continue");
		}
		
		new ButtonClick("Continue")
		{
			wishlist.newList(name);
			wishlistEditListGUI(name);
		}
	}
	
	void wishlistEditListGUI(String name)
	{
		Create Main Window
		{
			new titledJPane("Items");
			{
				selected = populate with wishlist.getListLitems(name)
			}
			
			new JPane
			{
				new Item = populate with TextBox();
				populate with Button("Add Item");
				populate with Button("Remove Item");
			}
		}
	
		new ButtonClick("Add Item")
		{
			wishlist.addItem(name, newItem);
		}
		
		new ButtonClick("Remove Item")
		{
			wishlist.removeItem(name, selected);
		}
	}
}

C) Event:

Class Event
{
	Date date;
	int notifyRange;
	String lovedOne;
	String event;
	
	Event(Date newDate, int newRange, String newName, String eventType)
	{
		set variables;
	}
	
	String getEventString()
	{
		return date+","+notifyRange+","+lovedOne+","+event;
	}
	
	Date getDate()
	{
		return date;
	}
	
	int getRange()
	{
		return notifyRange;
	}
	
	String getPerson()
	{
		return lovedOne;
	}
	
	String getEvent()
	{
		return event;
	}
	
}

D) Event Manager System:

Class EventManager
{
	String fileName;
	Array<Event> events;
	Array<Event> upcoming;
	Array<Event> notify;
	Date currentDate; 
	int previewRange = 7;
	
	EventManager(String fileName)
	{
		this.fileName = fileName;
	}
	
	// Start up process
	void startUp()
	{
		currentDate = Get System Date;
		Initialize remaining variables;
		
		try
		{
			Check for fileName;
			if fileName not found
			{
				newEventsFile();
			}
			else
			{
				open fileName;
				while(!EOF)
				{
					String eventString = readEventLine();
					newEvent(eventString);
				}
				close fileName;
			}
		}
		catch read errors
		{
			throw errors;
		}
		
		setUpcomingEvents();
		setNotifyEvents();
	}
	
	// Create a new event, save it to the file	
	void newEvent(Date newDate, int newRange, String newName, String eventType)
	{
		Event event = new Event(Date newDate, int newRange, String newName, String eventType)
		Events.add(event);
		saveFile(new event);
	}
	
	// Create a new event, from an event string, save it to the file
	void newEvent(String eventString)
	{
		String[] str = eventString.parse();
		Event event = new Event(str[0], str[1], str[2], str[3]);
		Events.add(event);
		saveFile(new event);
	}
	
	// Save the file
	void saveFile(Event newEvent )
	{
		try
		{
			open fileName;
			append newEvent.getEventString();
			close fileName
		}
		catch write errors
		{
			throw errors;
		}
	}
	
	// Create a new event file, in case there isn't one
	void newEventsFile()
	{
		try
		{
			create new event file;
		}
		catch write errors
		{
			throw errors;
		}
	}
	
	// Create the array of upcoming events
	setUpcomingEvents()
	{
		for( each event in events)
		{
			int range = event.getDate() - currentDate;
			if(range > -1 and range <= previewRange)
			{
				upcoming.add(event);
			}
		}
	}
	
	// Create the array of Notification Events
	setNotifyEvents()
	{
		for( each event in events)
		{
			int range = event.getDate() - currentDate;
			if(range > -1 and range <= event.getRange())
			{
				notify.add(event);
			}
		}
	}
	
	// Return all the notify events
	array getNotifyEvents()
	{
		return notify;
	}
	
	// Return all the upcoming events
	array getUpcomingEvents()
	{
		return upcoming;
	}
	
}

E) List:

Class List
{
	String listName;
	array items;
	
	List(String fileName)
	{
		listName = fileName;
		initialize items;
	}
	
	void addItem(String newItem)
	{
		items.add(newItem);
	}
	
	void removeItem(String item)
	{
		items.remove(item);
	}
	
	String getListName()
	{
		return listName;
	}
	
	array getItems()
	{
		return items;
	}
	
}

F) Notification System:

Class Notification
{
	Email mail; // Third party email package
	
	Notification()
	{
	
	}	
	void startUp(Array notify, String email)
	{
		for( each event in notify)
		{
			mail.CreateEmail(email);
			mail.SendEmail();
		}
	}
}

G) Profile System:

Class Profile
{
	String fileName;
	String email;
	
	Profile(String fileName)
	{
		this.fileName = fileName;
	}
	
	
	// Start up procedure 
	void startUp()
	{
		try
		{
			Check for fileName;
			if fileName not found
			{
				email = null;
			}
			else
			{
				open fileName
				email = read email from fileName;
				close file;
			}
		}
		catch read errors
		{
			throw errors;
		}
	}
	// Create a new profile
	void newProfile(String newAddress)
	{
		try
		{
			open fileName
			write newAddress to file
			close fileName
		}
		catch write errors
		{
			throw errors;
		}
	}
	
	// Return users email address
	String getEmail()
	{
		return email;
	}
}

H) Wish List System:

Class WishList
{
	String directoryName;
	Array<List> lists;
	List workingList;
	
	WishList(String directoryName)
	{
		this.directoryName = directoryName;
	}
	
	// Start up process
	void startUp()
	{
		initialize variables;
		
		try
		{
			open directoryName;
			for each fileName in directoryName
			{
				workingList = List(fileName)
				while(!EOF)
				{
					read item from file;
					workingList.addItem(item);
				}
				lists.add(workingList);
				close fileName
			}
		}
		catch read errors
		{
			throw errors;
		}
		
	}
	
	// Sets the current list to be modified
	array getWorkingList(String listName)
	{
		for ( each list in lists)
		{
			if (list.getListName() == listName)
			{
				workingList = list;
			}
		}
	}
	
	// Add a new item to the list
	void addItem(String listName, String itemName)
	{
		getWorkingList(listName);
		workingList.addItem(itemName);
		saveFile(listName);
	}
	
	// Removes an item from the list
	void removeItem(String listName, String itemName)
	{
		getWorkingList(listName);
		workingList.removeItem(itemName);
		saveFile(listName);
	}
	
	Array getListItems(String listName)
	{
		getWorkingList(listName
		return workingList.getItems();
	}
	
	// Saves the items in the list
	void saveFile(String fileName)
	{
		getWorkingList(fileName);
		
		try
		{
			open fileName;
			for(each item in workingList)
			{
				write item to file;
			}
			close fileName;
		}
		catch write errors
		{
			throw errors;
		}
	}
	
	// Creates a brand new list
	void newList(String newListName)
	{
		workingList = null;
		getWorkingList(newListName);
		if(workingList == null)
		{
			workingList =  List(newFileName);
			lists.add(workingList);
		}
	}
	
	// Returns available lists
	Array getLists()
	{
		return lists;
	}	
}

Section 4:  Unresolved Risks

Possible Risks and Risk Mitigation:

Risks were not identified in design as a result the same risks remain.

1. Alerts can be sent to the wrong e-mail address because of incorrect user input. This risk can be mitigated by requiring that the user confirm their e-mail address.

1. All files are saved to Local Host’s hard disk drive (HDD), and will be lost in the case of HDD failure. This risk can be mitigated by creating redundancy by having a secondary place to store files such as a cloud service.