NetDraw is a diagramming program that allows multiple people to edit the same canvas simultaneously. This program was developed as a project for my Software Practicum class (CS 2335) at Georgia Tech. NetDraw consists of about 6,400 lines of code.
GoalsThis project was interesting because of the two main conflicting goals it was designed to satisfy:
- responsiveness of drawing
- determinism in the face of asynchronous concurrent modifications
- Scratch Layer
- shapes that the user is in the process of drawing appear here
- Pending Layer
- shapes that the user has finished drawing but have not been confirmed by the canvas server appear here
- Confirmed Layer
- shapes that the user has finished drawing and that have been confirmed by the canvas server appear here
- the canvas server is responsible for determining the final Z-order of shapes drawn at the time by different clients
Responsiveness is achieved because shapes that the user draws are immediately displayed in the Scratch and Pending layers. Determinism is achieved by letting the canvas server determine the final Z-order of drawn shapes, and then moving those shapes from the Pending layer to the Confirmed layer.