(This is the section plan the TAs used to prep for section 1. Some details are bound to differ from section to section, between plan and section, etc.) Section 1, Thu June 26 Goals: - TA/student introductions, - review modeling discussion from lecture, - do quick modeling exercise with the students, - go over the development process, - model the development process if time Intro - Weekly schedule - Mon/Wed/Fri lectures - Thu section - Homework out Monday afternoons - Homework due Sunday evenings - Homework returned (graded) in section - Office hours - Section agendas - Previous homework/solution reviewed - Review of new material introduced in section - Discuss current homework - Homework grades - Big part of the course grade! - Homework parts usually graded on a scale of 0-4 - It's not hard to get 2 points, but hard to get 4 - Always try to turn something in! - One more thing - Word of warning: Get used to seeing new things! - Use the textbook as a reference Lecture review - Modeling - Objects - Properties - Property types - Property values - Object state - Responsibilities - Object relationships - Object design - An object has a value for each property - Properties are typed - Values must match the property types - The state of an object is the combination of its values Example - From lecture: Student model, context of course registration system - From lecture: Retail (shoe) shop model Exercise (Again in the same context, now model a course) (Groups of 3-4 students working together for ~ 5 minutes) Working with code - Process overview 1 Run development environment 2 Write source code in editor 3 Save source file into file system 4 Compile source to create class file in file system 5 Run the class file 6 Loop back to step 2 if necessary - Demonstration Demo storyboard 1 Run DrJava 2 Write Hello World in DrJava's editor 3 Save to HelloWorld.java using the save button or menu item 4 Compile 5 Switch to the interactions pane 6 Back to step 2 2 Change Hello World to Hello 142 Skip steps 3 and 4 5 Run, the change had no effect 3 Save 4 Compile 5 Run - now works More stuff, homework prep: - Create a new class called Message - Add the main method from the HelloWorld class - Add a private String message field - Add a public String getMessage() { return message; } method - Add a public void setMessage(String newMessage) { this.message = newMessage; } - Change the main method to do Message m = new Message(); System.out.println(m.getMessage()) - Run the program - Invoke setMessage from the interactions pane - ... Modeling the development process - What are the objects? - What are their properties and responsibilities? Objects: - Development environment - Source code - Source file - Editor - Compiler - Class - Class file - Interactions pane Dev env properties - Editor - Save button - Compile button - Interactions pane Dev env responsibilities - Open editor - Save file - Invoke compiler - Access interactions pane Source file properties - Source code Compiler responsibilities - Compile source and create class file Interactions pane responsibilities - Run programs (Etc...)