CS 46B: Introduction to Data Structures June 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.

Slides:



Advertisements
Similar presentations
Systems Analysis and Design 8th Edition
Advertisements

 Instructor Rob Nash  Final this Wednesday.  See the message board topic lists.
Introduction To System Analysis and Design
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
COMS S1007 Object-Oriented Programming and Design in Java August 7, 2007.
Final Overview Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
Introduction To System Analysis and design
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
CS 46B: Introduction to Data Structures July 7 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
CS 160: Software Engineering October 8 Class Meeting
CS 46B: Introduction to Data Structures June 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
CS 46B: Introduction to Data Structures June 25 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
2/9/98 Thomas O’Reilly 1 A Quick UML Introduction.
ICS 102 Computer Programming University of Hail College of Computer Science & Engineering Computer Science and Software Engineering Department.
11 Partnership for Performance How to hear this lecture Click on the icon: to hear the narration for each slide.
CS 46B: Introduction to Data Structures July 9 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
CS 235: User Interface Design September 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Systems Analysis & Design 7 th Edition Chapter 5.
Chapter 7 Software Engineering Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
CS 151: Object-Oriented Design September 26 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
CS 153: Concepts of Compiler Design September 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
CS 151: Object-Oriented Design September 5 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak
CS 151: Object-Oriented Design September 12 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 151: Object-Oriented Design August 27 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CSCI-383 Object-Oriented Programming & Design Lecture 10.
CS 46B: Introduction to Data Structures June 9 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 1: Introduction Data.
CS 160: Software Engineering December 10 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 151: Object-Oriented Design September 10 Class Meeting
CS 46B: Introduction to Data Structures June 30 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
CS 235: User Interface Design March 17 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CS 46B: Introduction to Data Structures July 23 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
CS 160 and CMPE/SE 131 Software Engineering February 25 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Engr 691 Special Topics in Engineering Science Software Architecture Spring Semester 2004 Lecture Notes.
CMPE 280 Web UI Design and Development August 29 Class Meeting
Analysis and Comparison is ICS4U
CS 153: Concepts of Compiler Design August 29 Class Meeting
Interface, Subclass, and Abstract Class Review
CMPE 135: Object-Oriented Analysis and Design September 12 Class Meeting Department of Computer Engineering San Jose State University Fall 2017 Instructor:
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
FINAL EXAM INFORMATION
FINAL EXAM INFORMATION
CMPE 152: Compiler Design September 13 Class Meeting
CMPE 152: Compiler Design August 23 Class Meeting
CMPE 135: Object-Oriented Analysis and Design September 6 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
Review CSE116 2/21/2019 B.Ramamurthy.
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
CMPE 152: Compiler Design January 29 Class Meeting
CMPE 152: Compiler Design February 7 Class Meeting
Chapter 5.
Final Review B.Ramamurthy 5/8/2019 BR.
CMPE 135 Object-Oriented Analysis and Design March 7 Class Meeting
ITEC324 Principle of CS III
CS 151: Object-Oriented Design October 8 Class Meeting
ITEC324 Principle of CS III
CMPE 152: Compiler Design August 27 Class Meeting
Presentation transcript:

CS 46B: Introduction to Data Structures June 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 2 Application Development Big Picture

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 3 Iterative Development

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 4 Incremental Development  Each iteration adds functionality to code that already works.  No Big Bang! Start Goal Head First Object-Oriented Analysis & Design by Brett McLaughlin & Gary Pollice O’Reilly, 2006.

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 5  A picture is worth a thousand words!  It is much easier to extract information from a graphical notation than reading a textual document.  Show your design in graphical UML diagrams. UML: Unified Modeling Language  There are several different types of UML diagrams. We’ll use simple class diagrams for now. UML Diagrams

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 6  A class diagram can have up to three compartments: UML Class Diagram Class Name Attributes : types Methods(parms : types) : return type

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 7 Example UML Class Diagram Mailbox newMessages : ArrayList savedMessages : ArrayList add(msg : Message) : boolean getCurrentMessage() : Message For now, our simple class diagrams will only show the class names. We won’t show attributes and methods yet. Example:

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 8  Relationships among classes using arrows. UML Class Diagram: Relationships Dependency Aggregation Inheritance Composition Association Direct association Interface implementation

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 9 UML Class Diagram: Inheritance  An “is a” relationship  Use an open triangle at the superclass.  Example A dog is a mammal A dog is a mammal Mammal Dog

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 10  Multiplicity in a “has a” relationship. UML Class Diagram: Multiplicities SignMeaning *Zero or more 1..*One or more 0..1Zero or one 1Exactly one

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 11 UML Class Diagram: Aggregation  A “has a” relationship.  The contained object can have an existence independent of its container.  Example A mailbox has a set of messages. A mailbox has a set of messages. A message can exist without a mailbox. A message can exist without a mailbox. Therefore, a mailbox aggregates messages. Therefore, a mailbox aggregates messages. Mailbox Message 1 *

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 12 UML Class Diagram: Composition  A “has a” relationship.  The contained object cannot (logically) have an existence independent of its container.  Example A mailbox has a message queue. A mailbox has a message queue. The message queue cannot (logically) exist without a mailbox. The message queue cannot (logically) exist without a mailbox. Therefore, a mailbox composes a message queue. Therefore, a mailbox composes a message queue. Mailbox MessageQueue 11

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 13 UML Class Diagram: Interface Implementation  An “is a” relationship  Use an open triangle at the interface and a dashed line.  Example A dog is a biter A dog is a biter > Biter > Biter Dog

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 14 No Surprises!  Good software design has few, if any, surprises.  Surprises can lead to serious programming errors.

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 15 How Good is Your Class Design?  Who is the user of a class that you write? Other programmers Perhaps you yourself, later!  Class designer priorities Efficient algorithm Convenient coding etc.  Class user priorities Easy to use Don’t have to understand the implementation etc.

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 16 How Good is Your Class Design?  Is there a “conflict of interest” if you’re both the class designer and the class user?  Can you make the right engineering tradeoffs?

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 17 In-Class Exercise: UML Class Diagram  Draw UML class diagrams that capture all of these facts: A university has several departments. Each department has a department chair. Each department teaches several courses. Two of the departments are computer science (CS) and computer engineering (CMPE). The computer science department teaches the courses CS 101, CS 102, and CS 103. The computer engineering department teaches the courses CMPE 101 and CMPE 102. CS 102, CS 103, and CMPE 102 are also online. Each course has a professor, a number of students, and possibly a graduate student T.A. People have home addresses. No attributes or methods are required in these diagrams.

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak 18 An Exercise Solution University Address Chair «interface» Graduate Person CS 101 CS 102 CS 103 CMPE 101 CMPE 102 Computer Engineering Computer Science Department 1..n Course 1..n Student Professor 1..n TA 0..1 «interface» Online

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Break 19

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Quick Review for the Midterm  Midterm #1 next Tuesday, June 23.  Closed book and laptop.  It will include all topics we’ve covered so far. Chapter readings Lectures Homework  Written exam (old fashioned pen and paper) Short answer Program snippets 20

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Quick Review for the Midterm, cont’d  Classes superclass, subclass, inheritance, polymorphism type casts and instanceof  Object class toString() and equals() methods 21

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Quick Review for the Midterm, cont’d  Interfaces why? Comparable interface interface constants marker interfaces  Scanner class hasNext(), next() hasNextLine(), nextLine() hasNextInt(), nextInt() useDelimiter() 22

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Quick Review for the Midterm, cont’d  PrintWriter class  I/O errors FileNotFoundException  Exception handling checked and unchecked exceptions try-catch statement throwing an exception custom exception classes finally clause 23

Computer Science Dept. Summer 2015: June 18 CS 46B: Introduction to Data Structures © R. Mak Quick Review for the Midterm, cont’d  Object-oriented design what makes software good iterative and incremental development sources and classification of classes CRC technique dependency and aggregation UML class diagrams 24