Integrating CFML with ASP.NET - PowerPoint PPT Presentation

About This Presentation
Title:

Integrating CFML with ASP.NET

Description:

Simple web page (hello.aspx) Simple web server (hello.asmx) Control and event ... aspx pages are compiled to HttpHandlers. HttpHandlers are like Java servlets ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 24
Provided by: vinc74
Category:
Tags: asp | cfml | net | aspx | integrating

less

Transcript and Presenter's Notes

Title: Integrating CFML with ASP.NET


1
Integrating CFML with ASP.NET
  • Vince Bonfanti
  • President
  • New Atlanta Communications, LLC

2
Introduction
  • Vince Bonfanti
  • President and co-founder of New Atlanta
  • ServletExec, Java Servlet/JSP engine (1997)
  • JTurbo, JDBC driver for MS SQL Server (1998)
  • BlueDragon, CFML/JSP server (2002)
  • Soon to be .NET-based
  • vince_at_newatlanta.com
  • Mention CFUN on subject or message body

3
Topics
  • What is the .NET Framework?
  • compare/contrast to Java
  • What is ASP.NET?
  • What is BlueDragon for .NET?
  • How do we integrate CFML pages into ASP.NET web
    applications?
  • Why deploy CFML on .NET servers?

4
.NET Framework Overview
  • The new way to program on Windows, replacing
    C/C and Visual Basic
  • Installed as a standard component of Windows 2003
    Server, can be installed on Window NT/2000/XP
  • Primarily useful for server-based applications,
    can also be used for client (desktop)

5
.NET Framework Goals
  • Object-oriented, type-safe, garbage-collected,
    secure, etc.
  • Increases programmer productivity and improves
    application reliability, especially for complex
    server-based enterprise applications
  • Similar goals as Java (without write-once-run-anyw
    here)
  • Similar methods to achieve those goals

6
.NET Framework Components
  • Common Language Runtime (CLR)
  • like Java Virtual Machine (VM)
  • Microsoft Intermediate Language (IL)
  • like Java byte code
  • .dll (assemblies) or .exe versus .class or .jar
  • .NET Framework Class Libraries (FCL)
  • like Java class libraries
  • Multiple programming languages
  • C, Visual Basic.NET, Managed C, J

7
.NET versus Java
Java
byte code (VM)
IL (CLR)
Windows
  • single platform
  • single vendor
  • higher platform integration
  • lower complexity
  • lower cost
  • multi-platform, multi-vendor
  • lower platform integration
  • higher complexity, higher cost

8
ASP.NET Overview
  • The way to write web applications and web
    services in .NET
  • Can use any .NET programming language
  • Only runs on Microsoft IIS web server
  • Pages are compiled (like JSP)
  • Unique concepts
  • Event-driven versus top-to-bottom execution
  • Code-behind files to separate logic from UI
  • Controls are the key component technology

9
ASP.NET Web Applications
  • An IIS web site or virtual directory
  • .aspx web pages or .asmx web services
  • Optional components
  • One global.asax file (like Application.cfm)
  • One or more web.config configuration files
  • Inherits from machine.config
  • User controls in .ascx files
  • A /bin directory for assemblies (also GAC)
  • HttpHandlers and HttpModules
  • Web content files (.htm, .css, .gif, etc.)

10
ASP.NET Demo
  • Simple web page (hello.aspx)
  • Simple web server (hello.asmx)
  • Control and event handling (declarative.aspx)
  • Control and event handling (codebehind.aspx,
    codebehind.vb)

11
hello.aspx
  • lt_at_ Page Language"vb" gt
  • lthtmlgt
  • ltheadgt
  • lttitlegtSimple ASP.NET Pagelt/titlegt
  • ltscript runat"server"gt
  • Sub SayHello()
  • Response.Write( "Hello, World!" )
  • End Sub
  • lt/scriptgt
  • lt/headgt
  • ltbodygt
  • lt SayHello gt
  • lt/bodygt
  • lt/htmlgt

12
hello.asmx
  • lt_at_ WebService Language"vb" Class"Hello" gt
  • Imports System
  • Imports System.Web.Services
  • Public Class Hello Inherits WebService
  • ltWebMethod()gt Public Function SayHello() As
    String
  • Return( "Hello, World!" )
  • End Function
  • End Class

13
declarative.aspx
  • lt_at_ Page Language"vb" gt
  • lthtmlgt
  • ltheadgt
  • lttitlegtASP.NET Declarative Examplelt/titlegt
  • ltscript runat"server"gt
  • Sub Page_Load( Sender As Object, e As EventArgs
    )
  • Message.Text "Hello, World!"
  • End Sub
  • lt/scriptgt
  • lt/headgt
  • ltbodygt
  • ltform runat"server"gt
  • ltaspLabel id"Message" runat"server"/gt
  • lt/formgt
  • lt/bodygt
  • lt/htmlgt

14
codebehind.aspx
  • lt_at_ Page Language"vb"
  • Src"codebehind.vb"
  • Inherits"example.CodeBehind" gt
  • lthtmlgt
  • ltheadgt
  • lttitlegtASP.NET CodeBehind Examplelt/titlegt
  • lt/headgt
  • ltbodygt
  • ltform runat"server"gt
  • ltaspLabel id"Message" runat"server"/gt
  • lt/formgt
  • lt/bodygt
  • lt/htmlgt

15
codebehind.vb
  • Imports System
  • Imports System.Web
  • Imports System.Web.UI
  • Imports System.Web.UI.WebControls
  • Namespace example
  • Public Class CodeBehind Inherits Page
  • Protected Message As Label
  • Protected Sub Page_Load( Sender As
    Object, e As EventArgs )
  • Message.Text "Hello, World!"
  • End Sub
  • End Class
  • End Namespace

16
web.config
  • Used to configure ASP.NET applications
  • Application initialization parameters
  • Authentication and authorization
  • Compilation defaults
  • Session data storage
  • Debug and trace settings
  • Can be multiple web.config files
  • One per directory, inherit from parents
  • All inherit from machine.config

17
web.config
  • lt?xml version"1.0" encoding"utf-8" ?gt
  • ltconfigurationgt
  • ltsystem.webgt
  • ltcompilation defaultLanguage"vb"
    debug"false"/gt
  • ltsessionState
  • mode"InProc
  • stateConnectionString"tcpip127.0.0.1
    42424"
  • sqlConnectionString"data
    source127.0.0.1user idsapassword"
  • cookieless"false"
  • timeout"20"
  • /gt
  • lthttpHandlersgt
  • ltadd verb"" path".cfm"
  • type"com.newatlanta.bluedr
    agon.HttpHandler,BlueDragon"/gt
  • lt/httpHandlersgt
  • lt/system.webgt
  • lt/configurationgt

18
HttpHandler
  • Custom (user-defined) components (.NET objects)
    that process HTTP requests
  • Can be written in any .NET language
  • Requests are mapped to HttpHandlers via
    directives in web.config
  • .aspx pages are compiled to HttpHandlers
  • HttpHandlers are like Java servlets
  • JSP pages are compiled to Java servlets

19
HttpHandler Example
  • using System.Web
  • namespace Example
  • public class HelloHttpHandler IHttpHandler
  • public void ProcessRequest( HttpContext context
    )
  • context.Response.Write( Hello, World!
    )

20
BlueDragon for .NET
  • BlueDragon.NET is a CFML runtime that is
    implemented as an HttpHandler
  • The BlueDragon.dll assembly can be placed either
    in the ASP.NET application /bin directory, or the
    GAC
  • Configured via web.config or machine.config to
    route .cfm page requests to BlueDragon.dll

21
Integrating CFML into ASP.NET
  • Use BlueDragon.NET to deploy CFML pages in
    ASP.NET web applications, side-by-side with .aspx
    pages and .asmx web services
  • Share Application, Session, and Request scope
    variables
  • Use CFOBJECT to access .NET objects
  • Use ASP.NET controls in CFML pages
  • Write CFX tags in any .NET language

22
BlueDragon.NET Demo
  • BlueDragon.NET configuration
  • Hello.cfm
  • BlueDragon admin console
  • ASP.NET calendar control

23
Why CFML on .NET?
  • Performance
  • .NET CLR versus Java VM
  • ADO.NET versus JDBC
  • Scalability take advantage of Windows 2003
    Server clustering
  • Native Windows platform integration
  • Fast, reliable COM integration
  • Migration to ASP.NET
  • Another platform alternative for ISVs
Write a Comment
User Comments (0)
About PowerShow.com