60 likes | 74 Views
Create Java implementations for tree and sort case studies incorporating various design patterns. Work in pairs, revise based on feedback, and submit electronic and written versions. Final solutions organized under CSE870 directory.
E N D
Homework #5 • Create Java implementations for • Tree Case Study • Sort Case Study • For both case studies, add additional capability that illustrates one or more patterns not already used in case study (e.g. Iterator for Tree, Visitor for Sort) • Extra Credit: Sort Verifier Case Study • Work in pairs • Final solutions should be placed in subdirectories under CSE870 directory, indexed by the last names of each pair
Preparatory Exercise • Break up in pairs • Take assigned code segments and give line-by-line comment • Present the commented version in class. • Revise based on class feedback • Submit electronic and written version for collection and distribution to class mates
Tree Case Study Ramy, Xing • Tree.h/Tree.C (p. 15/37-38) • Node.h (p. 14) • Int_Node.h/Int_Node.C (p. 16/20) • Unary_Node.h/Unary_Node.C (p. 17/21) • Binary_Node.h/Binary_Node.C (p. 18/22) • Factory Pattern Implementation for initializing Node subclasses (p. 26) • Bridge Pattern for printing subtrees (p. 31, short) • Adapter Pattern integrates Tree print with C++ I/O Streams (p. 36) • Main Program (p. 39) • Ternary_Node.h/Ternary_Node.C (p. 42/43-44) Biyani, Mehta Vincent, Bao Huang, King, Liu 3 Arun, Tony
System Sort Case Study Brown, Zhu • Detailed Format for Solution (p. 58) • Input Class (p. 61-62) • Implementation of Strategy Pattern (p. 73, 74) • Dynamic Array (p. 82) • Access_Table Class (p. 83) Explain how the 3 implement theFacade and Adapter • Sort_AT_Adapter Class (p. 86) • Options Class (p. 91-92) • Using the Options Class (p. 93) (singleton pattern) • Using the Double-Checked Locking Optimization Pattern (p. 97-98) • Using the Bridge Pattern (p. 103) • Using the Factory Pattern (p. 108-109) • Using the Factory Method Pattern for the Sort_AT_Adapter (p. 114) • Implementing the Factory Pattern (p. 115-116) • Iterator Pattern (p. 118-120) Middlin Malinak, Post 3 Kirit, James Hewitt, Kunath Joy, Latif, Kalaskar 3
Sample Format for Commented Code //******************************************************* // Tree.h: Interface File for Tree Class (mathematical expression Tree) // Created by D. Schmidt and D. Levine // Modified by Student Name, Date, Michigan State University // as part of CSE 870 (Advanced Software Engineering Course, Sp01) // Point of Contact: Dr. Betty Cheng (chengb@cse.msu.edu) //******************************************************* #include "Node.h“ // Include Node interface file //Describes the Tree edges and acts as a Factory for producing…. class Tree { public: // The following operations are // available for use by other entities. // Factory operations … Tree (int); // comment Tree (const char *, Tree &); // comment Tree (const char *, Tree &, Tree &); // comment Tree (const Tree &t); // Copy constructor … void operator= (const Tree &t); // Assignment …. ~Tree (void); // Destructor ….