Assignment No. 3 PTT 2011

(C) 2011 — Software Languages Team, University of Koblenz-Landau

Navigation

The PTT course

Check-in deadline

May 20, 2011 (End Of Day, Koblenz timezone)

Variation 1

Title

A schema adaptation for XML-data binding

Instructions

Start from 101implementation:jaxbComposition. Revise the schema so that the extra manager element is no longer used in the declaration of department, but instead the manager is assumed to be one of the many employee elements that a department carries anyhow. To this end, add a child element to the declaration for employee so that a boolean component, such as isManager, indicates as to whether or not the employee is a manager. Then, re-generate the schema-derived classes and fix all the code for cut and total. Also, add a method that only totals manager salaries.

Variation 2

Title

An object-model mapping on top of XML-data binding

Instructions

Start from 101implementation:jaxbComposition. Design POJO classes MyCompany, MyDepartment and MyEmployee that are similar to the schema-derived classes Company, Department and Employee — only that there is no designated manager property in the MyDepartment class, but instead the manager should occur in the employee list, and it should be identified with a designated boolean flag such as isManager. Define methods toMine and fromMine (on the My… classes or elsewhere) to map objects from the schema-derived classes to the My… classes and vice versa. Define cut and total through instance methods on the My… classes. Also, add a method that only totals manager salaries.