10-152-312 - Object-Oriented Programming 2

Oral Final

The oral final will consist of a one-on-one, 25-30 minute discussion which will assess your knowledge of object-oriented programming. The exam will take place in a meeting room in the southeast area of ITEC, near room A122 on the Wausau campus. Dress professionally (business casual or better), arrive 5 minutes before your scheduled appointment, and wait in ITEC. If you are in one of the regional campuses, your attendance in Wausau is optional, but preferred. Contact me with alternate arrangements if needed.

Select a time slot for your individual final using this Doodle poll. Sign up early for the best selection of a time slot, as it is "first-come, first serve".

Written Component (100/250 points)

Solve the following scenarios using class diagrams and/or code as specified. Either submit your solutions in Blackboard or bring them with you to the final. Diagrams and code can be in any form, including hand-written; psuedo-code can be used.

  1. The below class diagram shows an overly rich inheritance hierarchy for cars and trucks with different types of engines. The existing design clearly violates the single responsibility principle, as the Vehicle class has several unrelated methods. In addition, you are given a requirement to add a 6-cylinder truck, which will violate the don't repeat yourself design principle.

    Create a class diagram of an alternative design where no engine code or other vehicle functionality is duplicated. Various solutions to this problem exist; yours should use composition over inheritance. Note that favoring composition over inheritance does not imply that you need to eliminate inheritance altogether.

  2. A class has a public list. Make the list private, but allow other classes the following fuctionality:

    1. Adding to the list
    2. Finding an item in the list, using a single method to allow searching against a variety of criteria
    3. Enumerating the items in the list from outside the class, without allowing editing of the list

    Write pseudo-code to represent the methods required to provide that functionality.

  3. Given the following class diagram and code, provide a refactored design, without using inheritance, which allows enumeration of all possessions in a single loop.


    Create a class diagram and write pseudo-code of the refactored loop.

  4. A checking account class is used in a WPF application. The following code sets the money balance of a checking account if the value is not less than 0. Otherwise, it notifies the user via a message box that the balance cannot be less than 0.

    You are given a requirement that the checking account class be used in a web application, which wouldn't be able to use a message box. Refactor the code to allow the class to be used by two different user interfaces in a way that still validates the money balance.

Oral Component (150/250 points)

Be prepared to answer the following questions, of which I will choose several to discuss with you:

  1. Explain the differences between namespace scope and project/assembly scope.
  2. What is the primary purpose of a DLL?
  3. Which of the object-oriented basics (inheritance, polymorphism, encapsulation, abstraction) does an n-tier architecture best achieve? Explain.
  4. Explain the intent of the Strategy Pattern. Where might you use it? Which design principle(s) does it implement?
  5. Explain the intent of the Observer Pattern. Where might you use it? Which design principle(s) does it implement?
  6. Explain the intent of the Factory Pattern. Where might you use it? Which design principle(s) does it implement?
  7. Which design pattern do delegates implement? Explain.
  8. Define and explain the Open-Closed Principle.
  9. Define and explain the Dependency Inversion Principle.
  10. What are anonymous methods? How are they used?
  11. What are lambda expressions? How are they used?
  12. Describe similarities and differences between LINQ and SQL. Identify several advantages of using LINQ.
  13. Explain the purpose of serialization.

You may use any means of researching/preparing for this exam, including discussing it with your classmates. Study groups are welcome and supported! You can bring one sheet of notes with you to the final, but since the final is intended to measure your understanding of concepts rather than memorization, you may find that notes are not needed. If you do bring notes, please submit them here at least 24 hours in advance of your final. Keep in mind that you will not have time to thoroughly read from them during the final, so be sure they are concise and easy to reference quickly. While not required, submitting well-researched notes can both aid you in understanding the material and me in better assessing your knowledge level.