CS 4773 Object Oriented Systems, Spring 2005 Project Overview
Editor model: A computer system, mainly OS file management
Editor:
- Either the main class or one created by the main class
- Keeps track of all files being edited (EditorFile)
- Each file has one or more editing sessions (EditingSession)
- When there are no more editing sessions, the file is removed.
- Responsibility: OpenEditingSession(String filename)
Creates a new EditorFile if one does not exist for this filename
Creates a new EditingSession for this EditorFile
- Responsibility: CloseEditingSession
Removes an EditingSession and the corresponding EditorFile if there
are no more editing sessions for this one.
- Think of this as a file management system for an operating system.
EditorFile:
- This corresponds to a memory image of a file
- Constructor takes a filename and reads in the correponding file
- Each has one or more editing sessions (EditingSession)
- Responsibilities include: getItem, replaceItem, appendItem, insertItem, etc.
- Responsible for synchronizing access from multiple editing sessions
- Responsible for saving the file when done
- Think of this as an "inode".
There is only one of these for each real file.
- We will assume that the entire file can be read into memory.
Otherwise, we can model this as a virtual memory system.
EditingSession:
- This contains an EditorFile and a cursor position.
- May also keep track of a range of items being displayed
- Has a thread for executing commands (CommandThread)
- Has an input user interface for inserting commands (UserInput)
- Has an output user interface for displaying results (UserOutput)
- Think of this as a "System File Table Entry".
Several of these may use the same inode.
UserInput:
- Has an EditingSession
- Responsibility: insert command
- Think of this as a file descriptor open for reading
UserOutput:
- Has an EditingSession
- Responsibility: a single item has changed
- Responsibility: a list of items have changed
- Responsibility: all items changed
- Responsibility: report an error to the user
- Think of this as a file descriptor open for writing
CommandThread
- Responsible for executing commands
- Should be able to handle command strings, raw commands and macro commands
- Maintains a queue of commands to execute
- Has support for a macro processor
- Uses a CommandDecoder to decode a command string into a raw command
- Think of this as a CPU performing an instruction cycle:
fetch, increment PC, decode, execute, handle interrupts
This has to be done in the context of a multiple CPU system
(multiple EditingSessions have multiple CommandThreads)
Macro
- This is like a subroutine of commands
- Creator takes the name of a file containing commands
- Responsibile for returning the next command to execute.
CommandDecoder
- Responsible for taking a command string and converting it to a
raw command.
RawCommand
- Has a CommandExecuter
- Has an CommandIdentifier
- Has the command parameters
- Responsibility: execute itself by calling the appropriate method in
the CommandExecuter
CommandExecuter
- Responsible for the execution of a collection of CommandIdentifiers
Inspector
- This sits on top the the entire editing system and allows the user
to examine what is going on.
- List all EditFiles, EditingSessions, CommandThreads
- Trace a CommandThread
- Trace a UserInput
- Trace a UserOutput
- Suspend and resume operation of a CommandThread or all CommandThreads
- Examine the macro stack of an CommandThread
- Abort a macro
- Produce printable logs
GUI
- Has a UserInput
- Has a UserOutput
- Has an Inspector
Prepare an index card containing the following:
- Your name
- Parts of the project you would like to work on
- Parts of the project you would like to avoid
- Class members you would like to work with in a group
- Class members you would like to avoid working with
This will be kept confidential.