Seminar 3: Making Good Progress<br />Programming Paradigms<br />[The Paradigms - Group 2]<br />
We will always use system analysis and design at the start of every software project.<br />
No approaches were taught to derived<br />
Knowing an good approach can build a robust system design.<br />
Let us learn an approach to do system analysis and design <br />
What is Object-Oriented Analysis & Design?<br />7<br />Teacher<br />Student<br />An approach that models a system as a gro...
New approach to analysis & design<br />8<br />
CRC Approach<br />9<br />
What is CRC?<br />Class, Responsibility & Collaboration<br />Discovering the real world objects is a system<br />Mapping t...
Why CRC?<br />Uses brainstorming and role-playing to maximize advantages of group work<br />
Basics of CRC approach<br />
OO Characteristics<br />13<br />
The things they do <br />Their relationship to other classes <br />
Back of the card is used list attributes and write class description<br />The things they do <br />Their relationship to o...
16<br />
QuickCRC <br />17<br />
CRC books<br />18<br />
19<br />
CRC Card<br />1. Discovering Candidate Classes<br />1. Read Requirements Documents<br />2. Clarifying the Scope<br />2. Un...
The ATM System will interface with the customer through a display screen , numeric and special input keys, a bankcard read...
The ATM System will interface with the customer through a display screen , numeric and special input keys, a bankcard read...
23<br />1. Discovering The Candidate Class List<br />Candidate Class List<br />3. Add them to candidate class list. <br />...
Customer
Display screen
Numeric
Special input keys
Bankcard reader
Deposit slot
Receipt printer
Deposits
Withdrawals
Balance inquires
Accounts
PIN
Clearance level
Security system
Transactions
Change of address
Phone number</li></li></ul><li>1. Discovering The Candidate Class List<br />4. Brainstorm to find other potential classes....
25<br />Q: How does the customer access the ATM?<br />1. Discovering The Candidate Class List<br />4. Brainstorm to find o...
1.Discovering The Candidate Class List<br />Candidate Class List<br />
27<br />CRC Card<br />1. Read Requirements Documents<br />1. Discovering Candidate Classes<br />2. Underline nouns and nou...
Clarifying System Scope<br />What is and what is not part of the system.<br />
Clarifying System Scope<br />29<br />What is the scope of the ATM system?<br />Questions<br />Does it handle everything?<b...
Clarifying System Scope<br />
31<br />Clarifying System Scope<br />The sharper the system boundaries, the easier the evaluation of candidate class list....
32<br />CRC Card<br />1. Read Requirements Documents<br />1. Discovering Candidate Classes<br />2. Underline nouns and nou...
Sort Candidate Class List <br />
Essential Classes for the application<br />4. Selecting Core Classes<br />
Class that we are NOT able to categorize without knowing the system boundaries and definition<br />4. Selecting Core Class...
Classes that are outsidethe system scope<br />Printer, ScreenSave, and Prompt.<br /> Related to the user interface subsyst...
37<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot...
What are Hot Spots?<br />A hot spot is a portion of the system that is likely to change from one system variant to another...
What are Hot Spots?<br />Hot spots encapsulatethe variable aspects within components. <br /><ul><li>Changes will only be m...
Interfaces and the relationships among components will become less prone to changes.</li></ul>Aid in designing components ...
 Identify Hot Spots<br />Identify hot spot by answering:<br /><ul><li> Which aspects of the domain differ fromapplication ...
Identify Hot Spots<br />Analysis of ATM<br />Q: Which aspects of the domain differ fromapplication to application?<br /><u...
Identify hot spots<br />Withdrawal handling is a hot spot.<br />Initially supports the dispensing of cash; future may requ...
Benefits of Hot Spots<br />
44<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot...
Design Patterns<br />A design pattern is a design structure that has been successfully used in a similar context<br />“No ...
Design Patterns<br />Pioneers have laid out the foundations<br />There exist library of patterns<br />Apply them to them t...
“System Interaction Pattern"<br />AuthorizeSystemInteraction<br />
Example<br />AuthorizeSystemInteraction<br />Encapsulate Communication between ATM and the bank existing security system <...
Example of Patterns that can be considered<br />Clients<br />Servers<br />Transactions<br />Interacting Systems<br />Inter...
Some Good Pattern Books<br />
51<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot...
Framework<br />A collection of classes that captures the architecture and basic operation of an application system. <br />...
Frameworks are "upside down libraries“.<br /> System control resides in framework code that calls "down" to user-supplied ...
Example in ATM<br />54<br />There are many papers on ATM that has been successfully built<br />These framework can also be...
Upcoming SlideShare
Loading in …5
×

Programming Paradigms - Seminar 3

468 views
395 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
468
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • If a class depends on upon other classes, to help carry out it’s responsibilities, it will have collaborators written by side the responsibilityIf a card is part of a hierarchy, it may have superclass or subclasses.
  • If a class depends on upon other classes, to help carry out it’s responsibilities, it will have collaborators written by side the responsibilityIf a card is part of a hierarchy, it may have superclass or subclasses.
  • Discovering Candidate ClassesRead Requirements DocumentsUnderline nouns and noun phrasesAdd them to candidate class listBrainstorm to find other potential classesClarifying the ScopeSelecting Core ClassesArchitectural DesignIdentify hot spotsUse appropriate design patternsTake advantage of existing software frameworksEliminate Unnecessary ClassesRemove ghost classesCombine synonyms Distinguish attributes from classes
  • Does it handle everything--Is the ATM responsible for updating accounting records? or just recording and mediating the transaction activity?
  • Limits its scope to banking information capture -- Leaving the user interface, security and actual account update to other systems.
  • Pree definition: Specialization (=adaption) takes place at points of predefined refinement that we call hot spots (Pree,1995, 1996, 1997).Predefine refinement aka the framework of the domain.
  • Hotspot also enables the reuse of the overall system architecture and common code.The Abstract classes of the framework intertwine with hotspots highlighted in grey.
  • http://docs.google.com/viewer?a=v&amp;q=cache:ihjN-VmNNaEJ:citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.97.6069%26rep%3Drep1%26type%3Dpdf+hot+spots+driven+approach&amp;hl=en&amp;gl=sg&amp;pid=bl&amp;srcid=ADGEESgC8vV6UzFjxHOKDLqcxcnVf1w-lJnBU13X9N-fsIP1trelhEudmWNpYpGhrfo-CcSlxFokUONDuYqRfajy_KDGuWHJYrU7kBJlVHjSBgHzCNHspTZ5_-rrcBVVgeN_9rrkfESg&amp;sig=AHIEtbSbl7ozvrNrZ8ZTj9GxfgzZoBXpXAhttp://docs.google.com/viewer?a=v&amp;q=cache:L-Yyq-nbVakJ:citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.76.4910%26rep%3Drep1%26type%3Dpdf+Wolfgang+pree+Which+aspects+of+the+domain+differ+from+application+to+application%3F&amp;hl=en&amp;gl=sg&amp;pid=bl&amp;srcid=ADGEESgBvu4B0-28tpkoszuKNLtOEoPjFUX36Mqk3AGyln5jDpwqb4NCPFoDIPvcYiyMw247ms-dPWtzz6S3Cz8BsKdv3ThLRyfZ5xllYa5IUACILcS96Lu4FuqLqiEiMHn8tXmR3Xhq&amp;sig=AHIEtbQqPZKDE0evqNqUfZNF2vmG519FRQ
  • After Hotspot has been identified…
  • A framework is a collection of classes--some abstract, some concrete--that captures the architecture and basic operation of an application system. Systems are created by extending the given classes to add the specialized behaviors.
  • Programming Paradigms - Seminar 3

    1. 1. Seminar 3: Making Good Progress<br />Programming Paradigms<br />[The Paradigms - Group 2]<br />
    2. 2. We will always use system analysis and design at the start of every software project.<br />
    3. 3.
    4. 4. No approaches were taught to derived<br />
    5. 5. Knowing an good approach can build a robust system design.<br />
    6. 6. Let us learn an approach to do system analysis and design <br />
    7. 7. What is Object-Oriented Analysis & Design?<br />7<br />Teacher<br />Student<br />An approach that models a system as a group of interacting objects.<br />
    8. 8. New approach to analysis & design<br />8<br />
    9. 9. CRC Approach<br />9<br />
    10. 10. What is CRC?<br />Class, Responsibility & Collaboration<br />Discovering the real world objects is a system<br />Mapping the collaboration among classes and their responsibilities<br />
    11. 11. Why CRC?<br />Uses brainstorming and role-playing to maximize advantages of group work<br />
    12. 12. Basics of CRC approach<br />
    13. 13. OO Characteristics<br />13<br />
    14. 14. The things they do <br />Their relationship to other classes <br />
    15. 15. Back of the card is used list attributes and write class description<br />The things they do <br />Their relationship to other classes <br />
    16. 16. 16<br />
    17. 17. QuickCRC <br />17<br />
    18. 18. CRC books<br />18<br />
    19. 19. 19<br />
    20. 20. CRC Card<br />1. Discovering Candidate Classes<br />1. Read Requirements Documents<br />2. Clarifying the Scope<br />2. Underline nouns and noun phrases.<br />3. Selecting Core Classes<br />3. Add them to candidate class list. <br />4. Brainstorm to find other potential classes.<br />
    21. 21. The ATM System will interface with the customer through a display screen , numeric and special input keys, a bankcard reader, a deposit slot, and a receipt printer.<br />Customer may make deposits, withdrawals and balance inquires using the ATM machine, but the update of accounts will be handled by an interface to the Accounts system.<br />Customers will be assigned a PIN and clearance level by the security system which will be verified prior to transactions.<br />We would allow customers to update routine information such as change of address or phone number using the ATM.<br />1.Discovering The Candidate Class List<br />1. Read Requirements Documents<br />
    22. 22. The ATM System will interface with the customer through a display screen , numeric and special input keys, a bankcard reader, a deposit slot, and a receipt printer.<br />Customer may make deposits, withdrawals and balance inquires using the ATM machine, but the update of accounts will be handled by an interface to the Accounts system.<br />Customers will be assigned a PIN and clearance level by the security system which will be verified prior to transactions.<br />We would allow customers to update routine information such as change of address or phone numberusing the ATM.<br />1. Discovering The Candidate Class List<br />2. Underline nouns and noun phrases.<br />
    23. 23. 23<br />1. Discovering The Candidate Class List<br />Candidate Class List<br />3. Add them to candidate class list. <br /><ul><li>ATM System
    24. 24. Customer
    25. 25. Display screen
    26. 26. Numeric
    27. 27. Special input keys
    28. 28. Bankcard reader
    29. 29. Deposit slot
    30. 30. Receipt printer
    31. 31. Deposits
    32. 32. Withdrawals
    33. 33. Balance inquires
    34. 34. Accounts
    35. 35. PIN
    36. 36. Clearance level
    37. 37. Security system
    38. 38. Transactions
    39. 39. Change of address
    40. 40. Phone number</li></li></ul><li>1. Discovering The Candidate Class List<br />4. Brainstorm to find other potential classes.<br />
    41. 41. 25<br />Q: How does the customer access the ATM?<br />1. Discovering The Candidate Class List<br />4. Brainstorm to find other potential classes.<br />
    42. 42. 1.Discovering The Candidate Class List<br />Candidate Class List<br />
    43. 43. 27<br />CRC Card<br />1. Read Requirements Documents<br />1. Discovering Candidate Classes<br />2. Underline nouns and noun phrases.<br />2. Clarifying the Scope<br />3. Add them to candidate class list. <br />3. Selecting Core Classes<br />4. Brainstorm to find other potential classes.<br />
    44. 44. Clarifying System Scope<br />What is and what is not part of the system.<br />
    45. 45. Clarifying System Scope<br />29<br />What is the scope of the ATM system?<br />Questions<br />Does it handle everything?<br />banking application<br />user interface<br />interactions between them<br />Does it.. <br />updates accounting records?<br />records and mediates the transaction activity?<br />Other Possible questions<br />
    46. 46. Clarifying System Scope<br />
    47. 47. 31<br />Clarifying System Scope<br />The sharper the system boundaries, the easier the evaluation of candidate class list.<br />
    48. 48. 32<br />CRC Card<br />1. Read Requirements Documents<br />1. Discovering Candidate Classes<br />2. Underline nouns and noun phrases.<br />2. Clarifying the Scope<br />3. Add them to candidate class list. <br />3. Selecting Core Classes<br />4. Brainstorm to find other potential classes.<br />
    49. 49. Sort Candidate Class List <br />
    50. 50. Essential Classes for the application<br />4. Selecting Core Classes<br />
    51. 51. Class that we are NOT able to categorize without knowing the system boundaries and definition<br />4. Selecting Core Classes<br />To be Reviewed further for categorization<br />
    52. 52. Classes that are outsidethe system scope<br />Printer, ScreenSave, and Prompt.<br /> Related to the user interface subsystem But not to the core banking application<br />4. Selecting Core Classes<br />
    53. 53. 37<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    54. 54. What are Hot Spots?<br />A hot spot is a portion of the system that is likely to change from one system variant to another.<br />
    55. 55. What are Hot Spots?<br />Hot spots encapsulatethe variable aspects within components. <br /><ul><li>Changes will only be made to hot spots
    56. 56. Interfaces and the relationships among components will become less prone to changes.</li></ul>Aid in designing components where changes is seldom necessary or constraint to a class <br />
    57. 57.  Identify Hot Spots<br />Identify hot spot by answering:<br /><ul><li> Which aspects of the domain differ fromapplication to application?</li></ul>(Help to generate a List of hot spots)<br />Let’s apply this question to our ATM domain ...<br />
    58. 58. Identify Hot Spots<br />Analysis of ATM<br />Q: Which aspects of the domain differ fromapplication to application?<br /><ul><li> Withdrawal handling. Why?</li></ul>Future<br />
    59. 59. Identify hot spots<br />Withdrawal handling is a hot spot.<br />Initially supports the dispensing of cash; future may require update of cash cards.<br />The classes that touch this hot spot include Account, Withdrawal, FundsAvailable, and BankCard.<br />
    60. 60. Benefits of Hot Spots<br />
    61. 61. 44<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    62. 62. Design Patterns<br />A design pattern is a design structure that has been successfully used in a similar context<br />“No Point Reinventing the Wheel”<br />“Reuse and Adapt existing”<br />
    63. 63. Design Patterns<br />Pioneers have laid out the foundations<br />There exist library of patterns<br />Apply them to them to the CRC cards<br />Speed up analysis<br />Application of Design Patterns may result in new classes that are not found during brainstorming<br />
    64. 64. “System Interaction Pattern"<br />AuthorizeSystemInteraction<br />
    65. 65. Example<br />AuthorizeSystemInteraction<br />Encapsulate Communication between ATM and the bank existing security system <br />
    66. 66. Example of Patterns that can be considered<br />Clients<br />Servers<br />Transactions<br />Interacting Systems<br />Interacting Devices<br />Etc…<br />
    67. 67. Some Good Pattern Books<br />
    68. 68. 51<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    69. 69. Framework<br />A collection of classes that captures the architecture and basic operation of an application system. <br />Systems are created by extending the given classes to add the specialized behaviors.<br />
    70. 70. Frameworks are "upside down libraries“.<br /> System control resides in framework code that calls "down" to user-supplied code.<br />A blue print for the implementation<br />Framework<br />
    71. 71. Example in ATM<br />54<br />There are many papers on ATM that has been successfully built<br />These framework can also be standards that existing ATM follows<br />
    72. 72. Part of a Framework<br />55<br />
    73. 73. 56<br />In the event where there is no available framework<br />Use design patterns to aid the design and analysis part of the application <br />
    74. 74. 57<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    75. 75. Remove ghost classes<br />Classes that do not fit within the application<br />Classes that are related entities but are outside the system. <br />
    76. 76. Example<br />Printer, and Keypad are relevant but outside the application.<br />
    77. 77. 60<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    78. 78. Combine synonyms <br />Use a common name for same items<br />This situation may arise when different groups within an organization use different names to refer to the same thing.<br />
    79. 79. Similarity<br />BankCustomerand AccountHolder are probably synonyms. <br />Adopt one of them or create a new name.<br />
    80. 80. Situation based<br />Balance and FundsAvailablemay or may not be different in concepts<br />Example:<br />A policy of disallowing withdrawals for some period after deposit of a check.<br />
    81. 81. Caution!<br />Be careful when the same word actually refers to different things! <br />New core classes may be needed.<br />
    82. 82. 65<br />3. Selecting Core Classes<br />Eliminate Unnecessary Classes<br />Architectural Design Issues<br />1. Identify hot spots<br />1. Remove ghost classes<br />2. Use appropriate design patterns<br />2. Combine synonyms <br />3. Take advantage of existing software frameworks<br />3. Distinguish attributes from classes<br />
    83. 83. Distinguish attributes from classes<br />Some candidate classes may turn out to represent information only!<br />A candidate class may be an attribute if:<br />It does not have any operations<br />It does not change<br />
    84. 84. Example<br />It does not have any operations<br />Balance and FundsAvailable<br /><ul><li> Few meaningful operations
    85. 85. Closely associated with Account.</li></li></ul><li>Example<br />Cannot change state<br />Consider a PIN. If a PIN is viewed as being immutable, then it probably should be an attribute of Account. <br />BUT<br />If a PIN can change state (valid, invalid, and suspended), it should be a class.<br />
    86. 86. 69<br />So what do we have so far?<br />
    87. 87. Annotated Candidate Class List<br />Critical Classes<br />FinancialTransaction<br />Account<br />BalanceInquiry<br />Withdrawal<br />Deposit<br />AuthorizeSystemInteraction<br />BankCard<br />Undecided Classes<br />BankCustomer(ghost - integrated with AuthorizeSystemInteraction)<br />PIN (attribute)<br />SavingsAccount(attribute of Account)<br />CheckingAccount(attribute of Account)<br />ATM (ghost -> system name)<br />FundsAvailable(attribute)<br />Balance (attribute)<br />AccountHolder(synonym)<br />
    88. 88. Annotated Candidate Class List<br />Irrelevant Items<br />Transfer <br />Receipt<br />ReceiptPrinter<br />Keypad<br />Screen<br />CashDispenser<br />ScreenMessage<br />Display<br />Deposit<br />EnvelopeFailure<br />TimeOut<br />KeyTransaction<br />LogPrinter<br />ScreenSaver<br />Prompt<br />Numeric Key<br />Key<br />
    89. 89. Thank you!<br />End of Presentation<br />

    ×