?
Solved

Update progress bar in presentation layer

Posted on 2005-04-17
6
Medium Priority
?
599 Views
Last Modified: 2008-03-03
I have a calculation in business layer which take about 5 minutes in a remote server.  The method to do the calculation is placed in a web service.
The calculation will be started by user in presentation layer with a progress bar showing the progress of the calculation.  What is the proper way to make call back and update the progress bar?
0
Comment
Question by:kennon2000
  • 4
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
ptmcomp earned 800 total points
ID: 13805347
I would not use call backs in this case. Use an async call to invoke the method then use a timer and call a remote method "GetProgress". For the completion of the async call you can either use polling or a completion event.
0
 

Author Comment

by:kennon2000
ID: 13808199
Why not use call back?
I understand your approach, but I am not sophicated in the overall skill.  Is there any code example/code that I can learn the skills?
Thanks.
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 13810859
Callbacks from a remoteserver are quiet akward and it will not work if you have a firewall between or if you are using NAT.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:ptmcomp
ID: 13810871
And how do you want to decide when you need to update the progress bar? You should do this by a timer and not after each step else if you have many little steps your network will be busy and the progress bar flickering.
0
 

Author Comment

by:kennon2000
ID: 13813491
I see.
Can I just update a property( say int Progress) within the remote method TimeConsumingMethod() in the same web service class.  And simply get Progress in the timer tick()?
 
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 13817475
If you have one distinct client and you synchronize (simple a lock will do) the access to the progress property, yes. If you have several sessions you need to reference your remote object to get its state.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question