a self test question from e-learning

T

Tony Johansson

Hi!

At the end I have a question from e-learning.

The correcr answer according to e-learning is b. I thought c

When I selected c I got this message. That is not correct. The EndInvoke
method helps you find the results after the call is complete. The correct
answer is: Call GetData by using BeginInvoke.
Can somebody give me a url where I can see that answer b is correct becuse
in there has been wrong answer before.

You are developing an application that makes asynchronous calls to methods
to improve the perceived user interface performance. One of the methods that
you need to call asynchronously is GetData. How should you call GetData
asynchronously?

a. Call GetData directly.

b. Call GetData by using BeginInvoke.

c. Call GetData by using EndInvoke.

d. Call GetData by using another thread.
 
H

Harlan Messinger

Tony said:
Hi!

At the end I have a question from e-learning.

The correcr answer according to e-learning is b. I thought c

When I selected c I got this message. That is not correct. The EndInvoke
method helps you find the results after the call is complete. The correct
answer is: Call GetData by using BeginInvoke.
Can somebody give me a url where I can see that answer b is correct becuse
in there has been wrong answer before.

You are developing an application that makes asynchronous calls to methods
to improve the perceived user interface performance. One of the methods that
you need to call asynchronously is GetData. How should you call GetData
asynchronously?

a. Call GetData directly.

b. Call GetData by using BeginInvoke.

c. Call GetData by using EndInvoke.

d. Call GetData by using another thread.

EndInvoke doesn't call a method asynchronously, so it isn't the answer
to the question "How should you call GetData asynchronously?"
 
W

Willem van Rumpt

Hi!

At the end I have a question from e-learning.

The correcr answer according to e-learning is b. I thought c

When I selected c I got this message. That is not correct. The EndInvoke
method helps you find the results after the call is complete. The correct
answer is: Call GetData by using BeginInvoke.
Can somebody give me a url where I can see that answer b is correct becuse
in there has been wrong answer before.

You are developing an application that makes asynchronous calls to methods
to improve the perceived user interface performance. One of the methods that
you need to call asynchronously is GetData. How should you call GetData
asynchronously?

a. Call GetData directly.

b. Call GetData by using BeginInvoke.

c. Call GetData by using EndInvoke.

d. Call GetData by using another thread.

Ignoring the lack of detail and completeness in the e-learning question
(methods don't magically come with a Begin- and EndInvoke methods), the
answer according to the general asynchronous pattern using the BeginXXX
and EndXXX methods would result in answer B to be correct, not C.

The question states: You need to /make/ an asynchronous call.

You do that by using BeginInvoke, *not* by calling EndInvoke.

BeginXXXX /starts/ the process of calling the method, EndXXXX cleans up
resources, and allows you to inspect the results (if any). The GetData
method doesn't even play a visible role in the EndXXXX method.

IAsyncResult ar = BeginInvoke(GetData);
object result = EndInvoke(ar);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top