Object/Class System Specification: (using CRC cards) CLASS: Definition: a template for creating objects Responsibilities: construct object, destroy object, locate method, execute method, locate instance variable Collaborators: class tree, memory manager, method searcher, object Attributes: instance variable list, method list, method code, parent class OBJECT: (parent = CLASS) Definition: an instance of a class Responsibilities: receive incoming message, send outgoing message Collaborators: class Attributes: member_class, instance variable pointer Outgoing Messages: member_class.locate_method(incoming_method_name) MESSAGE: (parent = OBJECT) Definition: a message that is to be passed from one object to another Responsibilities: send message to receiver object Collaborators: memory manager Attributes: sender, receiver, method_name, message_length, message_pointer Note: data at message pointer contains a list of argument names followed by their values. ex: var1 8 var2 16. this data area was acquired from the memory manager, who ensures that nobody else can access it. MEMORY MANAGER: Definition: a resource controller which controls all allocation, deallocation, reading, and writing of memory blocks. You are assigned an access key when you request a block, and must supply that key in order to read or write the block. You can pass the key to another object if that object needs to access the block. Responsibilities: allocate block, deallocate block, write bytes to block, read bytes from block, move data from one block to another block, garbage collection Collaborators: none Attributes: block name, block access key, block address, block length, memory map Example messages: mem_mgr.POKE (block name='eric', block access key='123', offset=5,bytevalue=7f) - stores the value 7f in address of 'eric'+5 assuming proper validations: block access key correct, offset within range. mem_mgr.PEEK (block_name='eric', block access key='123', offset=5,myvariable='ericvalue') - returns value in address 'eric'+5 assuming proper validations: block access key correct, offset within range. If validations fail, sends message to Error Handler, which will decide whether to abend program, log the error, or ignore the error, or notify the user that a system problem occurred and give her the option to continue (with possible unpredictable conseqences) or ignore it. Default course of action should be to take a dump of the object, preserve the instruction pointer, abend the task gracefully, log the violation, sound an alarm in the support center, and beep the programmer responsible for maintenance of the module. of course, it may not be possible to find the cause of the problem - but a clue should be found in the last message received by the object, or the system trace table which would be searched to find all previous messages sent to that object. We are also assuming that every program in the system is conforming to this memory management protocol, and that it has become a standard which is enforced by a quality control group that is effective in banning programs which don't follow standards from creeping into the sacred production environment. INTERRUPT MANAGER: Definition: a resource controller which detects all hardware interrupts and sends messages to the appropriate interrupt handlers. APPLICATION CLASSES: ==================== MIDI FILE FORMAT PLAYER MF FORMAT 0 PLAYER MF FORMAT 1 PLAYER MIDI FILE FORMAT 1 TRACK MANAGER MIDI FILE FORMAT 1 TEMPO MAP READER MIDI FILE FORMAT 1 TRACK LOADER/RELOADER Track Loader/Reloader (collaborator: memory manager) Prodos MLI Interface MIDI Output Queue MIDI Output Filter/Router MIDI OUT interface MIDI Display Manager (can control several types of displays: piano, music notation, midi events, control changes, program changes) User Control Panel MIDI IN interface Sequencer MIDI Mapper Timer System Interrupt Manager MIDI IN Interrupt Handler Timer Interrupt Handler System Activity Scheduler MIDI Input Queue