Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-oriented design IS 313 4.3.2003. Outline  CRC cards  Group activity.

Similar presentations


Presentation on theme: "Object-oriented design IS 313 4.3.2003. Outline  CRC cards  Group activity."— Presentation transcript:

1 Object-oriented design IS 313 4.3.2003

2 Outline  CRC cards  Group activity

3 Program Design  Design is hard “wicked problem”  Not just functional goals extensibility maintainability adaptability economics

4 OO Design  Adds more complexity  Goal is not just a problem solution  A set of objects that jointly solve the problem, and that represent the problem domain

5 Identifying Classes  What are the “things” that the program is about?  Often good candidates are nouns in the problem description

6 Identifying Responsibilities  Classes have responsibilities  Primary Keeping track of data Usually means storing in an instance variable  Think of this as an object’s “state”

7 Other Responsibilities  Creating objects  Invoking methods of other objects  Gather data  Transmit data

8 Example  Member name member id # miles benefit level others?

9 Collaborations  What other classes work with a given class  Consequences instances of class A need to call method foo on an instance of class B instance variable to reference such an instance this variable must be set somewhere

10 Holism  These considerations are holistic we have to think about the whole design  Need an overview of the class structure

11 CRC Cards  Class-Responsibilities-Collaborations  Deliberately low-tech  One class per card

12 Exercise  Design a system for an airline frequent flyer program


Download ppt "Object-oriented design IS 313 4.3.2003. Outline  CRC cards  Group activity."

Similar presentations


Ads by Google