CS 4233: Object Oriented Analysis and Design 9-Jan-2003 Lecture 1
January Lecture 12 Outline Previous Business none Course Introduction Mini-design Example
January Lecture 13 Course Introduction CS 4233: Object-oriented Analysis & Design Prof. Heineman FL Office hours Tuesday 10:00 – 11:00 AM Thursday 5:00 – 6:00 PM my.wpi.edu web site available
January Lecture 14 Course Structure Core of five design assignments (50%) Midterm exam, Friday January 31 st (20%) Final exam, Thursday February 27 th (20%) Class participation (10%) as evidenced by questions/answers in class, visits to office hours, communication on my.wpi.edu
January Lecture 15 Course Goals Understand, develop, and critique UML models Utilize use cases to identify and describe requirements and specifications of a software system Generate a detailed design document for a software system Understand the use of design patterns within complex designs Describe and illustrate the use of design patterns
January Lecture 16 Course Focus Lay a foundation for OO design too much OO programming is done without first focusing on the design Educate in best practices of OO design hands-on experience Challenge you Seven weeks of thinking design
January Lecture 17 Basic Terms (from TAOO) Object – an abstraction of a physical entity or conceptual thing Class – the abstract descriptor of a set of object instances How are classes defined? Through analysis. Class Data Operations
January Lecture 18 OO Requirements Analysis (RA) Identify objects that are necessary for the context of a desired software application Typically precedes OO Design (OOD) OORA specifies externally visible characteristics of a system OOD specifies internal structure of system
January Lecture 19 Design Example Client makes the following request: I want to keep a linked list of the books in my collection. There are several categories of books, including Science Fiction, Fantasy, Fiction, NonFiction, Literature, and Reference. I frequently buy and sell books, and need monthly reports of my collection broken down by category.
January Lecture 110 Requirements Analysis > I want to keep a linked list of the books in my collection. There are several categories of books, including Science Fiction, Fantasy, Fiction, NonFiction, Literature, and Reference. I frequently buy and sell books, and need monthly reports of my collection broken down by category.
January Lecture 111 Analysis Model V0 Book title : String author: String isFantasy : Boolean isLiterature: Boolean nextFantasy : Book nextLiterature : Book … Critique RoadMap 1.Summarize the design 2.Identify the design decisions 3.Explain correct decisions 4.Critique flawed decisions Book 1 1 nextFantasy nextLiterature
January Lecture 112 Analysis Model V1 Collection fantasyBooks : Book literatureBooks : Book nonFictionBooks : Book … Collection 1 Book title : String author: String next: Book … Book *
January Lecture 113 Analysis Model V2 Collection categories : Category[*] … addCategory (Category c) Category getCategory(s) Collection 1 Book title : String author: String next: Book … Category * Book 1* Category type : String books : Book … addBook (b)
January Lecture 114 Why doesn’t the JDK have… Some Basic classes? Person User Book Why do its classes seem ‘too much’ Currency (JDK 1.4 only) Collection [not a class but an interface] String [11 constructors (2 deprecated), 55 methods (1 deprecated)]
January Lecture 115 public String toLowerCase(Locale locale) { int len = count; int off = offset; char[] val = value; int firstUpper; /* Now check if there are any characters that need to be changed. */ scan: { for (firstUpper = 0 ; firstUpper < len ; firstUpper++) { char c = value[off+firstUpper]; if (c != Character.toLowerCase(c)) {break scan;} } return this; } char[] result = new char[count]; /* Just copy the first few lowerCase characters. */ System.arraycopy(val, off, result, 0, firstUpper); if (locale.getLanguage().equals("tr")) { // special loop for Turkey for (int i = firstUpper; i < len; ++i) { char ch = val[off+i]; if (ch == 'I') { result[i] = '\u0131'; // dotless small i continue; } if (ch == '\u0130') { // dotted I result[i] = 'i'; // dotted i continue; } result[i] = Character.toLowerCase(ch); } } else { // normal, fast loop for (int i = firstUpper; i < len; ++i) { result[i] = Character.toLowerCase(val[off+i]); } return new String(0, result.length, result); }
January Lecture 116 Friday Assignments Read TAOO: Chapter 1 Complete Constructor Challenge Quiz Do exercise 1-2
January Lecture 117 References JDK online documentation.documentation Currency IMF special Basket,IMF special Basket