Download presentation
Presentation is loading. Please wait.
Published byPearl Lawson Modified over 8 years ago
1
332 Final Review Last updated Fall 2013 Professor Ammann
2
2 Agenda Review Topics Covered Highlight Technical Concepts Key Facets of Object Orientation Identify Areas for Study on Final Final May Test Several Concepts in a Given Question Goal: Strong Showing on Final
3
3 Basic Java; Some C++ and C# Basic Java reviewed Some C++ No specific final questions But be prepared to manipulate basic Java, C++ code Syntax isn’t the issue; concepts are
4
4 Exceptions How to program exceptions Java, C++ Rationale for exceptions Providing defined behavior Bloch Items 57-65 Exceptions for exceptional conditions Checked vs. unchecked exceptions Standard exceptions Matching exceptions to the abstraction Failure Atomicity Ignoring Exceptions
5
5 JUnit and JavaDoc How to test and document Java programs Corresponding C++, C# facilities not covered in this class JavaDoc APIs JUnit tests for a given JavaDoc description JavaDoc and JUnit for exceptions Contract model and Junit JUnit theories
6
6 Contracts Fundamental Topic Expect Significant Exam Coverage Understanding, not Formality, is the Focus Method contracts Preconditions, Postconditions, Invariants Relation to JavaDoc Relation to JUnit Differences between Java and C++ Some preconditions relate to language type safety
7
7 Data Abstraction Abstraction Functions What they are How to implement (toString()) Representation Invariants What they are How to check Fair exam questions Identify abstract states wrt implementation states Identify states that satisfy/violate rep invariants Identify rep invariants that disallow certain states
8
8 Method Verification Verification of methods in isolation Representation invariant captures method interactions Two part verification Maintain representation invariant Show implementation satisfies contract Role of the abstraction function Relating implementation state to abstract state Fair exam question Given contract/code pair Will verification succeed? If not, why not?
9
9 Object Creation/Destruction Rules for Object creation Bloch Chapter 2 Static factories, constructors with many parameters Constructor chaining and it’s analogues Similar rules apply for cloning, serialization Access to uninitialized state See Bloch Item 17 C++ Constructors, copy constructors / copy assignment Object destruction Memory leak issues Inappropriate object destruction
10
10 Substitution Principle Core principle for inheritance Nuances of “IS-A” relationship Reasoning About Subtypes Signature Rule Rules for Exceptions Methods Rule Preconditions/Postconditions More Rules for Exceptions Relation to Method Verification Properties Rule
11
11 Substitution Principle and Methods Common to All Objects Understand the problem equals() Transitivity, Symmetry, Substitution for subtypes Bloch’s vs Wagner’s equals() recipe hashCode() Consistency with equals() Understand the solution Composition (Bloch Item 16) Understand Bloch’s InstrumentSet example
12
12 Mutability Key topic Should be comfortable designing immutable types Benefits - Bloch Item 15 Achievement Transforming mutators to producers Limiting subtyping Performance Controlling object instantiation
13
13 Generics Programming with Java generics Understand that they are really “ungenerics” Type safety aspects Java Generics (Bloch Chapter 5) Arrays vs. Lists Converting to generics PECS – producer extends, consumer super
14
14 General Programming Local variable scopes For/for-each/while loop guidelines Primitive/boxed type pitfalls Use of String type General overview of Native methods Reflection
15
15 Enums and Annotations Problems with C-Style Enums Enums, EnumSet, EnumMap Simple Annotations
16
16 Wrap Up Closed Book/Notes/Slides/Phone/Web/etc. Bring something to write with You may bring one (1) 8.5”x11” paper Your handwriting – no printing/photocopying Double-sided is fine Goal: Effective study aid Prepare with quizzes, in-class exercises At least one quiz question will be on final
17
17 More Wrap Up Grading issues (Blackboard) must be brought to my attention by the final exam Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.