Exercise 1: Creating Diagrams

Effective diagramming is crucial for the communication of ideas in software engineering. This exercise explores some of the different ways in which you can draw diagrams for the work you do in COMP5911M.

Preparation

  1. Download exercise1.zip and unzip the archive. This will give you a subdirectory named exercise1, containing three Java classes.

  2. The three classes come from an imaginary car rental application that generates a statement of the rental fees owed by a customer. Read exercise1/README.md for more details of this application. Then examine the three classes, to learn their structure and relationships.

Hand-Drawn Diagrams

Agile software development processes encourage the use of lightweight modelling techniques, in which diagrams are often sketched on paper or a whiteboard, or created using Post-it Notes. Important diagrams can be captured as digital photos which are then shared via a wiki.

  1. Sketch on paper a simple UML class diagram that represents the relationship between Customer, Rental and Car.

  2. Sketch on paper a simple UML sequence diagram that shows what happens when the statement() method is invoked on a Customer object.

  3. Scan your diagrams, or photograph them using your phone. Transfer the resulting images to the exercise 1 directory on your PC or a SoC Linux machine. If necessary, use image editing software to adjust brightness, contrast, sharpness. Your goal should be to make the diagrams as clear as possible.

diagrams.net

diagrams.net is a free drawing tool than can produce many different types of diagram, including UML diagrams. It can be used online in a web browser but also provides a desktop app that can be used offline.

  1. Run the application. Use the Change storage link to choose ‘Device’ as the preferred storage medium for diagrams. (This means it will download diagram files to the machine you are using, rather than storing them in the cloud.) Then click the Create New Diagram button.

  2. The next dialog allows you to start from a blank diagram or from one of a number of different templates, of which several are for UML.

    Template selection dialog for diagrams.net

    diagrams.net templates

    In this case, just select ‘Blank Diagram’ and then click the Create button. When prompted for a save location, select your exercise1 directory, enter rental.drawio as the filename and click Save.

  3. Choose HelpQuick Start Video… from the menubar to watch a short (1m35s) video on how to draw diagrams. You can also use the Help menu to view keyboard shortcuts or search for help on a topic.

  4. Open the UML symbol library from the list of symbol libraries on the left of the screen:

    UML symbol library provided by diagrams.net

    UML symbol library

    Use these symbols to help you draw another version of the class diagram for the car rental application.

  5. Choose FileSave to save the diagram file. Make sure the saved file is in your exercise1 directory.

  6. Use FileExport asPNG… to create an image of your diagram1. Click Export and choose ‘Device’ as the destination for the image. Specify rental-classes.png as the filename. Make sure that the file is saved to your exercise1 directory.

  7. Optional: Click on the ‘+’ button at the bottom-left of the screen to add a new blank page to your diagram. Use this to experiment with drawing a sequence diagram equivalent to the one you created earlier on paper. When you are happy with the result, save the document to the same file that you used before (rental.drawio, in your exercise1 directory).

    Export the diagram to a PNG image named rental-sequence.png, again in your exercise1 directory.

Other Tools

There are many other diagramming tools available. If you have the inclination, investigate one or more of the ones listed below.


  1. You may need to specify a larger Zoom factor (e.g., 200%) to ensure that the exported image has sufficient resolution to be fully legible. ↩︎