1 / 23

Integrating CFML with ASP.NET

Integrating CFML with ASP.NET. Vince Bonfanti President New Atlanta Communications, LLC. 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)

tobit
Télécharger la présentation

Integrating CFML with ASP.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. C# VB.NET J# … JRun WebLogic WebSphere … Windows Solaris Linux .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 <%@ Page Language="vb" %> <html> <head> <title>Simple ASP.NET Page</title> <script runat="server"> Sub SayHello() Response.Write( "Hello, World!" ) End Sub </script> </head> <body> <% SayHello %> </body> </html>

  12. hello.asmx <%@ WebService Language="vb" Class="Hello" %> Imports System Imports System.Web.Services Public Class Hello : Inherits WebService <WebMethod()> Public Function SayHello() As String Return( "Hello, World!" ) End Function End Class

  13. declarative.aspx <%@ Page Language="vb" %> <html> <head> <title>ASP.NET Declarative Example</title> <script runat="server"> Sub Page_Load( Sender As Object, e As EventArgs ) Message.Text = "Hello, World!" End Sub </script> </head> <body> <form runat="server"> <asp:Label id="Message" runat="server"/> </form> </body> </html>

  14. codebehind.aspx <%@ Page Language="vb" Src="codebehind.vb" Inherits="example.CodeBehind" %> <html> <head> <title>ASP.NET CodeBehind Example</title> </head> <body> <form runat="server"> <asp:Label id="Message" runat="server"/> </form> </body> </html>

  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 <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation defaultLanguage="vb" debug="false"/> <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" /> <httpHandlers> <add verb="*" path="*.cfm" type="com.newatlanta.bluedragon.HttpHandler,BlueDragon"/> </httpHandlers> </system.web> </configuration>

  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

More Related