Best way to implement extremely heavy calculation?

Discussion in 'ASP .Net' started by roygon, Apr 5, 2006.

  1. roygon

    roygon Guest

    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
     
    roygon, Apr 5, 2006
    #1
    1. Advertising

  2. roygon

    Kevin Frey Guest

    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" <> wrote in message
    news:...
    > 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
    >
     
    Kevin Frey, Apr 6, 2006
    #2
    1. Advertising

  3. roygon

    roygon Guest

    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
     
    roygon, Apr 6, 2006
    #3
  4. roygon

    Alex D. Guest

    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" <> wrote in message
    news:...
    > 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
    >
     
    Alex D., Apr 6, 2006
    #4
  5. 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." <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:...
    >> 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
    >>

    >
    >
     
    William Buchanan, Apr 6, 2006
    #5
  6. roygon

    roygon Guest

    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
     
    roygon, Apr 6, 2006
    #6
  7. roygon

    Alex D. Guest

    I couldnt agree more.

    "William Buchanan" <> wrote in message
    news:O%...
    >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." <> wrote in message
    > news:%...
    >> 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" <> wrote in message
    >> news:...
    >>> 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
    >>>

    >>
    >>

    >
    >
     
    Alex D., Apr 6, 2006
    #7
  8. roygon

    Alex D. Guest

    also there are some javascript code scramblers out there. google for
    "javascript scrambler"

    "roygon" <> wrote in message
    news:...
    >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
    >
     
    Alex D., Apr 6, 2006
    #8
  9. roygon

    Kevin Frey Guest

    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" <> wrote in message
    news:...
    >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
    >
     
    Kevin Frey, Apr 7, 2006
    #9
  10. roygon

    Russell Guest

    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" <> wrote in message
    > news:...
    > >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
    > >
     
    Russell, Apr 7, 2006
    #10

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


    Or probably just not work!!!
     
    William Buchanan, Apr 7, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve C. Orr, MCSD

    Re: Best way to implement ASP Session variables

    Steve C. Orr, MCSD, Jul 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    Steve C. Orr, MCSD
    Jul 16, 2003
  2. Kevin Spencer

    Re: BEST WAY TO implement shopping basket

    Kevin Spencer, Aug 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    406
    Kevin Spencer
    Aug 5, 2003
  3. David
    Replies:
    1
    Views:
    326
    Steve C. Orr [MVP, MCSD]
    Jun 3, 2004
  4. Minti
    Replies:
    4
    Views:
    879
    John C. Bollinger
    Feb 12, 2004
  5. Replies:
    5
    Views:
    1,297
    Scott Ellsworth
    Aug 11, 2005
Loading...

Share This Page