473,425 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

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 3155
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.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.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.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP04.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.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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**************@naespamfreenet.co.uk> wrote in message
news:O%****************@TK2MSFTNGP02.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********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP04.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.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.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.com" 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.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.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.com" 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.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.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
Your users will need the right JAVA plug-in, but the browser will
prompt them for it.


Or probably just not work!!!
Apr 7 '06 #11

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

Similar topics

4
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...
53
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...
131
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...
10
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...
136
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...
12
by: nib | last post by:
What kind of problems is c best at solving?
4
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...
14
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...
3
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.