Assignment 1: Object Oriented Programming (release date: Mo 14.04., due date: Su 20.04)

How to start

  • Check out A1T01-T04_University from you team's repository (https://svn.iai.uni-bonn.de/repos/IAI_Software/se/oosc2008ss/team#).
  • We expect all your solutions in the folder src.
  • You should never change any class in the tst folder.
  • The tasks are described in more detail in the mentioned files in the tst folder.
  • The first thing you should do is to run the tests1).
  • You will see that 11 of 14 tests are failing 2). This means that we made assertions about the base code that are not true for the current implementation.
  • After you solved all tasks 12 of 14 tests should be successful 3). If you decide to solve even the extra tasks everything should be green 4) and there should be even more tests.
  • It's ok to work on these tasks during the tutorial sessions with Matthias Berg.

Task 01: Persons and Addresses (Identity vs Equality of Objects)

After you have solved this task, you should be able to understand and explain:

  • … the difference between the two concepts equality and identity of objects.
  • See A1T01_AddressTest in the package people in the tst folder.

Task 02: Number Generators (Implementing Interfaces)

After you have solved this task, you should be able to understand and explain:

  • … how you write classes that implement interfaces.
  • … how you write methods that can work on any of these classes.
  • See A1T02_NumberGeneratorTest in the package numbers in the tst folder.

Task 03: Students and Professors are Persons (Class Inheritance)

After you have solved this task, you should be able to understand and explain:

  • … how you can create subclasses.
  • … how class extension relates to interface implementation.
  • … how you can make use of inheritance to reuse common functionality.
  • See A1T03_PersonsStudentsProfessors in the package university in the tst folder.

Task 04: The University (Using Frameworks)

After you have solved this task, you should be able to understand and explain:

  • … how to let your classes implement interfaces so that framework classes know what to expect from them.
  • … how to configure framework classes, so that you can extend their behavior without modifying them.
  • See A1T04_StudentTest in the package university in the tst folder.

Extra Tasks

If you're done with all the tasks above and you still have time and energy left you may want to work on …

  • A1X01_AddressExtraTest to learn more about hash codes.
  • A1X02_NumberGeneratorExtraTest to learn more about exceptions.
  • A1X04_RegistrarsOfficeTest to learn more about tests.

Screenshots

teaching/lectures/oosc/2008/exercises/assignment1.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2020