Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

Assignment 8: Mapping models to code

Due at Saturday, July 4th, 14:00

Task 18: Inheritance

2 points
The sample solution is online.

Look at the two class diagrams. You should recognize one from Task 16. In both cases the legacy code of MovieList was refactored. What can be the problem, if a programmer replaces MovieList with PublicMovieList, as it is possible in the second example?

  • Write a small Java code sample where exchanging MovieList with PublicMovieList leads to a problem.
  • What is the name of the principle violated with the implementation of the second example?

Task 19: OCL constraints

4 points
The sample solution is online.

The MMM system needs to be secured against losses from scammers and unreliable customers. Write for each of the following rules an OCL constraint for the given UML model:

  • A user may only rent one copy of the same movie.
  • Only 5% of a store's inventory may be in the hands of untrusted or underaged users.

Task 20: JPA

6 points

Check out the project A08T20_ActorsAndMovies. There are JPA related annotations and method calls missing. Insert them and verify your implementation with the text output.

You will need additional documentation for JPA, for example this reference
teaching/lectures/oosc/2009/assignment_8.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019