开发者

Task Pattern for Java Web Applications

开发者 https://www.devze.com 2023-04-07 04:37 出处:网络
It\'s pretty common to see some flavor of the Task Pattern implemented on enterprise Swing applicati开发者_运维百科ons. It just makes sense: you\'ll have a lot of complex user commands that may take (

It's pretty common to see some flavor of the Task Pattern implemented on enterprise Swing applicati开发者_运维百科ons. It just makes sense: you'll have a lot of complex user commands that may take (differing) long periods of time to complete, and you can't expect your users to just sit there and wait.

But what about its practicality in a dynamic web application? Say I've got some web app that is heavily-based in AJAX so that users can issue all sorts of commands all over the page , and each of those commands get sent as standalone requests back to the server.

Is the task pattern an appropriate "request handling mechanism" for such an application, or are todays web containers so advanced & multi-threaded that doing so would be overkill?

Thanks in advance for any input!


I'm using @Sanjay T. Sharma's response as an answer. I'm doing this because I like to have an acceptance rate of 100% and it's pretty obvious that for some reason he/she does not want to answer this question.

(Sanjay's) Answer:

"...things which don't demand instant feedback to the user are better off being handled on independent servers/services while the "web container" can focus on serving web clients. Carrying on with your example, when the answer is accepted, the updation of "accept rate" isn't exactly "sent back" to the client after it finishes but is reflected in the underlying data store asynchronously which is showed to the user the next time a response is created for the user."

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号