Concepts
- Don’t ever call paintComponent or new Graphics(…); because they are provided for you by Java’s graphics framework, which is exists before your code starts running and whose purpose is to make it easier for us to do graphics.
- Model-View-Cotroller[2]Design Pattern:
- The “Model” knows what your program is, and what its state is.
- The “View” knows how to display objects.
- The “Controller” knows how to tell a View to display a Model, and how to update the Model based on user input.
- The Model and the View never interact with each other; they only talk to the Controller.
- Use the MVC design pattern for Homework 2 even though it’s not required, because it will be required for Homework 3.
- WindowBuilder’s MVC will start the View instead of the Controller, which is wrong. Change the generated code to start the Controller instead.
- Balls (in Homework 2) move discretely, not continuously.
- If a ball passes the edge of your screen and bounces back and forth on the edge, it’s because you are making it bounce every time it is across a wall, rather than once per wall.
- How do you know where a ball would have been, if it discretely passes the edge? http://www.clear.rice.edu/comp310/f12/assignments/hw02/BallBounce.png
- Dr. Wong says “SVN Branch your Homework 1 code to use as the starting point for Homework 2.”
- Consider instead:
- Duplicate HW01 in Eclipse.
- Rename HW01 to HW02 in eclipse.
- Commit HW02 to SVN.
Quotes
- “Assume a spherical cow (in a vaccum).” – Dr. Wong (and peanut gallery)
- “I had an older brother, and to him, I provided the ‘punchingBag’ service. I didn’t know when he would call on that service; he could just walk up whenever he wanted and OOMPH” – Dr. Wong
Resources
- Animations: http://www.clear.rice.edu/comp310/JavaResources/animation.html
- MVC Design Pattern: http://cnx.org/content/m26104/latest/
- Copying a Source-Controlled Project: http://www.clear.rice.edu/comp310/Eclipse/Subclipse/copying/
This entry was posted on
September 4, 2012 at 3:32 pm and is filed under Labs. Tagged: awt, hw02, MVC. You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.