Kurssiesittely | Luennot | Harjoitukset |
---|
See the instructions in the previous exercise.
max 7 points
net.orfjackal.weenyconsole.CommandExecuter
so that you extract its innerclass Possibility
to be its own top-level class, and move into it all methods which fit there best. In other words, do the Extract Class refactoring. Print a couple of steps and the final result of your refactoring on paper so that the exercise would be easier to discuss at the exercise group.
1 point: The innerclass has been extracted to be its own top-level class. All tests pass.
2 points: Also into the extracted class has been moved the methods which fit there best. All tests pass.
3 points: Also the code has been refactored as clean as possible. All tests pass.
Tips: Especially if you are not familiar with the GUI library (Swing), it may be the easiest to implement the GUI first, after which it will be easier to see what kind of interfaces should be made between the view and controller. The view's test double might be best written manually, without using a mock object library, because the view and controller communicate very tightly and the mock object configuration would become very large. In Java it's possible to listen for changes to a text field, one character at a time, by using the JTextField.getDocument().addDocumentListener() method. It may be useful in implementing the search. An editable table, which shows the addressbook's contacts, is the easiest to implement using the JTable component.
1 point: Passive View's controller is partially done. All tests pass.
2 points: Passive View's controller is completely done. All tests pass.
3 points: The graphical user interface is partially done. All tests pass.
4 points: The graphical user interface is completely done. All tests pass.
In the exercise group we will discuss extracting classes, and get acquainted with the legacy code that will be modified in the next exercise.