Case Study: Designing A Telephone Directory Program Ellen Walker CPSC 201 Data Structures Hiram College Includes figures from Objects, Abstraction & Data.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

EasyGUI “Probably the Easiest GUI in the world”. Assumptions (Teachers’ Notes) This resources sets out an introduction to using easyGUI and Python
Chapter 8 Improving the User Interface
P1PMF Split1 QBASIC. P1PMF Split2QBasic Command Prompt Will launch the emulator DOS operating system? Press Alt + Enter to display the widescreen.
Cmp Sci 187: Introduction to Software Design Following Chapter 1 of text (Koffmann and Wolfgang)
1 The Software Challenge People may come and go, but software may remain A software product is often expected to be used for an extended period of time.
Software Design. The Software Challenge In industry, a software product is expected to be used for an extended period of time by someone who did not write.
ITEC200 Week01 Introduction to Software Design.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Fall 2007CS 225 Introduction to Software Design Chapter 1.
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Chapter 7 Improving the User Interface
1 Lab Session-7 CSIT-121 Fall Introducing Structured Choice 4 The do~While Loop 4 Lab Exercises.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
Spring 2009CS 225 Introduction to Software Design Chapter 1.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Python programs How can I run a program? Input and output.
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Introduction To PHP 20 * Introducing the basics of programming * Discovering variables, loops, arrays and conditions * Integrating HTML and PHP Stations.
System software operating system 1.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Database Programming in Java Corresponds with Chapter 32, 33.
Lesson 7: Improving the User Interface
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Component-Based Software Engineering Using Interfaces Paul Krause.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
Java Programming, Second Edition Chapter Five Input and Selection.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Linux Operations and Administration
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Six The Do Loop and List Boxes.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Flowcharts and Algorithms. Review of Terms  A computer is a machine that can represent and manipulate data –Ultimately the data and the instructions.
Lists and the Collection Interface Chapter 4. 2 The List Interface and ArrayList Class So far, all we have is an array for storing a collection of elements.
Pseudocode Algorithms Using Sequence, Selection, and Repetition Simple Program Design Third Edition A Step-by-Step Approach 6.
Producing a high-impact web experience by integrate Macromedia Flash and ASP By Katie Tuttle CS 330: Internet Architecture and Programming Project.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Define and describe operating systems which contain a Command Line Interface (CLI) Define and describe operating systems which contain a Graphical User.
PROPOSAL : The Use of Voice Command in Operating Personal Computer By : COLLEGE OF ART & SCIENCE UNIVERSITI UTARA MALAYSIA STIW5023 ADVANCED PROGRAMMING.
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
2016 N5 Prelim Revision. HTML Absolute/Relative addressing in HTML.
11. EXCEPTION HANDLING Rocky K. C. Chang October 18, 2015 (Adapted from John Zelle’s slides)
Creating Animations, Working with Graphics, and Accessing Data Lesson 9.
Chapter 15 Strings as Character Arrays
1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Object-Oriented Application Development Using VB.NET 1 Chapter 11 Using Multiple Forms with Problem Domain Classes.
Sets and Maps Chapter 9. Chapter Objectives  To understand the Java Map and Set interfaces and how to use them  To learn about hash coding and its use.
CPSC 233 Tutorial 5 February 2 th /3 th, Java Loop Statements A portion of a program that repeats a statement or a group of statements is called.
Subroutines (PrArith, Math,projCP1, PrAdrProc, PrAdrProcFunc) Please use speaker notes for additional information!
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Web Database Programming Using PHP
Introduction to Software Design
Topics Graphical User Interfaces Using the tkinter Module
SQL and SQL*Plus Interaction
Web Database Programming Using PHP
Core workflows Every phase has an iteration.
Chapter 13: File Input and Output
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
Using SQL*Plus.
Presentation transcript:

Case Study: Designing A Telephone Directory Program Ellen Walker CPSC 201 Data Structures Hiram College Includes figures from Objects, Abstraction & Data Structures in Java v. 5.0, by Koffman & Wolfgang, Wiley © 2005

The Problem Client wants to store a simple telephone directory in her computer Use for storage & retrieval of names & numbers Create from existing data file Insert new names & numbers Change numbers Retrieve numbers Save in data file

Requirements: Inputs & Outputs Inputs –File: one name & number per line –Interactive: name & number when requested Outputs –Name(s) & number(s) - one per line –File: complete directory in sequence (same format as input file)

Analysis Use Case –List user actions and system responses for a particular subproblem (case) as they occur For the Phone Directory 1.Read directory from existing file 2.Insert new entry 3.Edit existing entry 4.Retrieve and display entry

Read Directory From File 1. User issues command to load & run directory 2. System starts program, initializing directory from data file. If the data file does not exist, an initially empty data file is created.

Insert New Entry / Edit Entry 1.User issues insert or edit command 2.System prompts for name 3.User enters name (If canceled, terminate) 4.System prompts for number 5.User enters number (If canceled, terminate) 6.Directory is updated with new name/number (user is informed whether new entry is added or entry was changed; if changed both old and new numbers are shown)

Retrieve Entry

Initial Design (subproblems)

Class Diagram (initial)

Class Diagram (Revised)

loadData() addOrChangeEntry() lookupEntry() … > PhoneDirectoryInterface + loadData() + addOrChangeEntry() +lookupEntry() … ArrayListsBasedPD - String name - String number + getName() + getNumber() … DirectoryEntry processCommands() > PDUserInterface PDGUI PDConsole + main() PDApplication

List of Classes PDUserInterface - interacts with the user PDApplication - contains main, instantiates everything else PhoneDirectoryInterface - the interface for a phone directory ArrayListBasedPD - an implementation of that interface DirectoryEntry - a name/number pair

PDApplication One Method, main –Create a new PhoneDirectory object –Send it a message to read the initial directory data from a file –Create a new PDUserInterface Object –Send it a message to perform all user operations on the PhoneDirectory object This method will set up a loop that accepts and executes commands (using internal methods)

DirectoryEntry Class

PhoneDirectory Interface

ArrayBased PD implements PhoneDirectory

Class structure

Implementing and Testing the Array- Based Phone Directory

Implementing and Testing the Array- Based Phone Directory (continued) Note that some code in this application is controversial –Combination of assignment with the evaluation of a condition –Break statement allows exiting of the while loop without storing an entry

Controversial Code

Implementations of PDUserInterface PDGUI (graphical) PDConsoleUI (text-based)