About Question enthuware.jwpv6.2.572 :

Moderator: admin

Post Reply
DesRenthuware
Posts: 32
Joined: Wed Aug 28, 2013 6:12 am
Contact:

About Question enthuware.jwpv6.2.572 :

Post by DesRenthuware »

Hi.

This question should be rated "evil". I knew there were (at least) two correct answers because during the course of my prep, I saw a tutorial on likely uses for async servlets which listed chat apps, db processes and webservices. Didn't (unfortunately) remember the example in the Servlet spec. SIGH....

Thanks.

navaare
Posts: 6
Joined: Thu Jan 01, 2015 2:27 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by navaare »

An online chat application.

Chat apps are very example of async communications which by definition users should not wait for response. There no good & better cases of usage a given solution but rather cases which can be used and it is ok or it is wrong and lead to issues. What is Enthuware team opinion?

admin
Site Admin
Posts: 9174
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by admin »

navaare wrote:An online chat application.

Chat apps are very example of async communications which by definition users should not wait for response. There no good & better cases of usage a given solution but rather cases which can be used and it is ok or it is wrong and lead to issues. What is Enthuware team opinion?
As mentioned in the explanation, it is a bit subjective and it is possible to use async api for chat application also. But I do not agree with your comment, "Chat apps are very example of async communications which by definition users should not wait for response. " because when you say user, you are thinking about actual person. But caller of the backend api is the client code. That code will need to get a response back from the server. The response is not a response from another user but the response from the servlet with pending messages or nothing or something else. So a chat application doesn't really need async api.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

navaare
Posts: 6
Joined: Thu Jan 01, 2015 2:27 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by navaare »

Question : In which of the following scenarios, the Servlet Asynchronous API would be useful?
Correct answer : "Calling a web service from within a servlet for fulfilling a request."
Wrong answer : "An online chat application."

My question is:

Is it always better(or there are more cases) to use Async API for calling other web Services within a servlet than at chat app ?
Moreover, I think we not always need Async API for calling web services internally (same as chat apps).

I would agree with current correct answer in case of putting anywhere an attention to delay for waiting on response. Why so? Because In that case it might sound like

"Calling a web service from within a servlet for fulfilling a request optimizing servicing delays."
Logically it would also cover using Async API for chat apps.

BTW I would avoid comparing development implementation(calling web services internally) with a client/business requirement(chat app). These seems to me a different areas for consideration.

admin
Site Admin
Posts: 9174
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by admin »

Again, as mentioned before, it is a subjective question and I already agreed with you in the previous post that async can be used for chat application. In fact, giving a name to an application (i.e a chat application or xyz application), the option becomes so vague that anything can be used. An application can do doing so many things and for some things async would be suitable and for something else it may not be. So saying that "async will be useful for a chat application" doesn't really mean much. That is why in our opinion this option is wrong.

Calling a web service is a precise activity without any confusion. Async call can be used for this purpose. That is why this option is right. Again, this is our opinion based on several things.

Please note that our only objective with this question here is to make you aware that such questions exist in the real exam as well. It is up to you to decide how you want to answer in the exam.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

navaare
Posts: 6
Joined: Thu Jan 01, 2015 2:27 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by navaare »

Somehow such approach is reasonable for me too. Thanks again Paul, for throughout explanation.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by himaiMinh »

How about downloading a large file?
The servlet can start an asynchronous process to download the file.

admin
Site Admin
Posts: 9174
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by admin »

Yes, possible. Please see the discussion above.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.572 :

Post by himaiMinh »

It seems that calling web services is more general than downloading a large file or chat application.
That is why calling web services is a safe option.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests