Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating simple programming with ASP.NET

Similar presentations


Presentation on theme: "Creating simple programming with ASP.NET"— Presentation transcript:

1 Creating simple programming with ASP.NET
김순근 .netXpert Solution Consultant

2 Agenda .NET? .NET Framework!! CLR, MSIL, JIT Compiler… ASP vs ASP.NET
ASP.NET Pages Web Form Server Controls ASP.NET Infrastructure 상태관리, Configuration 배포, 인증과 권한 ASP.NET Web Services

3 .NET? .NET Framework!! 1

4 Internet Information Server
Windows 2000 DNA HTTP Internet Information Server VBScript JavaScript Active Server Pages Visual Basic C/C++ COM+ Components SQL Server

5 Windows DNA 와 .net 웹 서비스로 제공 B2B Windows DNA App 무역거래 공급자 A 공급자 B
전자상거래 Inventory 물품주문 수행 SQL Server, Oracle, DB2 B2B 무역거래 공급자 A Firewall 공급자 B Rich and Reach Windows DNA App 다양한 클라이언트 환경

6 Common Language Runtime
.NET과 .NET Framework Base Classes Data & XML Win Forms Common Language Runtime ASP.NET Visual Studio.NET .NET Enterprise Servers .NET Framework Building Block Services Windows (CE, ME, 2000, and .NET) Windows (CE, ME, 2000, and .NET)

7 Common Language Runtime ( CLR )
플랫폼 종속성 탈피 Processor 별 CLR 제공 X86 , 64bit, Pocket PC, LINUX ? , UNIX ? 언어통합(Language Integration) 진정한 언어통합, 상호 언어간 OOP 적 통합 가능 Common Type System(CTS) Common Language Specification(CLS) 효과적 자원관리 Garbage Collection(GC)

8 Common Language Runtime ( CLR )
디버깅의 효율성 증대 언어통합으로 인한 일관성 있는 디버깅 가능 Stack-Walking 을 통한 용이한 버그 위치 파악 일관성 있는 에러처리 Win32 형태 / HRESULT 형태 → Exception Notification 배포의 용이성 레지스트리 / DLL Hell → Xcopy Installation

9 MSIL & JIT Compiler MSIL(Microsoft Intermediate Language)
Language Compiler에 의해 Language Specification 에 맞추어 변환된 형태의 중계언어 PE(Potable Executable) 파일형태 ( .EXE / .DLL) Self Description (Meta Data : Assembly Manifest ) IL DASM ( ILDASM.EXE ) JIT(Just-In-Time) Compiler CLR 이 프로그램을 수행할 수 있도록 CLR을 위한 원시코드로의 compile 수행 Processor 별 JIT Compiler

10 Before installation or the first time each method is called
MSIL & JIT Compiler Compilation MSIL Code Source Code Language Compiler Metadata Execution JIT Compiler Native Code Before installation or the first time each method is called

11 Common Language Runtime
Execution Model VB VC C# Script Compiled by Language Compiler IL Execution “Econo”-JIT Compiler Standard JIT Compiler Native Code Common Language Runtime Opt JIT Compiler

12 .NET Framework Namespace
System.Web Configuration SessionState Caching Security Services Description Discovery Protocols UI HtmlControls WebControls ASP.NET System.Drawing Imaging Drawing2D Text Printing System.Windows Forms Design Windows ADO.NET System.Data System.Xml SqlClient Common SQLTypes OleDb XPath XSLT Serialization XML System Globalization Diagnostics Configuration Collections Resources Reflection Net IO Threading Text ServiceProcess Security Runtime InteropServices Remoting Serialization Base Class Library

13 2 ASP vs ASP.NET

14 Strength of ASP 쉽고 강력한 웹 어플리케이션 개발 컴파일 필요 없음 COM 객체를 통한 확장성
HTML / Server Side Script Mixed feature 컴파일 필요 없음 메모장을 통한 스크립트 코딩만으로 실행 COM 객체를 통한 확장성 Server Side Component , ADO

15 Weakness of ASP 비구조적 개발언어 스크립트 언어의 한계 Server Component 관리문제
스파게티 가락 코딩, 코드의 난독성 스크립트 언어의 한계 Early Binding 지원 불가능, Interpreting Server Component 관리문제 State Management Session 의 문제점 – Web Farm 환경에서의 한계 Page State 유지 웹 브라우저의 제한 – 호환성 유지 어려움

16 ASP.NET 특징 체계적인 프로그래밍 구조 언어 독립성 코드와 인터페이스의 분리
스크립트 언어가 아닌 CLR 을 지원하는 모든 언어 사용가능 CLR이 지원하는 모든 플랫폼 하에서 구동 가능 LINUX, UNIX 플랫폼 하에서 구동가능성 코드와 인터페이스의 분리 유지보수의 편리성, 어플리케이션의 확장성 Easy Deployment – just xcopy!

17 ASP.NET 특징 다수의 클라이언트 지원 Explorer / Netscape / Mac / Pocket PC /
Mobile phone – “알아서 렌더링한다!”

18 ASP.NET 특징 .NET 플랫폼과의 완벽한 통합 성능향상 개발 생산성 향상 Cookie-less Session
WebForm Class 사용 성능향상 Compiled Page Garbage Collection(GC) 개발 생산성 향상 개발툴 ( VS .NET) OOP에 의한 모듈화 Programming Cookie-less Session

19 PC Magazine Nile Application Test
2781 2400 1200 1600 800 400 2800 2000 초당 서비스 가능 페이지 수 8 CPU 4 CPU 2 CPU 1989 1154 748 637 330 Microsoft ASP Microsoft ASP.NET

20 Hello, ASP.NET!

21 ASP.NET Platform Architecture
Pages Services Application Service(Infrastructure)

22 3 ASP.NET Pages

23 ASP.NET Pages Web Form Control Pagelet
Intrinsic Controls ( 기본컨트롤 ) List Controls Rich Controls Validation Control Pagelet Cache – Data Cache / Output Cache Debugger State Management

24 ASP.NET Page Framework Control-based, event 기반의 실행모델
“Web 의 VB” ASP 시절보다 휠씬 적어진 코딩 완벽한 Encapsulation 지원 Compiled languages VB, C#, Jscript, ……… Executed via CLR as native code ASP.NET 페이지는 “.ASPX” 확장자를 사용한다 IIS 상에서 현재의 ASP application 들과 함께 구동 된다

25 ASP.NET Execution Model

26 Server Controls (1) HTML Server Controls Web Form Controls
Html Element와 1:1 맵핑 Web Form Controls Intrinsic Controls ( 기본컨트롤 ) Label, Textbox, Image, Checkbox, Radiobutton, Button, Linkbutton, Imagebutton, Hyperlink, Table, TableCell, TableRow, Panel

27 File Upload Sample

28 Server Controls (2) Web Form Controls Validation Controls – 유효성검사 컨트롤
RequiredFieldValidator - 필수입력사항 ComparedValidator – 값 비교 RangeValidator – 값의 범위 RegularExpressionValidator - 정규식 CustomValidator – 사용자정의 유효성 검사 ValidationSummary – 유효성 검사 결과 요약

29 회원가입 페이지

30 Server Controls (3) Web Form Controls Rich Controls ListControls
AdRotator Control Calendar Control ListControls Repeater Control DataList Control DataGrid Control

31 Calendar Controls & DataGrid Controls

32 Tracing 지원 페이지 실행간의 상태 정보를 제공한다 실행간에 사용자 정의 출력을 보여준다
Method timings, control information, headers, server variables 실행간에 사용자 정의 출력을 보여준다 장님 코끼리 만지기 식 디버깅 – Response.Write 사용 Trace.Write – 일반 메시지 출력시 사용 Trace.Warn – 빨간색으로 메시지 출력

33 Tracing 사용하기

34 Caching Support Full page output caching Fragment Caching
Vary by params, language, user-agent Fragment Caching 페이지의 일부 – Pagelet 에 대한 캐시지원 Extensible Cache API 개발자가 임의로 Cache 에 Data(Object)를 저장할 수 있는 기능을 제공 다중의 expiration policies 지원 - Dependency

35 ASP.NET Infrastructure
4

36 ASP.NET Infrastructure
Global.asax Session_OnStart , OnEnd / Application_OnStart, OnEnd ☞ 보다 다양한 이벤트 제공 web.config IIS Meta Base ☞ web.config XML File 보다 세밀한 제어 가능 Deployment – XCopy Installation 보안

37 Scale-Out Web Architecture
Session 드디어 Web Farm 환경을 지원하다! 드디어 Per Server 라는 제한을 극복하게 됨 한대의 State 서버는 다중의 App Server 를 지원한다 다양한 Session State Provider 제공 InProc OutProc - State server (로컬 or 원격) SQL Server

38 ASP.NET Modular Architecture
ASPNET_WP HttpHandlers Pages Services ASPNET_STATE Session State HttpModules Caching Authent Sessions INETINFO ASPNET_ISAPI

39 ASP.NET Error Recovery Pages Services ASPNET_ISAPI HttpHandlers Crash!
ASPNET_WP HttpHandlers Crash! Pages Services Hang! ASPNET_STATE Session State HttpModules Caching Authent Sessions INETINFO ASPNET_ISAPI

40 ASP.NET Error Recovery Pages Services ASPNET_ISAPI HttpHandlers
ASPNET_WP HttpHandlers Pages Services ASPNET_STATE Session State HttpModules Caching Authent Sessions INETINFO ASPNET_ISAPI

41 State Server 사용하기

42 Configuration Page 들이 담겨있는 디렉토리와 동일한 곳에 XML 형태의 파일을 위치한다
web.config 모든 ASP.NET 설정 값들을 저장하고 있음 Authentication, compile options, custom error pages, etc. 사용자 정의 설정값을 추가할 수 있다 DSN, etc. 확장 Custom 한 설정 값들을 얼마든지 지정가능

43 IBuySpy Configuration 의 예
<appSettings> <add key="DSN" value="server=(local);uid=sa;pwd=;database=ibs2" /> </appSettings> <location path="CheckOut.aspx"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location> <authentication mode="Forms"> <forms name="IBuySpyAuth" loginUrl="Login.aspx" protection="all"> </authentication> <customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx"/> </configuration> <appSettings> <add key="DSN" value="server=(local);uid=sa;pwd=;database=ibs2" /> </appSettings> Dim strConn as String = _ ConfigurationSettings.AppSettings(“DSN”) <location path="CheckOut.aspx"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location> <authentication mode="Forms"> <forms name="IBuySpyAuth" loginUrl="Login.aspx“ protection="all“> </authentication> <customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx"/>

44 Machine.config & Web.config

45 ASP.NET Authentication
IIS 에서 지원하는 Basic, Digest and NTLM Credential verification against NT SAM/DS Passport module Exposes passport profile API Custom, forms-based authentication Cookie token tracking 을 이용한 손쉬운 사용 Custom login screen (no popup dialogs) Credential checks against database, etc.

46 ASP.NET Deployment “XCOPY” deployment
설치등록 이 필요없다!! 웹 서버를 더 이상 세울 일이 없다! 모든 웹 Resource 들을 마찬가지로 Just Copy! Web pages, web services Compiled components (DLL) Configuration files

47 Component Deployment Component 설치 누워서 떡먹기!
Ftp로 Application 의 /bin 폴더로 Just xcopy ! 설치 등록 과정 필요없음 (Bye Bye Registry! Bye Bye Regsvr32!! ) “\bin” 폴더는 각각의 Application 에 Private 하다 각각의 Application 들은 각자의 Component 를 호출해야 한다. 실시간 Component Update No more locked DLLs Just copy new DLL on top of old one! 간단한 uninstall — just delete files! Registry 와는 전혀 상관없음

48 ASP.NET Web Services 5

49 ASP.NET Web Service SOAP XML Distributed Internet Application
Beyond the COM+ Yellow pages

50 Building Web Applications
Partner Credit Info Socket Screen Scrape FAX B2C Website HTML Client

51 Simple, Open, Broad Support
Using Web Services Simple, Open, Broad Support Partner Credit Info Partner Credit Info XML Service의 게시,검색, 사용: UDDI Client 상호 서비스 연동: SOAP 범용 데이터 전송매개: XML B2C Website B2C Website XML 전송수단: Internet XML Client 이득 : 정보 제공자/소비자 자동화, 정확한 데이터에 의한 정보 공유및 분석이 가능

52 Web Services in ASP.NET 단순한 프로그래밍 모델
단순히 ASMX 파일에 클래스 메소드를 작성 ASP.NET 이 해당 서비스 Request 시 Compile, 클래스 내부의 각각의 Method 들에 대한 정보를 HTML 형식으로 생성시킴 HTTP 상으로 들어오는 Request 들이 Method 들을 호출한다. 별도로 HTTP 나 XML 제반 지식을 필요로 하지 않음 다양한 Message Wire Format 을 지원 HTTP Get, Post, SOAP Request

53 웹 서비스 작성방법 Basic Namespace WebMethod 키워드와 함께 Class 정의
Imports System.Web.Services 반드시 참조 되어야 한다! WebMethod 키워드와 함께 Class 정의 본 메소드는 웹 에서 호출가능 하다! Public 만으로는 웹에서 Access 할 수 없다! Public Class MyStore <WebMethod()> _ Public Function Price() As String Price = "The item costs $10." End Function End Class

54 웹 서비스 실행 모델

55 Web Services로 Hello World 만들기

56 Summary Windows DNA에서 .NET으로 .NET Framework의 이해 ASP에서 ASP.NET으로
단순함과 강력함 빠른 속도와 확장성 안정성과 가용성 ASP.NET Platform – Pages, Services, Infrastructure

57 More Resources.. Contact to .. http://www.asp.net
(ASP.NET quickstart) MSDN 그외 관련 서적들.. Contact to ..


Download ppt "Creating simple programming with ASP.NET"

Similar presentations


Ads by Google