1 / 29

Responsibilities for Doing

Responsibilities for Doing. Verbs (actions) in problem statement keep relevant others from experience Assign each to a class who knows data? collaboration to access data Example computing final mark Student and MarkingScheme generate report Course and Student average

gaetan
Download Presentation

Responsibilities for Doing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Responsibilities for Doing • Verbs (actions) in problem statement • keep relevant • others from experience • Assign each to a class • who knows data? • collaboration to access data • Example • computing final mark • Student and MarkingScheme • generate report • Course and Student • average • Course and Student • CRC cards

  2. Selecting Candidate Tasks

  3. Identified Tasks

  4. Course

  5. MarkingScheme

  6. Student

  7. Work

  8. Architecture • Main class • identified class or new • Course could be part of something larger • could have many applications involving a course • new class (FinalGrades) • Collaborations • who controls interaction? • i.e. which is client which is server • also relationships (analysis diagram) • Architectural plan • persistence • various applications access information over time • all classes except FinalGrades are persistent • sequential processing • process Students in order

  9. Analysis Model

  10. Design Model

  11. Detailed Design • Class design • responsibility for knowing • instance variables • responsibility for doing • methods • Interfaces • class specifications including method declarations • methods identified as “doing” in CRCs • accessor and updater methods • fill in parameter types • Generalization • design for future use

  12. Interfaces • Specification for classes • constants and method headers only • No implementation • cannot create objects of interface type • create objects of implementation classes • Defines a type • can declare variables of interface type • can assign objects of any implementation type • subtype • Can be compiled • can reference in other classes without an implementation

  13. Class Design • Interface Course • accessor methods • updater methods? • other methods • Interface Student • accessor methods • updater methods? • other methods

  14. Interface MarkingScheme • accessor methods • updater methods • other methods • Interface Work • accessor methods • updater methods • other methods

  15. Coding • May be multiple applications in system • e.g. Student Records System • new course setup • mark entry • mark reporting • final grade computation with report* • Coding by programmers • responsible for a specific class • implementation can be done in any order • may discover new classes • support classes • GUIs and reports

  16. Contract • interface provides specification • interfaces for other classes • collaborators – what can be used • Implementation Classes • implements clause • requirements • Instance variables • from “knowing” in CRCs • others as needed for implementation • Methods • as required by interface • additional support (local) methods

  17. Class MarkingSchemeImpl • Persistent • Instance variables • Constructor • would be required for new course application • Identified methods • accessor/updater • apply • weighted sum

  18. Class StudentImpl • Persistent • Represents single student • Instance variables • Constructor • would be required for new course application • Identified methods • accessor/updater • calcFinalMark • delegates to MarkingScheme • update • for mark update application

  19. Class WorkImpl • Persistent • Instance variables • Constructor • would be required for new course application • Identified methods • accessor/updater

  20. Class CourseImpl • Persistent • Instance variables • Constructor • would be required for new course application • Identified methods • accessor/updater • calcFinalGrades • report • report class • user feedback • marking scheme form • process each student • detail line • compute average • write summary • doUpdateMarks, doMarkReport • other applications • Discovered classes • FinalGradeRreport • MarkingSchemeForm

  21. Class FinalGradeReport • Visibility • Report for final grades • Not persistent • Instance variables • Constructor • Methods • Local methods

  22. Class MarkingSchemeForm • Visibility • GUI for marking scheme display • Not persistent • Instance variables • Constructor • builds form • Methods • Local Methods

  23. Main class (FinalGrades) • Object creation • all persistent objects assumed to exist • read Course object • Confirmation • course form • Course object will be modified (average grade) so this is a file update (1 record) • write updated Course object (file) • Course object does work • User feedback • Discovered Classes • CourseForm

  24. Class CourseForm • Visibility • GUI for course information display • Not persistent • Instance variables • Constructor • builds form • Methods • Local Methods

  25. Testing • Class stubs • collaborator classes? • class stub implements same interface so is pluggable • method stubs • Test harness • replaces main class for testing • perform desired tests • test all methods and constructors • repeatable • Integration testing & system test • Test sets • sets of test data to test all possibilities • test ends of ranges • 0, 1 and other number of students • 0, full and other marks • predicted output • prepare ahead of time and keep on file

  26. Debugging, Production& Maintenance • Debugging • apply program to test data • when unexpected output, re-code, re-design and/or re-analyze • System.out.println • Production • when satisfies all tests, release to users • Maintenance • correction of errors found in field (hopefully few) • addition of new features • re-analyze etc. • change of specification • re-analyze etc.

More Related