473,573 Members | 5,087 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way to implement extremely heavy calculation?

Hello,

I have a C# application that runs a relatively complex simulation
which, on a typical computer, could take up to 10 seconds. I am now
trying to port this application over to ASP.NET so obviously this
calculation needs to happen on the client. What is the best way to
implement this?

Some more information - all of the code needed to run this is located
in 3 or 4 C# dll's so at a high level I would simply look at the user
inputs on the web form and setup the simulation which would run on the
client and then have the ASP.NET page take the output and display the
results accordingly.

Now what is the most effective way to make this run on the client? If
I just include the classes in my project then it will run on the
server. Do I package this up into an ActiveX control that gets
deployed to the client? I do not want the code to be viewable (which I
think rules out using a client side scripting language) and I would not
want the user to be able to reuse this component in their own
application. It should be simple to run (so no client side
configuration beyond clicking on an "ok" prompt) and ideally would run
on any recent browser although I suspect that this last option won't be
doable.

Any help would be appreciated,

Roy

Apr 5 '06 #1
10 3174
I'm not sure why you say "obviously this calculation needs to happen on the
client" because it's not obvious from your post why it must be done on the
client, unless it is the computational load itself that you feel demands
this (in which case I'd be starting to think about how often each user might
be doing the simulation, and how many users you might have to give you an
indication of how beefy a server you might need).

But assuming you *do* need to do it on the client... you might wish to read
up on Smart Clients and see if that provides any help to you.

Kevin

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hello,

I have a C# application that runs a relatively complex simulation
which, on a typical computer, could take up to 10 seconds. I am now
trying to port this application over to ASP.NET so obviously this
calculation needs to happen on the client. What is the best way to
implement this?

Some more information - all of the code needed to run this is located
in 3 or 4 C# dll's so at a high level I would simply look at the user
inputs on the web form and setup the simulation which would run on the
client and then have the ASP.NET page take the output and display the
results accordingly.

Now what is the most effective way to make this run on the client? If
I just include the classes in my project then it will run on the
server. Do I package this up into an ActiveX control that gets
deployed to the client? I do not want the code to be viewable (which I
think rules out using a client side scripting language) and I would not
want the user to be able to reuse this component in their own
application. It should be simple to run (so no client side
configuration beyond clicking on an "ok" prompt) and ideally would run
on any recent browser although I suspect that this last option won't be
doable.

Any help would be appreciated,

Roy

Apr 6 '06 #2
Thanks for the response. Perhaps "obviously" was not the correct
wording given the description. The ten seconds of computing time is
essentially at 100% CPU usage and there will be many requests per
second. Additionally, server resources are a constraint. So, for the
sake of discussion, let's say that running this calculation on the
server is not an option.

I have briefly looked into smart clients but from what I have seen it
does not achieve what I am looking for. I already have a windows
client so for those people willing to download the application I
already have a good, working solution. What I wanted for this web
based implementation was broad access without a software download /
installation. Almost all of my .NET development has been on
traditional client applications so I'm not fully aware of all of my
options.

I think I have three options but I am not sure if this is correct and
if I fully understand the implications.

1) Build the app in Java - I believe that by doing this the user would
essentally download the app within the browser and execute the
appropriate code on their own PC without exposing the code itself.
There would be a bit of a learning curve though for me here since I
have minimal java experience and I don't believe I will be able to use
my C# components although I could be wrong here.

2) Use Atlas - no idea if this is an option but it seems like there
might be some facilities to run fairly complex code on the client side
through an Atlas application.

3) Build the processing code into ActiveX components that are hosted on
the page

Does anyone have feedback on what I think my options are and how
effective they might be and also, have I missed any obvious choices?

Thanks,

Roy

Apr 6 '06 #3
Well if you use Atlas I believe your calculations will still be runing in
server side since atlas is an AJAX implementation for .NET.
I think your optionas are activex, java applets, or exposing the source in a
javascript class. You also can use a combination of things you want to hide
from the user and things you can do in the client side things, so your cpu
ussage will be diveiden between client and server. does that makes sense?

alex.

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Thanks for the response. Perhaps "obviously" was not the correct
wording given the description. The ten seconds of computing time is
essentially at 100% CPU usage and there will be many requests per
second. Additionally, server resources are a constraint. So, for the
sake of discussion, let's say that running this calculation on the
server is not an option.

I have briefly looked into smart clients but from what I have seen it
does not achieve what I am looking for. I already have a windows
client so for those people willing to download the application I
already have a good, working solution. What I wanted for this web
based implementation was broad access without a software download /
installation. Almost all of my .NET development has been on
traditional client applications so I'm not fully aware of all of my
options.

I think I have three options but I am not sure if this is correct and
if I fully understand the implications.

1) Build the app in Java - I believe that by doing this the user would
essentally download the app within the browser and execute the
appropriate code on their own PC without exposing the code itself.
There would be a bit of a learning curve though for me here since I
have minimal java experience and I don't believe I will be able to use
my C# components although I could be wrong here.

2) Use Atlas - no idea if this is an option but it seems like there
might be some facilities to run fairly complex code on the client side
through an Atlas application.

3) Build the processing code into ActiveX components that are hosted on
the page

Does anyone have feedback on what I think my options are and how
effective they might be and also, have I missed any obvious choices?

Thanks,

Roy

Apr 6 '06 #4
I think that the Javascript idea is a good one (at least well worth looking
at). It would definately be the easiest to deploy.

The problem with all the other ideas is that you end up with loads of
security restrictions which stop them from working. This leaves you with the
problem of users needing to configure their browser properly. Also, with
Java, you need to have the correct version of the Java Virtual Machine
installed on the client. Off course they will also need to download the
ActiveX / Java applet.

Will
"Alex D." <al********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Well if you use Atlas I believe your calculations will still be runing in
server side since atlas is an AJAX implementation for .NET.
I think your optionas are activex, java applets, or exposing the source in
a javascript class. You also can use a combination of things you want to
hide from the user and things you can do in the client side things, so
your cpu ussage will be diveiden between client and server. does that
makes sense?

alex.

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Thanks for the response. Perhaps "obviously" was not the correct
wording given the description. The ten seconds of computing time is
essentially at 100% CPU usage and there will be many requests per
second. Additionally, server resources are a constraint. So, for the
sake of discussion, let's say that running this calculation on the
server is not an option.

I have briefly looked into smart clients but from what I have seen it
does not achieve what I am looking for. I already have a windows
client so for those people willing to download the application I
already have a good, working solution. What I wanted for this web
based implementation was broad access without a software download /
installation. Almost all of my .NET development has been on
traditional client applications so I'm not fully aware of all of my
options.

I think I have three options but I am not sure if this is correct and
if I fully understand the implications.

1) Build the app in Java - I believe that by doing this the user would
essentally download the app within the browser and execute the
appropriate code on their own PC without exposing the code itself.
There would be a bit of a learning curve though for me here since I
have minimal java experience and I don't believe I will be able to use
my C# components although I could be wrong here.

2) Use Atlas - no idea if this is an option but it seems like there
might be some facilities to run fairly complex code on the client side
through an Atlas application.

3) Build the processing code into ActiveX components that are hosted on
the page

Does anyone have feedback on what I think my options are and how
effective they might be and also, have I missed any obvious choices?

Thanks,

Roy


Apr 6 '06 #5
I was considering that but the issue I have with javascript is that the
heavy code that is required to run on the client is also where the
intellectual property of my application is located so I can't really
offload the processing without exposing my entire product if I use a
client script! So, unfortunately that option is out. It looks like an
ActiveX control is likely going to be my best bet.

Thanks,

Roy

Apr 6 '06 #6
I couldnt agree more.

"William Buchanan" <wi************ **@naespamfreen et.co.uk> wrote in message
news:O%******** ********@TK2MSF TNGP02.phx.gbl. ..
I think that the Javascript idea is a good one (at least well worth looking
at). It would definately be the easiest to deploy.

The problem with all the other ideas is that you end up with loads of
security restrictions which stop them from working. This leaves you with
the problem of users needing to configure their browser properly. Also,
with Java, you need to have the correct version of the Java Virtual
Machine installed on the client. Off course they will also need to
download the ActiveX / Java applet.

Will
"Alex D." <al********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Well if you use Atlas I believe your calculations will still be runing in
server side since atlas is an AJAX implementation for .NET.
I think your optionas are activex, java applets, or exposing the source
in a javascript class. You also can use a combination of things you want
to hide from the user and things you can do in the client side things, so
your cpu ussage will be diveiden between client and server. does that
makes sense?

alex.

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Thanks for the response. Perhaps "obviously" was not the correct
wording given the description. The ten seconds of computing time is
essentially at 100% CPU usage and there will be many requests per
second. Additionally, server resources are a constraint. So, for the
sake of discussion, let's say that running this calculation on the
server is not an option.

I have briefly looked into smart clients but from what I have seen it
does not achieve what I am looking for. I already have a windows
client so for those people willing to download the application I
already have a good, working solution. What I wanted for this web
based implementation was broad access without a software download /
installation. Almost all of my .NET development has been on
traditional client applications so I'm not fully aware of all of my
options.

I think I have three options but I am not sure if this is correct and
if I fully understand the implications.

1) Build the app in Java - I believe that by doing this the user would
essentally download the app within the browser and execute the
appropriate code on their own PC without exposing the code itself.
There would be a bit of a learning curve though for me here since I
have minimal java experience and I don't believe I will be able to use
my C# components although I could be wrong here.

2) Use Atlas - no idea if this is an option but it seems like there
might be some facilities to run fairly complex code on the client side
through an Atlas application.

3) Build the processing code into ActiveX components that are hosted on
the page

Does anyone have feedback on what I think my options are and how
effective they might be and also, have I missed any obvious choices?

Thanks,

Roy



Apr 6 '06 #7
also there are some javascript code scramblers out there. google for
"javascript scrambler"

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I was considering that but the issue I have with javascript is that the
heavy code that is required to run on the client is also where the
intellectual property of my application is located so I can't really
offload the processing without exposing my entire product if I use a
client script! So, unfortunately that option is out. It looks like an
ActiveX control is likely going to be my best bet.

Thanks,

Roy

Apr 6 '06 #8
I would still entertain running the computation on the server, or via an
Ajax call to a server, since there is no requirement that you only need
*one* server handling the requests.

Using a round-robin DNS for example, all clients might access
"site.company.c om" and be directed to one of many servers to service the
request. Assuming the computation is relatively self-contained, I think you
could do that easily.

I always try avoid tying myself too closely to a particular platform or
browser, which ActiveX is gonna do to you.

Kevin

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I was considering that but the issue I have with javascript is that the
heavy code that is required to run on the client is also where the
intellectual property of my application is located so I can't really
offload the processing without exposing my entire product if I use a
client script! So, unfortunately that option is out. It looks like an
ActiveX control is likely going to be my best bet.

Thanks,

Roy

Apr 7 '06 #9
If the code is all calculations, no local resource access, then the
JAVA security model will not be a problem.

If you know C#, porting your code to JAVA should be pretty easy. The
languages are VERY similar.

It's a little trickier getting data back from the applet to the form...
O'Reilly has several JAVA books, one covers this. Of course, the
applet could also post the data back itself.

Because ActiveX controls have little to no security framework, a lot of
people disable them.

Your users will need the right JAVA plug-in, but the browser will
prompt them for it.

--Russell

Kevin Frey wrote:
I would still entertain running the computation on the server, or via an
Ajax call to a server, since there is no requirement that you only need
*one* server handling the requests.

Using a round-robin DNS for example, all clients might access
"site.company.c om" and be directed to one of many servers to service the
request. Assuming the computation is relatively self-contained, I think you
could do that easily.

I always try avoid tying myself too closely to a particular platform or
browser, which ActiveX is gonna do to you.

Kevin

"roygon" <ro****@gmail.c om> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I was considering that but the issue I have with javascript is that the
heavy code that is required to run on the client is also where the
intellectual property of my application is located so I can't really
offload the processing without exposing my entire product if I use a
client script! So, unfortunately that option is out. It looks like an
ActiveX control is likely going to be my best bet.

Thanks,

Roy


Apr 7 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2016
by: Rasmus | last post by:
Hi. As partly novice in python I would like a piece of advise of how to implement (binary) trees the best way? Thanks in advance, Rasmus PS: Due to heavy spam reception (20.000+/week), I use a fake sender address.
53
6406
by: Paul Rubin | last post by:
I've been approached about writing a Windows app which will need a really professional looking GUI. Forget TKinter, this has to actually look good (real artists will be available to get the visual stuff right). Assuming I write in Python, what's the best toolkit to use? Some cost in implementation pain is tolerable if the finished interface...
131
21585
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately get some good real world examples. Fire away! :) Regards, Peter Foti
10
1688
by: Neil | last post by:
I need to get two values from a complex SQL statement which returns a single record and use those two values to update a single record in a table. In order to assign those two values to variables and then use those variables in the UPDATE statement, I created a cursor and used Fetch Next.... Into. This way, I only have to call the complex SQL...
136
9274
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to...
12
1869
by: nib | last post by:
What kind of problems is c best at solving?
4
3264
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the program is doing I show a window which contains a progress bar and a label. At some point during the execution the state of the calculation is changed,...
14
2816
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but...
3
3002
by: Abhishek Tripathi | last post by:
Hi, I am using a code similar to Database db = DatabaseFactory.CreateDatabase("MyDB") in every function of my DAL that interacts directly to database. But recently I have started getting connection pool errors. I think, it is because of incorrect usage pattern of Database Object of DAAB. I want to know that what should be the best...
0
7709
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8218
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7800
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5605
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3744
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1049
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.