CIS-260 Home http://www.c-jump.com/bcc/

Designing with Objects


  1. Designing with Objects
  2. More challenges
  3. Complexity
  4. Design aims and means
  5. Successful software
  6. Other difficult aspects
  7. People
  8. Formal design
  9. The development cycle
  10. About universality
  11. Overall aims of a design
  12. Design steps
  13. System components
  14. Typical design steps
  15. Finding classes
  16. CRC: Class Responsibility Collaboration cards
  17. Object Oriented Analysis using CRC cards
  18. CRC modeling activity outline
  19. Expert users and vocabulary
  20. Requirements for Summary Statement
  21. CRC session
  22. Activity 1: Discovering Classes
  23. Discovering Classes, Second Iteration
  24. Activity 2: Using CRC Cards to define class responsibilities
  25. Activity 3: Identify Collaborations between classes
  26. Optional info about subclasses and superclasses
  27. Generalization, Classification, Inheritance
  28. Use cases
  29. Use case coverage
  30. Primary and secondary use cases
  31. Realistic planning
  32. System architecture
  33. Specifying the operations
  34. Strategy of finding operations
  35. Choosing operations
  36. Refine the classes by specifying dependencies
  37. Specifying the interfaces
  38. Reorganization of class hierarchies
  39. Design patterns
  40. Experimentation
  41. CRC Cards Example
  42. Example 2: Designing the objects for Automatic Banking Machine
  43. Example 2: Transactions
  44. Example 2: Remote Database
  45. Example 2: Events
  46. Example 2: Screen objects

1. Designing with Objects


2. More challenges


3. Complexity


4. Design aims and means


5. Successful software


6. Other difficult aspects


7. People


8. Formal design


9. The development cycle


  1. Examine the problem.

  2. Create an overall design.

  3. Find standard components.

  4. Create new standard components.

  5. Assemble the design.

     

10. About universality


11. Overall aims of a design


12. Design steps


13. System components


14. Typical design steps


  1. Find the concepts/classes and their most fundamental relationships.

  2. Refine the classes by specifying the sets of operations on them.

  3. Refine the classes by specifying their dependencies.

  4. Specify the interfaces.

15. Finding classes


16. CRC: Class Responsibility Collaboration cards


  • Similar to standard index cards

  • Each card contains:

    • Responsibilities

      • (eventually to become a list of operations and behaviors.)

    • Collaborations

      • (eventually to become a list of use cases.)

    • Optional class attributes

      • (This is a low priority list, since attributes are part of implementation.)

    CRC card

17. Object Oriented Analysis using CRC cards


  • What does a CRC card represent?

    • Individual CRC Cards are used to represent objects.

     

  • What is an object ?

    • Something you can do things to: a cell phone, a TV set, a printer, and so on.

     

  • What is a class?

    • A set of objects that share common structure and common behavior.

    CRC card

18. CRC modeling activity outline


19. Expert users and vocabulary


20. Requirements for Summary Statement


21. CRC session


  • A CRC session proceeds with

    • someone simulating the system by talking about which objects send messages to other objects.

  • Weaknesses, problems, and gaps in requirements are easily uncovered.

    collaborations

22. Activity 1: Discovering Classes


  • Use blank CRC cards to identify classes during group scenario execution

  • Use application domain vocabulary:

    • Nouns are good candidates for potential objects.

  • Begin by highlighting nouns in requirements doc.

  • Create some cards.

  • Start with only one or two obvious cards,

    • continue using what-if approach.

    collaborations

23. Discovering Classes, Second Iteration


  • Examine the list of classes.

  • Eliminate duplicates. For example:

    • Users

    • User

    • Customer

    could be the same class.

  • Add missing classes.

  • If one of the objects becomes too cluttered, consider

    • making hierarchy of objects (generalization)

    • splitting a concept into smaller multiple objects.

    collaborations

24. Activity 2: Using CRC Cards to define class responsibilities


  • Steps to execute scenario walk-through:

    • The steps are based on the system requirements document.

    • Distribute existing CRC cards to participants of the group.

    • Use application domain vocabulary:

      • Verbs show what responsibilities each class might have.

    • Record responsibilities.

    collaborations

25. Activity 3: Identify Collaborations between classes


  • Collaborations describe interaction among objects and realize a use case.

  • A collaboration between two objects indicates how objects send or receive messages to satisfy their responsibilities.

    collaborations

26. Optional info about subclasses and superclasses


  • Optionally, consider recording the information about

    • Subclasses - classes that inherit from one or more classes.

    • Superclasses - classes from which another class inherits.

    collaborations

27. Generalization, Classification, Inheritance


28. Use cases


29. Use case coverage


30. Primary and secondary use cases


31. Realistic planning


32. System architecture


33. Specifying the operations


34. Strategy of finding operations


  1. Consider how an object of the class is to be constructed, copied (if at all), and destroyed.

  2. Define the minimal set of operations required by the concept the class is representing.

  3. Consider which operations could be added for notational convenience.

  4. Consider which operations are to be virtual, that is, operations for which the class can act as an interface for an implementation supplied by a derived class.

  5. Consider what commonality of naming and functionality can be achieved across all the classes of the component.

35. Choosing operations


36. Refine the classes by specifying dependencies


37. Specifying the interfaces


38. Reorganization of class hierarchies


39. Design patterns


40. Experimentation


41. CRC Cards Example


  • CRC-cards describing the responsibilities and collaborations of Smalltalk's Model, View and Controller.

  • View and Controller are overlapping, implying close collaboration.

  • View and Controller are placed above the Model, since the Model does not initiate any collaborations.

  • Arrangement of cards often reflects how abstract concepts bubble up to the top of the design.

    CRC card

42. Example 2: Designing the objects for Automatic Banking Machine


  • Why ATM example?

    • Because of everyone's familiarity with the application and ATM user interface.

  • Account and Transaction provide the banking model.

  • Note that Transaction assumes an active role while money is being dispensed and a passive role thereafter.

    Automatic Banking Machine

43. Example 2: Transactions


  • Transactions meet their responsibilities with the aid of several objects that serve as device drivers.

  • The Dispenser object, for example, ultimately operates the dispensing device.

  • The CardReader object reads and decodes the information on the bank card's magnetic strip.

  • A common mistake would be to itemize all of the information stored on the bank card.

  • Card encoding formats must certainly be well thought out and documented.

  • However, for the purpose of designing the objects, we need only identify where that knowledge will be placed in the program.

    Transactions

44. Example 2: Remote Database


  • The RemoteDataBase drives the communication lines and interprets data transmitted across them.

  • It creates Account objects and consumes Transaction objects.

  • The device drivers signal exceptional or asynchronous events by adding Event objects to a shared queue.

    Remote Database

45. Example 2: Events


  • Events drive the human interface by triggering Actions that sequence through Screens.

  • The actual format and sequence of screens will be determined by the user-interface design and will probably vary from bank to bank.

  • We offer objects from which state-machine like interfaces can be built.

    Events

46. Example 2: Screen objects


  • Screen objects correspond to the states and Action objects correspond to the transitions.

  • Screens may vary in how they dispatch Actions.

  • Actions themselves will vary in how they process events.

  • Actions ultimately construct Transactions to which they delegate the further operating of the bank machine.

    Screen objects