These are flashcards an notes made by students on topics like 'operation', 'query' and 'attribute', originating from:

- Michael Jesse Chonoles
ISBN-10 0128096403 ISBN-13 9780128096406
1335 Flashcards & Notes
  • This + 400k other summaries, also in PDF!
  • 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

Study Cards on operation, query, attribute

We can tag an attribute or an operation with a ....... that changes some, usually minor, interpretation of the member.
We can tag an attribute or an operation with a modifier that changes some, usually minor, interpretation of the member.
  
Report
It is also possible to assign a default value to an operation’s arguments.

What do we see in the figure?
In Fig. 6.12, we supply a default Boolean Value, using a Boolean Literal, False, for the isRenew argument.

We only need to change the argument for a when we are renewing the book at the same time.
Report
Flagging an operation as a query, is like flagging an attribute as?
A query is an operation that is not allowed to change any of the attributes values of the instance.

Flagging an operation as a query, like flagging an attribute as readOnly, indicates your intention that the only thing that changes after the operation is the return value from the call.

A query has no side effects,
Report
What does the query in the figure means?
This, like isReadOnly, is a modeling indication and is not always enforced by any generated code, see Fig. 6.13 for a use of {query}.


The use of query in the figure indicates that the operation isAdult() will not change any attribute of Member, or anything else other than returning the Boolean value.

Query is an operation property, which appears as the adornment {query}.
Report
  • Higher grades + faster learning
  • Don't study anything twice
  • 100% sure, 100% understanding
Discover Study Smart