lecture10

lecture10 - Wednesday, May 3 th Object Oriented Design...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Wednesday, May 3 th Object Oriented Design Midterm Review 1. Classes 2. I nheritance 3. Virtual functions, A.B.C.s 4. Class composition 5. Pointers and references 6. Dynamic memory allocation (new/ delete) 7. Linked lists (doubly linked too) 8. Copy constructors and assignment operators 9. Stacks and Queues 10. Recursion! 11. Templates and the STL Fair game on the midter m: Object-Oriented Design So, how does a computer scientist go about designing a program? Mad EE scientist How do you figure out all of the classes , methods , algorithms , etc. that you need for a program? (Well, its not easy! Many senior engineers are horrible at it!) At a high level, its best to tackle a design in two phases: First , determine the classes you need, what data they hold, and how they interact with one another. Second , determine each classs data structures and algorithms. Class Design Steps 2. Determine the outward-facing functionality of each class. How do you interact with a class? 1. Determine the classes and objects required to solve your problem. 3. Determine the data each of your classes holds and 4. How they interact with each other. An Example Often, we start with a textual specification of the problem. For instance, lets consider a spec for an electronic calendar . Each users calendar should contain appointments for that user. There are two different types of appointments, one-time appts and recurring appts. The user of the calendar must supply a password before accessing the calendar. Users of the calendar can get a list of appointments for the day, add new appointments, remove existing appointments, and check other users calendars to see if a time-slot is empty. Each appointment has a start-time and an end-time, a list of participants, and a location. Step #1: I dentify Objects Start by identifying potential classes . The easiest way to do this is identify all of the nouns in the specification! Each users calendar should contain appointments for that user. There are two different types of appointments, one-time appts and recurring appts. The user of the calendar must supply a password before accessing the calendar. Users of the calendar can get a list of appointments for the day, add new appointments, remove existing appointments, and check other users calendars to see if a time-slot is empty. Each appointment has a start-time and an end-time, a list of participants, and a location. user calendar appointments one-time appts recurring appts time-slot password start-time end-time participants location Step #1b: I dentify Objects Each users calendar should contain appointments for that user. There are two different types of appointments, one-time appts and recurring appts....
View Full Document

Page1 / 24

lecture10 - Wednesday, May 3 th Object Oriented Design...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online