Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC."— Presentation transcript:

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@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-anywhere) –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 C#VB.NETJ# … IL (CLR) Windows SolarisLinux … byte code (VM) Java WebLogicWebSphere JRun … 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 Simple ASP.NET Page Sub SayHello() Response.Write( "Hello, World!" ) End Sub

12 hello.asmx Imports System Imports System.Web.Services Public Class Hello : Inherits WebService Public Function SayHello() As String Return( "Hello, World!" ) End Function End Class

13 declarative.aspx ASP.NET Declarative Example Sub Page_Load( Sender As Object, e As EventArgs ) Message.Text = "Hello, World!" End Sub

14 codebehind.aspx <%@ Page Language="vb" Src="codebehind.vb" Inherits="example.CodeBehind" %> ASP.NET CodeBehind Example

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 <sessionState mode="InProc“ stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20" /> <add verb="*" path="*.cfm" type="com.newatlanta.bluedragon.HttpHandler,BlueDragon"/>

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


Download ppt "Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC."

Similar presentations


Ads by Google