".NET" Programming Language - Overview & Architecture

Started by sivaji, Jan 11, 2008, 11:20 AM

Previous topic - Next topic

sivaji

Overview

    *  "Looking Back ..."
    *  ASP.NET Core Concepts

Looking Back: Active Server Pages

    *  What is ASP?

            *   Server-side scripting technology
            *   Files containing HTML and scripting code
            *   Access via HTTP requests
            *   Scripting code is interpreted on server side
   
    *  What can I do with ASP?

            *   Easily and quickly create simple Web applications
            *   Generate dynamic Web content
            *   Client-side scripting for validation
            *   Access COM components to extend functionality
                       * Databases

What's Wrong with That?

            *  Mixes layout (HTML) and logic (scripting code)
            *  Interpreting ASP code leads to performance loss
            *  Uses scripting languages that are not strongly typed
                       *   Microsoft JScript®
                       *   Microsoft Visual Basic® Scripting Edition (VBScript)
            *  Browser compatibility
            *  No real state management
                       *   No state sharing across Web farms
                       *   State is lost when IIS fails
            *  Update files only when server is down

ASP.NET Core Concepts

            *  Web development platform
            *  New programming model

ASP.NET Core Concepts

            *  Separate layout and business logic
            *  Use services provided by the .NET Framework
            *  Code is compiled the first time a page is requested
            *  State management
            *  Make use of programming languages
                      *   Cross-language integration
            *  Update files while the server is running!

Architecture

            *  The .NET Framework Architecture
            *  Web Application Model
            *  Configuration
            *  Class Hierarchy

The .NET Framework Architecture Web Application Model HTTP Runtime

            *  Managed code
                      *   Runs within an unmanaged host process
            *  Aims for 100% availability
                      *   Asynchronously processes all requests
                      *   Multithreaded
            *  Replaces ISAPI
                      *   Internet Server Application Programming Interface

HTTP Module Pipeline

            *  HTTP module pipeline
                      *   Managed classes
                      *   Each module implements a specific interface
                                  *  For example: state management or security
                      *   All requests are routed through the same pipeline
                      *   Add modules through Web.Config
            *  Request handler
                      *   Managed classes
                      *   Multiple request handlers for one application
                                   *  But only one per URL

Hierarchical Configuration

           *  Configuration file: Web.Config
                      *   XML-based, human readable and writeable
                      *   File is kept within the application directory
                      *   Changes are automatically detected
           *  Influence on the actual dir and all subs
                      *   But: <location path="...">
                      *   Lock settings with attribute: allowOverride="false"

Web.Config sample

<configuration>
  <configSections>
    <sectionGroup name="system.web">
      <section name="httpmodules"
           type="System.Web.Configuration.
                 HttpModulesConfigurationHandler"/>
      <section name="sessionstate"
           type="System.Web.SessionState.
                 SessionStateSectionHandler"/>
    </sectionGroup>
  </configSections>

  <system.web>
    <httpmodules>
      <add type="System.Web.State.SessionStateModule"
           name="Session">
    </httpmodules>
    <sessionstate cookieless="true" timeout="20"/>
  <system.web>
</configuration>

Custom Configuration

           *  Default machine.config (!) file is placed in
                      *   %windir%\Microsoft.NET\Framework\<version>\CONFIG
                      *   Standard set of configuration section handlers
                                   *  Browser capabilities, custom error messages,and so on
           *  Customized configuration
                      *   Extend the set of section handlers with your own
                      *   Implement the interface:
                                  System.Configuration.IConfigurationSectionHandler
           *  Problems with
                      *   Virtual directories and non-ASP.NET files

Class Hierarchy

           *  Namespaces
                      *   Hierarchically structured
                      *   Dot-syntax, grouping classes logically
                      *   Abstract base classes and class implementations
                                 *  You are free to implement your own
           *   Sample: System.Web.UI.WebControls.Button
                                  namespace          class name
           *   How to use namespaces:
                      *  using MyAlias = System.Web.UI.WebControls
Am now @ Chennai