Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE564 Lecture 16

CSE564 Lecture 16

Software Design
Connecting the Dots
(202010)

B546a9b97d993392e4b22b74b99b91fe?s=128

Javier Gonzalez

September 16, 2020
Tweet

Transcript

  1. jgs CSE 564 Software Design Lecture 16: Connecting the Dots

    Dr. Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 2 jgs

    Manufacturing vs Crafting 1 2 3 4 5 6 7 8
  3. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 3 jgs

    Goal 1.. N-2 7 § A class: <class_name><number>.java § Others: <class_name><number><role>.java § A class: Main<number>.java § Others: Main<number><role>.java 8 § Class Diagram
  4. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 4 jgs

    One :: Repository 1 / / / Student Repository Student Observable <Java API> // https://www.tutorialspoint.com/design_pattern/iterator_pattern.htm public static void main(String[] args) { StudentRepository repository = new StudentRepository(); for(Iterator iter = repository.getIterator();iter.hasNext();){ Student student = (Student)iter.next(); System.out.println(student.toString()); } } Iterator
  5. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 5 jgs

    Two :: Decorator 2 Student CoreData Student public static void main(String[] args) { Student javier = new Student(); StudentAttendance attendanceCard = new StudentAttendance (date, minutes); StudentGrades gradesCard = new StudentGrades ("Quiz 1", 5, 100); //5% javier.setName(”Javier Gonzalez"); // more -first, last, program, level, asurite javier.add(attendanceCard); // merge with others javier.add(gradesCard); // merge with others System.out.println (javier.toString()); } Student Decorator Student Attendance Student Grades
  6. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 6 jgs

    Three :: Grader 3 § Receives file path § Load data for grades § Iterator to Repository § Foreach item in repository § decorate with grades § Return in integer number of unknown 89 Quiz 01 ASURITE javiergs Quiz N 89 More …
  7. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 7 jgs

    Four :: Reporter 4 75 Date (MM-DD) ASURITE javiergs § Receives file path § Load data for grades § Iterator to Repository § Foreach item in repository § decorate with attendance § Return in integer number of unknown
  8. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 8 jgs

    Five :: ObserverTable 5 // https://www.javatpoint.com/java-jtable // https://stackoverflow.com/questions/24918884/dynamically-updating-jtable § Create a Jpanel § Add a Jtable § It is observing Repository § “Something happens” update the table § Is it possible to test this without the full project Main?
  9. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 9 jgs

    Six :: ObserverPlotter 6 // https://www.tutorialspoint.com/jfreechart/jfreechart_bar_chart.htm § Create a JPanel § Add a plot. There is a library. Use it. § It is observing Repository § “Something happens” update the plot § Is it possible to test this without repository and without the project Main?
  10. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 10 jgs

    Seven :: Main 7 § Create DelegateGUI § Create Grader § Create Reporter § Create ObserverPlotter § Create ObserverTable § Observer and Observables connected § ActionListeners § Inversion of Control
  11. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 11 jgs

    Eight :: 8 • Class Diagram • Testing, testing, testing …
  12. Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 12 jgs

    Manufacturing vs Crafting 1 2 3 4 5 6 7 8
  13. jgs CSE 564 Computer Systems Fundamentals Javier Gonzalez-Sanchez javiergs@asu.edu Fall

    2020 Disclaimer. These slides can only be used as study material for the class CSE564 at ASU. They cannot be distributed or used for another purpose.