The Address Book model consists of an AddressBook class associated with an Entry class. We will create these classes on a Class diagram.


To create the Address Book class diagram


  1. Create a new Alf project as described in Alf project template, using the name Address Book for the project.
  2. In the new project, click the Create Diagram button on the toolbar and select Class Diagram. Name the diagram Address Book.
  3. Use the Class Diagram toolbar to create a new Class named AddressBook.

    For simplicity in later code, we are using camel case for the class name here, with no space between "Address" and "Book".

  4. Create a another new Class named Entry.
  5. Click on the next to Composition on the Class Diagram toolbar and select Directed Composition.
  6. Draw an Association from AddressBook to Entry on the Class diagram.
  7. Right click on the Entry end of the Association and select Edit Name.
  8. Type entries for the Association end name.

  9. Right click on the entries Association end and select the multiplicity 0..*.

Next: Creating Entry attributes

Related pages