Give an example to show how a Java client will access the attribute giving the number of tasks in the Task Bag object. In what respects does an attribute differ from an instance variable of an object?
What will be an ideal response?
Assume the IDL attribute was called numberOfTasks. Then the client uses the method numberOfTasks to access this attribute. e.g.
``` taskbagRef.numberOfTasks(); ```
Attributes indicate methods that a client can invoke in a CORBA object. They do not allow the client to make any assumption about the storage used in the CORBA object, whereas an instance variable declares the type of a variable. An attribute may be implemented as a variable or it may be a method that calculates the result. Either way, the client invokes a method and the server implements it.
You might also like to view...
When you do not assign widths for tables and columns, modern Web browsers automatically set the column widths to the widest ____________________ content in the cells.
Fill in the blank(s) with the appropriate word(s).
To show the document with all the changes, in the Tracking group, click the Final Showing Markup arrow, and then click ____.
A. Final B. Finish C. Merge D. Show