Page 1
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1
Podcast Ch10-02
♦Title: Optimizations, Mapping Associations ♦Description: Some Optimization
Techniques; One-to-One Association; One-to-Many Association; Many-to-Many Association; Qualified Association
♦Participants: Barry Kurtz (instructor);
Brandon Winters, Sara Hyde, Cheng Vue, Dan Baehr (students)
♦Textbook: Object-Oriented Software
Engineering: Using UML, Patterns and Java by Bernd Bruegge and Allen H. Dutoit
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2
Some optimizations - 1
♦ Avoid frequent repeated association traversals
Multiple association traversals can lead to code such as method1().method2(). …. methodn() The sequence diagram can be used to identify such traversals See if a direct connection is possible to improve efficiency
♦ Try to make “many” associations more efficient
Try to use a qualified association to reduce multiplicity to one Try to use ordering or indexing to decrease access time
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3
Some optimizations - 2
♦ Try to avoid misplaced attributes
Inefficient due to the need for get and set methods Try bringing the attribute into the calling class
♦ Catch the result of expensive computations