Comments

  • Method comments; for implementation details.

  • slot comments, for what the slot is about.

  • Object somments, for what the object is about.

Comments

We should also add some comments. We have three places to attach comments: in a method, on a slot, and on an object.

Here are some guidelines as to which to use:

  • If the comment is about the implementation of a method, put it in the method.
    Comments are enclosed in double quotes.

  • If it applies to the purpose of a slot, put it on the slot.
    Use the `Show comment' middle-button menu item from the slot menu.

  • If it applies to the purpose of an object, put it on the object.
    Use the `Show comment' middle-button menu item from the object's header.

If a slot or object has a comment, then a small button (with a quote mark in it) appears at the left. Click the button to expose the comment; you may edit the comment directly.

When you declare a slot to be public, you are invited to enter a comment.

When you copy an object you copy the comments too, so don't make the comment applicable to only the prototype!

[ Previous ] [ Index ] [ Next ]