You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003.
The development and deployment of client applications forms part of your responsibilities at Domain.com. You are busy developing a Microsoft Windows Form application that will access a Microsoft.NET Remoting component. In the event of a user clicking the Print button on a form, the application must call a remote method asynchronously to print a batch of invoices. The application you are developing must allow users the ability to perform other tasks while the invoices are being printed. Once all of the invoices have been printed, the application must interrupt the user by displaying a message box, notifying the user of the status of the invoice printing.
You thus need to implement the functionality to meet all these requirements.
What should you do?
A.
A callback should be implemented.
B.
A semaphone should be implemented.
C.
Blocking should be implemented.
D.
Polling should be implemented.
Explanation:
A callback will allow you to configure a method that can be executed on another thread when the asynchronous operation completes. This will prevent you from having to block the current thread until the asynchronous operation completes, thus allowing the users to ability to perform other tasks with the application.
Incorrect answers:
B: A semaphone will allow you to implement access control to a shared resource and in this case there is no mention of limiting and exercising any access control.
C: Blocking will halt the current thread until an asynchronous operation is completed and would thus prevent users from performing other tasks while the asynchronous operation is taking place.
D: Polling is used when the application itself must perform additional processing until an asynchronous operation is completed. But in this case the users will be performing the additional tasks and not the application itself.