CSE logo University of Washington Department of Computer Science & Engineering
 CSE 143 Winter 2004 -- Homework #5
  UW Home     CSE Home   Announcements    Message Board    Contact Info 

CSE 143
 Home page
 Syllabus
Classwork
 Calendar
 Homework
 Exams
People
 Instructors
 TAs
 Consultants
 Consultant Schedule
Software & Computing
 Programming Lab Info
 Computing at Home
 Java Libraries
 Using Java
 Troubleshooting
Staying in Touch
 Mailing Lists
 Discussion Board
 Announcement Archive
 Anonymous Feedback
Check Your Scores
 MyUW
Academic Misconduct
 CSE Policy
   

Homework 5: MVC and Beautiful Code

Your assignment is to take Anthony Messina's really cool genetic design program shown in class and turn it into a really cool, really well written genetic design program based on the MVC paradigm we've been discussing in class.

Before starting, you should read the code carefully to make sure you understand how it currently works, where it has problems, both structurally and stylistically. You should then think about what the roles and responsibilities should be of the Model, the View, and the Controller. Lastly, with a clear plan in mind, you should write down in English the behavior of these roles with respect to the application as a whole.

At the same time, for each of Model, View and Controller, you should be thinking about what the key abstractions are within each. Are there buttons? Special kinds of buttons? Animals, special kinds of Animals, Commands, etc etc... These abstractions probably deserve to be in their own class, and may even need to be in their own inner class.

Once you've got a vision of how the system is supposed to hold together, you're then ready to start your "demolition" work breaking out functionality into different classes and class files.

What to turn in

There are three graded components to this assignment:

Part 1 -- Due Tuesday, February 24th by 7pm.

 

Part 1. Your "plan of action." This is what you need to prepare before you start coding. You do not need to write any code. You only need to describe how your new system will work. Doing part 1 will be useful to your midterm preparation.

Part 2 -- Due Sat. Feb. 28, 11:59 pm.

Turnin Here.

Part 2. Your new system. This is what you actually build and run. It should look and feel exactly like the original system on the outside (at the GUI level), but have an internal implementation that uses MVC and is stylistically consistent with the work we've been doing in class and with the later versions of the JukeBox code. Specifically,
  • Program abstractions are broken out into classes.
  • Methods are small and easy to read
  • Inheritance is used to express differences between existing and new classes.
  • Program concepts that don't need names don't have them (eg, "should I use an anonymous inner class here?")
  • Code only "knows" what it needs to know, and what it needs to know is very little. Eg, "if I make this class an inner class, then clients of the enclosing class don't even need to know that the class exists"
  • Specifically, models and views don't know about one another. The controller knows about both. The controller may of course inform the model and the view about other functionality, provided either by the controller or through some common third party interface or class.
To be REALLY CLEAR: You are NOT to change the visual appearance of the program.

Part 3

Part 3. Your "post mortem." Compare what you planned to build in Part 1 with what you actually built in Part 2. Consider the roles and responsibilities you had imagined for each of the Model, View and Controller. Where did you get it right? Where did you get it wrong? For where you got it wrong, explain what you learned during Part 2 that helped you understand a better way to do things.

Due Dates

  • Part 1 will be due on Tuesday, February 24th by 7pm.
  • Parts 2 and 3 of the assignment is due at 11.59pm Saturday Feb 28.
Both should be turned in using turnin.

I recommend that you begin your work as soon as possible to help in your preparation for the midterm.

Grading Criteria

Part 1:
  • 2 points. Clear demonstration of understanding the major components and relationships in an MVC program.
  • 1 point. Partial demonstration.
  • 0 points. No demonstration.
Part 2:
  • 5 points. Clear and convincing demonstration of the ability to design a well-written MVC application.
  • 4 points. Good demonstration of the ability to design a well-written MVC application.
  • 3 points. Adequate demonstration of the ability to design a well-written MVC application.
  • 2 points. Some demonstration of the ability to design a well-written program,
  • 1 points. Almost no demonstration of the ability to design a well-written program.
  • 0 points. No demonstration of any ability to design a well-written program.
Part 3:
  • 2 points. Clear demonstration that you thought about your post-mortem.
  • 1 point. Some demonstration that you thought about your post mortem.
  • 0 points. No demonstration that you thought about your post mortem.

The Code

Click here for the program.



CSE logo Department of Computer Science & Engineering
University of Washington
[comments to cse143-webmaster]