Objects and Classes - Finding Objects and Classes - Static Feature

4 important questions on Objects and Classes - Finding Objects and Classes - Static Feature

By default in UML, all features are considered to be instance scoped. If you refer to an attribute, you can get the value that the instance has, myVideo.date retrieves the value the ....?

By default in UML, all features are considered to be instance scoped. If you refer to an attribute, you can get the value that the instance has, myVideo.date retrieves the value the myVideo instance holds for date.

To borrow a book, you use myBook.borrow() and the operation applies to the myBook instance
Report

You can also specific that a feature is a classifier-scoped feature.

What does this mean?

This means that the value is defined once for the class. For a static attribute, this can be thought of as each instance of the class always sharing the same value.

Alternatively, the class has a separate location for itself containing the attribute and value
Report

What is a static operation?

A static operation is an operation that applies to the class as a whole. We show static (class-scope) by underlining the feature.
Report

What static obejects do we see in this figure?

In Fig. 6.3, we depict both a static attribute (numPatron) and a static operation (incrementnumPatron).

We would imagine in a fully detailed Patron, the incrementnumPatron would be called during the creation of a new Patron.

Thus, the value of numPatron would be the total count of the number of Patrons in the library.


The underline is an example of an attribute and operation adornment.
Report

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart