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 as in the answer to Exercise 20.1. 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...
To use the map class, you must include
a. #include
Wiretapping involves the capability of authorized users to search through storage, directories, or files for private information.
Answer the following statement true (T) or false (F)