--- # P2 CHANGES --- # 2017 TO DO - Add to P2 intro I explain three views of OO programming. The Scandinavian view is that an OO system is one whose creators realise that programming is modelling. The mystical view is that an OO system is one that is built out of objects that communicate by sending messages to each other, and computation is the messages flying from object to object. The software engineering view is that an OO system is one that supports data abstraction, polymorphism by late-binding of function calls, and inheritance. — Ralph Johnson (Attributed by James Noble, “The Myths of Object-Orientation”, ECOOP 2009) * show how Java 8 lambdas can replace anonymous inner classes - 4. JUnit * Show actual graph of paths through algorithm - 5. Testing and Debugging * More on P2 benchmarks. Space what about running benchmarks without assertions turned on. - add something on Java VisualVM (view stack and heap) - also check out Eclipse Memory Analyzer (AKA MAT) - add something about caching (optimization) * check & fix code examples (eg inconsistent versions of Java standard Stack -- generic or not?) * QuickCheck ? - mention Selenium GUI testing - Inheritance & Refactoring * add something on Fowler refactorings - 9. GUI - migrate TicTacToe RMI to WebSockets? [mainly intended for web browsers] - 11. C++ - revise based on A Tour of C++ Migrate some code towards Java 8? - streaming APIs http://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html - iterating over collections using lambdas - passing lambdas as callbacks - avoiding mutable state (always create new objects instead of modifying new ones) - focusing on recursive solutions - tail recursion - call by value/call by name - Optional types vs Null Objects http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html ## Student feedback - provide a book on OOP? --- # 2016 DONE * adding separate hidden notes slides to PDFs - 3 DbC - added something on exceptions vs assertions - 4 Added more concrete advice on what to test; replace MoneyBags example --- # 2015 DONE - 3 DbC - added some slides about whom to blame when things go wrong - 4 JUnit - Added slides on equals() and toString() - 10 Idioms and Patterns - removes fake pattern code ; added Shapes example - added Factory pattern --- # 2014 DONE - reordered lectures - fixedComposite pattern slides (Leaf inherited too much from parent) --- # 2013 DONE - Moved examples to separate repo (DONE) ## 12. C++ * Fixed some broken slides: 16; arrows in 7, 12; tables 15, 18, 40; --- # 2013 TO DO - Add to goals of course? + Version control + Documentation writing ## 4. Testing/Debugging - on time this year (last year 10" short) - code on slides inconsistent with repo! (Wrapped array wraps empty or isEmpty? ...) [FIXED] * convert stack tests to JExample? ## Puzzles, Traps - java can override inst vars; accessible from methods of classes on hierarchy where defined --- # 2012 DONE ## 6. Iterative Development - 10" short ; added 10" intro to Pomodoro Technique ## 7. Inheritance - 15" short this time! ## 11. Smalltalk - Move Java to middle column of comparison table --- ## 2012 TO DO * Use picture frames for code? * Add some magic moves to Git slides? * Check lectures 3+ on iPad ## 1. Intro * Git: Add a slide or two on typical usage (make changes to own branch and merge back) ## 4. JUnit * Perhaps retire MoneyBags example and drop Double Dispatch (replace with what?) ## 12. Smalltalk * Check demos -- repair DemoWorkspace.st ! ## 13. C++ * Remove return from Java hello world? (slide 11) --- # 2011 CHANGES ## 2. OODP - simplified findForward; eliminate findBackward (DONE) - added game board scripting methods (see ex 2 solution) (DONE) ## 3. Design by Contract - updated to generics ## 5. Iterative Development - removed subversion slide ## 6. Testing and Debugging - updated to generics ## 7. Inheritance - Added a slide on refactoring support in eclipse ## 12. Smalltalk - added slide on PBE - reduces some syntax slides (too many) - added demo markers - fixed formatting of demo script markdown - moved demo scripts to examples folder --- ## 2010 CHANGES 1. Intro - tightened some material - added programming as modeling slide - Fixed Iterator over Shapes to use foreach loop 2. OODP - new lecture - added Snakes and Ladders to Examples directory * Needs a conclusion slide? * Need epilogue with change scenarios? (see rule variations below 3. DbC - Removed references to ADTs (cf Cook 2009) - When to check invariants? After constructors and mutators. - NB: should discuss ParenMatch solution at end! 4. JUnit - Update Money example to generics and modern iteration [DONE] - fix ppt example code to be consistent [DONE] - Add class invariants to Money, MoneyBags (amount>0) [DONE] - add sequence diagram with double dispatch: (aMoneyBag).add(aMoney) [DONE] 6. Testing and Debugging - Added a slide on Eclemma 7. Inheritance - Simplified "3 Uses of Inheritance" slide 10. **Smalltalk** * 10" overtime -- focus on PostOffice demo * Revise slides to follow PO demo - update slides - "What is surprising about Smalltalk" (see ST lecture) ## Snakes and Ladders rule variations - Below some ideas that involves additional state for tokens, or actions that are being triggered by certain dice values (or dice combinations, if played with multiple dices): - Skip a turn or do two turns the next time. - Double the dice value in the next turn. - Make the token immune against ladders and snakes, or other actions. - Make the token impossible to pass by other tokens. - Split the token into two (for a certain amount of time, to a certain place, ...). - Other rules for the board might be: - Ladders have to be taken step by step. Only one token can occupy a ladder. - Ladders can be destroyed if taken too fast, for example when the dice shows a 5 or 6. - Snakes can be avoided in certain cases, for example when the token is in a specific state or a specific dice value was played. --- ## 2009 NOTES (retired lectures) 8. Generics - lecture 20 minutes short -- room for more ... * check all warnings in demo examples; patch Jumble? * Fix More fun with generics slide to show example of problem eg: sort list of Shapes -- cannot give comparator that expects Circles --- ## 2009 CHANGES Update Overview 1. Intro - added a roadmap - revised example and added running version to svn - moved svn control from lecture 5 to this lecture 2. Design by Contract - completely reorganized; rewrote several slides 3. JUnit - added JExample slides 4. Iterative Development [no significant changes] 5. Testing and Debugging - moved svn stuff to first lecture 6. Inheritance [no significant changes] 7. GUI - cleaned up some slides & checked consistency with source code * Add something on Maven? 8. Generics [no significant changes] 9. Patterns - dropped the extra patterns at the end * Add something on dependency injection? (see Wikipedia article) 10. Smalltalk - added Blob, SmallInteger maxVal and Seaside to demo script - removed and reordered material; added seaside demo 11. C++ - fixed the animations 13. Puzzles - Fix formatting in answers - Date -> Calendar in answer - explain better magic numbers - Add separate slides for Puzzle 2 part 2 (3x) - Tests? --- ## 2008 CHANGES Retired full RMI lecture 1. Introduction - some formatting - added some figures 2. Design by Contract - added early slide on assertions - added roadmap - added enabling assertions in eclipse - autoboxing in ParenMatch algorithm - new ugly procedural parenmatch - dropped underscore tagged variables - removed push precondition and added a test 3. JUnit - Added roadmap - Added more on double dispatch - Fixed examples to be consistent with svn - Removed point on slide 14 about JUnit not distinguishing Failures and Errors - changed fCurrency to currency etc. - removed MoneyTest constructor 4. Iterative Development - Swapped with lecture 5 (Debugging) - Fixed examples (Java 4; JUnit 4; no underscores ...) - Fixed TicTacToe Sequence Diagrams 5. Debugging - Added roadmap and tweaked some formatting - Fixed examples to be consistent with svn 6. Inheritance 7. GUI - Roadmaps + formatting - Added myAssert to force assertion checking in jar files - Added RMI as an epilogue 8. Generics - Updated generics examples - Migrated all examples to svn - Retired AbstractFactory -> Etc 9. Patterns - formatting; cleaned up some of the examples 10. C++ - Removed/compressed some intro material 11. Invited lecture TBA 12. Smalltalk - restructured; updated from latest tour and intro slides ---