1 / 20

ecs40 Fall 2012: S oftware Development & Object-Oriented Programming final review

ecs40 Fall 2012: S oftware Development & Object-Oriented Programming final review. Dr. S. Felix Wu Computer Science Department University of California, Davis http://www.cs.ucdavis.edu/~wu/ wu@cs.ucdavis.edu. Final – 12/14/2012. Chapters 3, 6.11, 8~18, 20, plus this set of slides

fallon
Télécharger la présentation

ecs40 Fall 2012: S oftware Development & Object-Oriented Programming final review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ecs40 Fall 2012:Software Development & Object-Oriented Programmingfinal review Dr. S. Felix Wu Computer Science Department University of California, Davis http://www.cs.ucdavis.edu/~wu/ wu@cs.ucdavis.edu ecs40 fall 2012

  2. Final – 12/14/2012 • Chapters 3, 6.11, 8~18, 20, plus this set of slides • Plus gcc/g++, gdb, gprof, make • BUT, probably slides and HWs (especially hw5 and hw6) are most important for your preparation. • closedbook/note/device/people test ecs40 fall 2012

  3. Keep in mind… • I like to ask the kind of “questions” – • Mostly fundamental • Covered repeatedly in HWs and lectures • Some of students were confused (1 from midterm) • A major part will come out of HW#6 directly! • Probably HW#5 as well! • I don’t like – • for you to remember a lot of stuff • I like students to think/understand, instead of trying to remember everything superficially. ecs40 fall 2012

  4. Grading • 0 – nothing or nothing makes any sense • 1 – (25%) have tried but it’s missing the target mostly or completely, or with major flaws • 2 – (50%) got something right but with some major flaws • 3 – (75%) got the right direction, the answer is close to right, with only some minor flaws • 4 – (100%) mostly right, flawless (or almost flawless) ecs40 fall 2012

  5. ecs40 Fundamentals • OO Paradigm • Encapsulation/Abstraction, Separating Interface from Implementation, Extensibility + Reusability (e.g., Template, Inheritance, Polymorphism, Exception) • Internals, Comparison +/-, Dynamic Memory Allocation • OO Programming “Everything is an Object” • Classes (e.g., stream, string, I/O, file) • Software Development Tools in Unix • gcc/g++, make, gdb, gprof  errors/faults • Team/Collaborative programming • Good software development practice/coding style ecs40 fall 2012

  6. Probably (with Prob = 0.999999) • Separating Interface from Implementation, plus Exception, under the context of HW#6 • “when shall we try/throw/catch?” and “will that be conflicting with encapsulation?” How to balance/justify that? • Given a program with Segmentation fault, how will gdb help you to find out the location of the error? (in HW6, e.g.) • What is the memory allocation (e.g., new) difference between a member function and a member virtual function? (in the context of HW5) ecs40 fall 2012

  7. Probably (with Prob = 0.899999) • Comparing two different approaches (two pieces of code, inheritance versus template). • When should we use what? Compiler versus linking, run-time? (in the context of HW#5) • Also, will one be relatively easier for the purpose of collaboration? Is OO paradigm better than tradition non-OO such as C? • File handling – fault tolerance (could be combined with the gdb or exception question) • Memory Leak (program example) • Single Pointer-based Linked-List ecs40 fall 2012

  8. Probably (with Prob = 0.899999) • What is the difference between • (const EAC_Event) * event; • EAC_Event (const *) event; ecs40 fall 2012

  9. Probably (with Prob = 0.5000001) • If I forgot something, I will announce by this coming Sunday on both Facebook and Smartsite. • But, pretty much everything has been mentioned already…. ecs40 fall 2012

  10. An Object • Integrity/Protection • Reusability • Abstraction ecs40 fall 2012

  11. Memory Cell Layout main Scan_address Scanf malloc/free a.out ecs40 fall 2012

  12. Integrity/Protection? • Reusability? • Abstraction? malloc free ecs40 fall 2012

  13. Integrity/Protection • Reusability • Abstraction malloc free Soft shell ecs40 fall 2012

  14. GradeBook setCourseName string getCourseName displayMessage Course name 14 14 malloc/free C++ a.out ecs40 fall 2012

  15. ecs40 fall 2012

  16. Constructor “private” Base “protected” “public” Constructor Derived “private” ecs40 fall 2012

  17. ecs40 fall 2012

  18. Phone Phone • iPhone5 Android • Ecs40_Phone ecs40 fall 2012

  19. Random access Implicitly, a moving STREAM POINTER, like the “address” of your LOGICAL disk block number. ecs150 Fall 2011

  20. A common programming practice is to allocate dynamic memory, assign the address of that memory to a pointer, use the pointer to manipulate the memory and deallocate the memory with delete when the memory is no longer needed. • If an exception occurs after successful memory allocation but before the delete statement executes, a memory leak could occur. • The C++ standard provides class template unique_ptr in header file <memory> to deal with this situation. ecs40 fall 2012

More Related