Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Scripting vs Business Tier Code

Scripting vs Business Tier Code

Scheduled Pinned Locked Moved ASP.NET
csharpjavajavascriptvisual-studio
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pualee
    wrote on last edited by
    #1

    I have noticed that my controls can call functions either as Java Script or VB Script. However, I have been implementing event handlers in C# using a separate business layer. What are the tradeoffs? When would I want to use a script instead of compliled code (C# / VB.NET)? I think that perhaps the difference is the scripts run on client side and the C# runs server side? As far as a scripting language, are there any specific versions of javascript or VBscript that are used with .NET, or are any OK? Thanks in advance, just trying not to wipe out on the learning curve, Pualee

    C C I 3 Replies Last reply
    0
    • P Pualee

      I have noticed that my controls can call functions either as Java Script or VB Script. However, I have been implementing event handlers in C# using a separate business layer. What are the tradeoffs? When would I want to use a script instead of compliled code (C# / VB.NET)? I think that perhaps the difference is the scripts run on client side and the C# runs server side? As far as a scripting language, are there any specific versions of javascript or VBscript that are used with .NET, or are any OK? Thanks in advance, just trying not to wipe out on the learning curve, Pualee

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      JavaScript runs on client and has nothing to do with .NET neither has VBscript. Oh vbscript only runs on IE. When to use what? Well I think you should read some material on what JS is and can do, then you will see where to use it. For example: you will not wride DB code in JS, becaouse ju can't :D Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

      P C 2 Replies Last reply
      0
      • C CWIZO

        JavaScript runs on client and has nothing to do with .NET neither has VBscript. Oh vbscript only runs on IE. When to use what? Well I think you should read some material on what JS is and can do, then you will see where to use it. For example: you will not wride DB code in JS, becaouse ju can't :D Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

        P Offline
        P Offline
        Pualee
        wrote on last edited by
        #3

        Note to self: "avoid vbscript" :p Thanks for the quick reply, I've pretty much been following a pattern for another website, working on my own. Just trying to learn the ins and outs. It seems overwhelming trying to learn a new IDE, C#, ASP.NET, SQL, and now.... Javascript. Kind of the first time I've tried to pull this many different tools together, but I must say, I like it a lot! Pualee

        1 Reply Last reply
        0
        • C CWIZO

          JavaScript runs on client and has nothing to do with .NET neither has VBscript. Oh vbscript only runs on IE. When to use what? Well I think you should read some material on what JS is and can do, then you will see where to use it. For example: you will not wride DB code in JS, becaouse ju can't :D Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          I don't think that was his question. I think his question was more along the lines of how to deliniate the various layers in an application when implemeting the a layering pattern. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

          P 1 Reply Last reply
          0
          • C Colin Angus Mackay

            I don't think that was his question. I think his question was more along the lines of how to deliniate the various layers in an application when implemeting the a layering pattern. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

            P Offline
            P Offline
            Pualee
            wrote on last edited by
            #5

            Well, my question was answered somewhat, but your interpretation is nice as well. Any thoughts you can share? I know I want to put as much work as possible client side (to keep the server fast) but have to keep some processing on the server for interacting with the DB and possibly other services or applications. The J2EE model is very similar with their Application Servers. Session and Entity beans are used for the business layer while JSPs and CGIs are used for presentation. Perhaps the answer is that scripting is used for presentation, while everything else is deferred to C# event handlers? Pualee

            1 Reply Last reply
            0
            • P Pualee

              I have noticed that my controls can call functions either as Java Script or VB Script. However, I have been implementing event handlers in C# using a separate business layer. What are the tradeoffs? When would I want to use a script instead of compliled code (C# / VB.NET)? I think that perhaps the difference is the scripts run on client side and the C# runs server side? As far as a scripting language, are there any specific versions of javascript or VBscript that are used with .NET, or are any OK? Thanks in advance, just trying not to wipe out on the learning curve, Pualee

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              Pualee wrote:

              When would I want to use a script instead of compliled code (C# / VB.NET)?

              You would use a script when you need instant feedback on the user interface. For example, if you have a text box that is supposed to take a number then you can, in javascript, verify that the user is typing in numbers. That way the user doesn't have to wait for a round trip to the server to be told "you can only put numbers in that text box". However, you've probably noticed that doing that won't necessarily fit with your nice layered architecture. And this is a difficult question to answer. With things like AJAX it is possible to have some javascript call some code on the server (which would call into your business layer) and return a value to the javascript so that the page can be updated without the whole thing going back to the server. This offers a good compromise between the whole page going back and putting complex business logic in the javascript.

              Pualee wrote:

              I think that perhaps the difference is the scripts run on client side and the C# runs server side?

              Yes.

              Pualee wrote:

              As far as a scripting language, are there any specific versions of javascript or VBscript that are used with .NET, or are any OK?

              It isn't the version that is used with .NET that is important, but the version that is on the browser - as it is the browser that is doing the work. Does this help? ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

              1 Reply Last reply
              0
              • P Pualee

                I have noticed that my controls can call functions either as Java Script or VB Script. However, I have been implementing event handlers in C# using a separate business layer. What are the tradeoffs? When would I want to use a script instead of compliled code (C# / VB.NET)? I think that perhaps the difference is the scripts run on client side and the C# runs server side? As far as a scripting language, are there any specific versions of javascript or VBscript that are used with .NET, or are any OK? Thanks in advance, just trying not to wipe out on the learning curve, Pualee

                I Offline
                I Offline
                Ista
                wrote on last edited by
                #7

                Okay its like this. Layers are used to separate functionality. Thats all. Javascript does not or should it EVER manage business rules! Java script is for screen interactions only (UI) The UI layer is for formatting data carried fromm the business layer only The business layer takes information from the data layer. Builds the business object and performs all business validations needed. The data layer just returns data from your data source whatever that may me text files, sql, mysql, oracle, microaprocessors, rs-232 serial input/output, etc... don't let anyone tell you different 1 line of code equals many bugs. So don't write any!!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups