-------------------------------------------------------------------------- Adaptive Object-Oriented Software Development Fall 2001 COM 3360 Karl Lieberherr --------------------------------------------------------------------------- Midterm YOUR NAME: --------------------------------------------------------------------------- Open book and open notes. Question 1: ================================================== UNKNOWN1 = AC UNKNOWN2 = Export | Around UNKNOWN3 = around UNKNOWN4 = do UNKNOWN5 = ParticipantDef UNKNOWN6 = void print() to Ident (PrintVisitor); UNKNOWN7 = Attachment UNKNOWN8 = start the traversal UNKNOWN9 = Collaboration UNKNOWN10 = CollabName UNKNOWN11 = LongName UNKNOWN12 = ShortName UNKNOWN13 = counts UNKNOWN14 = Imports UNKNOWN15 = Import_List UNKNOWN16 = ParticipantDef_List UNKNOWN17 = ParticipantDef UNKNOWN18 = IsParticipant UNKNOWN19 = ParticipantName UNKNOWN20 = ShortName UNKNOWN21 = adapterdef UNKNOWN22 = AdapterDef UNKNOWN23 = Collaboration UNKNOWN24 = name UNKNOWN25 = CollabName UNKNOWN26 = longname UNKNOWN27 = LongName UNKNOWN28 = ShortName UNKNOWN29 = result UNKNOWN30 = main UNKNOWN31 = y UNKNOWN32 = counts UNKNOWN33 = q UNKNOWN34 = Food UNKNOWN35 = Counted UNKNOWN36 = R UNKNOWN37 = S UNKNOWN38 = T UNKNOWN39 = gns UNKNOWN40 = counted UNKNOWN41 = gnsset_i Sketch for question 2: flatten class dictionary mark all nodes as unvisited from start class visit all nodes as follows for node v visit all outgoing construction edges and target nodes of those edges visit immediate superclasses visit immediate subclasses unless v is only reached by inheritance edges if some nodes remian unvisited: cd is not connected The cd to use is similar to the cd for cds. Extend it to store at each Adjacency the super classes. Some traversals: to mark as unvisited: from CdGraph to Adjacency To store super classes: from CdGraph through Adjacency through Alternat through Vertex to-stop Adjacency Visitor: before Adjacency : source = lhs before second Adjacency : add source as additional super class Path definition forbids to go down a subclass edge after a inheritance edge