CPSC 3720 - DAY 21 MARCH 27, 2017 ================================================================================ IMPLEMENTATION -------------- Start in the lower levels of code Start with entity objects, then control objects, then boundry objects Testing entity objects on their own is easier, can make simple unit tests Having stable entity objects on their own is easier. Transeferring Class Diagrams Your class diagrams contains attributes and methods. Attributes are trivial to transfer to code Methods to convert multiplicity Methods are a little more difficult. You need to fill in code to accomplish the operation You have available: Name of the method Parameters Preconditions Postconditons Start with simpler getter and setter functions Start with stub functions for more complicated methods just return a hard coded value Use sequence diagrams for more info Sequence diagrams capture how the method is used Consider who is responsible for Preconditions Use unit tests ot verify post conditions. Mapping Associations Associations are UML Concepts: One-to-One One-to-Many Many-to-Many Qualified Associations Unidirectional or Bidirectional One-to-many associations Unidirectional Object A has a collection of type Object B Bidirectional Object B also has a reference to Object A Many-to-many associations Both objects have collections Must enforce bidirectionality Ex. tournaments can have multiple players and vice-versa Qualified Associations Have to use a map object to enforce the qualifier Association Classes Classes that contain information regarding a specific association Realized by adding as an object Add binary associations to the