Presentation is loading. Please wait.

Presentation is loading. Please wait.

Internet Engineering Course Web Application Architectures.

Similar presentations


Presentation on theme: "Internet Engineering Course Web Application Architectures."— Presentation transcript:

1 Internet Engineering Course Web Application Architectures

2 Agenda 1. Application servers 2. J2EE 3..Net 4. Comparison between J2EE and.Net

3 1. Application Servers In the beginning, there was darkness and cold. Then, … Centralized, non-distributed terminals mainframe terminals

4 Application Servers In the 90’s, systems should be client-server

5 Application Servers Today, enterprise applications use the multi- tier model

6 Three-Tier Architecture

7 Web Application Architecture

8 Application Servers “Multi-tier applications” have several independent components An application server provides the infrastructure and services to run such applications

9 Application Servers Application server products can be separated into 3 categories: ◦ J2EE-based solutions ◦ Non-J2EE solutions (PHP, ColdFusion, Perl, etc.) ◦ And the Microsoft solution (ASP/COM and now.NET with ASP.NET, VB.NET, C#, etc.)

10 J2EE Application Servers Major J2EE products: ◦ BEA WebLogic ◦ IBM WebSphere ◦ Sun iPlanet Application Server ◦ Oracle 9iAS ◦ HP/Bluestone Total-e-Server ◦ Borland AppServer ◦ Jboss (free open source)

11 Web Server and Application Server Web Server (HTTP Server) App Server 1 App Server 2 Internet Browser HTTP(S)

12 What is J2EE? What is J2EE? It is a public specification that embodies several technologies Current version is 1.4 J2EE defines a model for developing multi- tier, web based, enterprise applications with distributed components

13 J2EE Architecture

14 J2EE Benefits High availability Scalability Integration with existing systems Freedom to choose vendors of application servers, tools, components Multi-platform

15 J2EE Benefits Flexibility of scenarios and support to several types of clients Programming productivity: ◦ Services allow developer to focus on business ◦ Component development facilitates maintenance and reuse ◦ Enables deploy-time behaviors ◦ Supports division of labor

16 Main technologies JavaServer Pages (JSP) Servlet Enterprise JavaBeans (EJB)  JSPs, servlets and EJBs are application components

17 JSP Used for web pages with dynamic content Processes HTTP requests (non-blocking call-and- return) Accepts HTML tags, special JSP tags, and scriptlets of Java code Separates static content from presentation logic Can be created by web designer using HTML tools

18 Servlet Used for web pages with dynamic content Processes HTTP requests (non-blocking call-and-return) Written in Java; uses print statements to render HTML Loaded into memory once and then called many times Provides APIs for session management

19 A Sample Scenario Web Server Client (1) get a.jsp(2) process JVM JSP Other Components Database (4) result (5) HTTP file Servlet (3) gen. Servlet Servlet Impl.

20 EJB EJBs are distributed components used to implement business logic (no UI) Developer concentrates on business logic Availability, scalability, security, interoperability and integrability handled by the J2EE server Client of EJBs can be JSPs, servlets, other EJBs and external aplications Clients see interfaces

21 J2EE Multi-tier Model

22 J2EE Application Scenarios Multi-tier typical application

23 J2EE Application Scenarios Stand-alone client

24 J2EE Application Scenarios Web-centric application

25 J2EE Application Scenarios Business-to-business

26 J2EE Services and APIs Java Message Service (JMS) ◦ Implicit invocation ◦ Communication is loosely coupled, reliable and asynchronous ◦ Supports 2 models:  point-to-point  publish/subscribe

27 JMS Point-to-point ◦ Destination is “queue”

28 JMS Publish-subscribe ◦ Destination is “topic”

29 J2EE Services and APIs JNDI - Naming and directory services ◦ Applications use JNDI to locate objects, such as environment entries, EJBs, datasources, message queues ◦ JNDI is implementation independent ◦ Underlying implementation varies: LDAP, DNS, DBMS, etc.

30 J2EE Services and APIs Transaction service: ◦ Controls transactions automatically ◦ You can demarcate transactions explicitly ◦ Or you can specify relationships between methods that make up a single transaction

31 J2EE Services and APIs Security ◦ Java Authentication and Authorization Service (JAAS) is the standard for J2EE security ◦ Authentication via userid/password or digital certificates ◦ Role-based authorization limits access of users to resources (URLs, EJB methods) ◦ Embedded security realm

32 J2EE Services and APIs J2EE Connector Architecture ◦ Integration to non-J2EE systems, such as mainframes and ERPs. ◦ Standard API to access different EIS ◦ Vendors implement EIS-specific resource adapters Support to Corba clients

33 J2EE Services and APIs JDBC JavaMail Java API for XML Parsing (JAXP) Web services APIs

34 3. EJB – a closer look

35 Home Interface Methods to create, remove or locate EJB objects The home interface implementation is the home object (generated) The home object is a factory

36 Remote Interface Business methods available to clients The remote interface implementation is the EJB object (generated) The EJB object acts as a proxy to the EJB instance

37 Stub/Skeleton-Layer Remoting in Java Several possibilities: RMI/CORBA ◦ RMI can use JRMP or IIOP as a transport protocol ◦ Not pluggable – changes in the code are necessary ClientServer StubSkeleton Remote Reference Manager Transport Layer

38 EJB – The Big Picture

39 EJB at runtime Client can be local or remote

40 EJB at runtime

41 Types of EJB New!

42 Session Bean Stateful session bean: ◦ Retains conversational state (data) on behalf of an individual client ◦ If state changed during this invocation, the same state will be available upon the following invocation ◦ Example: shopping cart

43 Session Bean Stateless session bean: ◦ Contains no user-specific data ◦ Business process that provides a generic service ◦ Container can pool stateless beans ◦ Example: shopping catalog

44 Entity Bean Represents business data stored in a database  persistent object Underlying data is normally one row of a table A primary key uniquely identifies each bean instance Allows shared access from multiple clients Can live past the duration of client’s session Example: shopping order

45 Entity Bean Bean-managed persistence (BMP): bean developer writes JDBC code to access the database; allows better control for the developer Container-managed persistence (CMP): container generates all JDBC code to access the database; developer has less code to write, but also less control

46 Message-Driven Bean Message consumer for a JMS queue or topic Benefits from EJB container services that are not available to standard JMS consumers Has no home or remote interface Example: order processing – stock info

47 Example of EJB Application It consists of number of clients accessing session beans and entity beans Each Session bean provides specialized processing on behalf of client e.g. Travel Agent session bean makes travel reservations while Flight Scheduler bean schedules planes to fly on various routes. Each Entity Bean represent different type of business entity. e.g.Passengers, seats, planes, flights are entity beans

48 Example EJB Application

49 JBoss- J2EE Product FIND OUT MORE ABOUT TODAY’S MOST SUCCESSFUL OPEN SOURCE- DEVELOPED PPLICATION SERVER

50 What is Jboss? Created in 1999, JBoss is the product of an OpenSource developer community dedicated to developing the best J2EE-compliant application server in the market With 1000 developers worldwide and a steadily growing number of downloads per month, reaching 72,000 for October ’01 (per independent www.sourceforge.net), JBoss is arguably the most downloaded application server in the world today Distributed under an LGPL license, JBoss is absolutely FREE for use. No cost. Period.

51 JBoss- Application Server

52 Introduction to.NET Framework

53 .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for writing and executing written programs in any compliant language)

54 What Is.NET.Net is a new framework for developing web-based and windows-based applications within the Microsoft environment. The framework offers a fundamental shift in Microsoft strategy: it moves application development from client-centric to server-centric.

55 .NET – What Is It? Operating System + Hardware.NET Framework.NET Application

56 Base Class Library Common Language Specification Common Language Runtime ADO.NET: Data and XML VBVC++VC# Visual Studio.NET ASP.NET: Web Services and Web Forms JScript… Windows Forms Framework, Languages, And Tools

57 The.NET Framework.NET Framework Services Common Language Runtime Windows ® Forms ASP.NET ◦ Web Forms ◦ Web Services ADO.NET, evolution of ADO Visual Studio.NET

58 Common Language Runtime (CLR) CLR works like a virtual machine in executing all languages. All.NET languages must obey the rules and standards imposed by CLR. Examples: ◦ Object declaration, creation and use ◦ Data types, language libraries ◦ Error and exception handling ◦ Interactive Development Environment (IDE)

59 Common Language Runtime Development ◦ Mixed language applications  Common Language Specification (CLS)  Common Type System (CTS)  Standard class framework  Automatic memory management ◦ Consistent error handling and safer execution ◦ Potentially multi-platform Deployment ◦ Removal of registration dependency ◦ Safety – fewer versioning problems

60 Common Language Runtime Multiple Language Support CTS is a rich type system built into the CLR –Implements various types (int, double, etc) –And operations on those types CLS is a set of specifications that language and library designers need to follow –This will ensure interoperability between languages

61 Intermediate Language (IL).NET languages are not compiled to machine code. They are compiled to an Intermediate Language (IL). CLR accepts the IL code and recompiles it to machine code. The recompilation is just-in-time (JIT) meaning it is done as soon as a function or subroutine is called. The JIT code stays in memory for subsequent calls. In cases where there is not enough memory it is discarded thus making JIT process interpretive.

62 Languages Languages provided by MS ◦ VB, C++, C#, J#, JScript Third-parties are building ◦ APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, Smalltalk…

63 Compilation in.NET C# VB.NET C++ Perl Compiler MSIL + Metadata Loader/ Verifier JIT Managed Code Execution Garbage Collection, Security, Multithreading,...

64 Windows Forms Framework for Building Rich Clients –RAD (Rapid Application Development) –Rich set of controls –Data aware –ActiveX ® Support –Licensing –Accessibility –Printing support –Unicode support –UI inheritance

65 ASP.NET ASP.NET, the platform services that allow to program Web Applications and Web Services in any.NET language ASP.NET Uses.NET languages to generate HTML pages. HTML page is targeted to the capabilities of the requesting Browser ASP.NET “Program” is compiled into a.NET class and cached the first time it is called. All subsequent calls use the cached version.

66 ASP.NET Logical Evolution of ASP –Supports multiple languages –Improved performance –Control-based, event-driven execution model –More productive –Cleanly encapsulated functionality

67 ASP.NET Web Forms Allows clean cut code ◦ Code-behind Web Forms Easier for tools to generate Code within is compiled then executed Improved handling of state information Support for ASP.NET server controls ◦ Data validation ◦ Data bound grids

68 ASP.NET Web Services A technical definition ◦ “A programmable application component accessible via standard Web protocols”

69 Web Services It is just an application… …that exposes its features and capabilities over the network… …using XML… …to allow for the creation of powerful new applications that are more than the sum of their parts…

70 ADO.NET (Data and XML) New objects (e.g., DataSets) Separates connected / disconnected issues Language neutral data access Uses same types as CLR Great support for XML

71 Visual Studio.NET Development tool that contains a rich set of productivity and debugging features

72 Summary of.NET The.NET Framework ◦ Dramatically simplifies development and deployment ◦ Provides robust and secure execution environment ◦ Supports multiple programming languages

73 Comparison between J2EE and.NET

74 J2EE – Enterprise Java  J2EE: Java 2 Enterprise Edition  Superset of Java 2 Standard Edition (J2SE)  Adds enterprise features to Java Libraries  Defined through the Java Community Process (JCP)  Wholly owned property of Sun Microsystems

75 J2EE Solutions vs Microsoft.Net Solutions Similarities  Both multi-tiered, similar computing technologies  Both support “standards”  Both offer different tools & ways to achieve the same goal.  A lot of parallelism can be seen.  Very difficult to compare and qualify the comparison because each has its own advantages & disadvantages.

76 Microsoft.Net vs. J2EE Comparison Language  C# and Java both derive from C and C++.  MS says: “C# combines the power of VC++ with the ease of usage of VB”  Significant features include garbage collection, hierarchical namespaces) are present in both.  Different Syntax but same result.  Java runs on any platform with a Java VM. C# only runs in Windows for the foreseeable future.  C# is implicitly tied into the CLR and is compiled entirely into native code. Java code runs as Java Virtual Machine and executes byte code

77 Microsoft.Net vs. J2EE Comparison Java vs. C# // This is a comment in Java code class HelloWorld{ public static void main(String[] args){ for(int i= 1; i<= 100; i++) System.out.println("Hello!"); } } // This is a comment in C# using System; class HelloWorld{ static void Main(){ for(int i=1; i<=100; i++) Console.WriteLine("Hello"); } } }

78 Microsoft.Net vs. J2EE Comparison Presentation Layer ASP(+) vs. JSP ASP(+) can use Visual Basic, C#, and possibly other languages for code snippets. JSPs use Java code (snippets, or JavaBean references), compiled into Java Win Forms/Web Forms Vs Swing/Java Server Faces

79 Microsoft.Net vs. J2EE - A technical Comparison Common Elements Concepts J2EE.NET Presentation JSP/Servlets ASP.NET Business Logic EJB/Servlets Code Behind, Remoted Classes Language Java C#, VB.NET Platform Any Windows DB Connectivity JDBC ADO.NET (OLE-DB, ODBC) Web Services JWSDP Web Services MessagingJMSMTS Runtime JRE CLR Transaction JTA/JTS, XA Com+, DTC Distributed computing RMI, CORBA, SOAP SOAP, DCOM XML Parser JAXP, Others Built-in (System.XML)

80 CriteriaJ2EE.NETComments Ease Of Use (Development Environment)****** VB.net and C# are easier to use than J2EE Scalability***** Execute Java Code on Mainframe Single Language Multiple Platforms***** Java Can run on many platforms through the JVM Multiple Languages Single Platform***** VB,C#,J# all run in the same run-time environment Reliability******VB/Com development in 1993 Performance*** Equal Performance Speed of development****VB code easiar to learn Reuse****** Deploy same code on multiple platforms and multiple projects Open Standards****** Java, JVM are open standards Overall56%51% Microsoft.Net vs. J2EE Scorecard

81 A typical.NET Enterprise Solution A typical.NET Enterprise Solution SQL Server IIS on W2k Server.NET managed component ASP.NET Windows Client Browser

82 A typical J2EE Enterprise Solution DB Server Java App Server EJB Servlet JSP Java Client Browser

83 Porting Java Pet Store (Example) to.NET 14000 7500 9000 5000 2500 15500 11500 Java Pet Store Lines of Code Required User Interface 4,410 Data TierMiddle Tier 2,865.NET Petshop 14,273 5,891 ConfigurationTotal Lines of Code 710 5,404 76141274 2,566

84 Forrester Report: The State of Technology Adoption Source: http://download.microsoft.com/download/c/7/5/c75837dc-90bb-44d8-ae70- db7bcc5980b9/TheStateofTechnologyAdoption.pdf http://download.microsoft.com/download/c/7/5/c75837dc-90bb-44d8-ae70- db7bcc5980b9/TheStateofTechnologyAdoption.pdf http://download.microsoft.com/download/c/7/5/c75837dc-90bb-44d8-ae70- db7bcc5980b9/TheStateofTechnologyAdoption.pdf

85 Microsoft.Net vs. J2EE Comparison CLR vs JVM C# Managed C/C++ Lots of other Languages VB.Net CLR Runtime Services MSIL Windows OS Java JRE (JVM) Runtime Services Byte Codes MacUnixLinux Win Both are ‘middle layers’ between an intermediate language & the underlying OS

86 . Net Disadvantages  Security .NET better than prior frameworks (DNA, DCOM, ActiveX, etc.), but still based on Windows  Immaturity  Version 1.0 issues, likely to change in future  Language changes for developers new to.NET  Application migration to.NET costly  Not enough real world use yet to evaluate  Vendor lock-in  Future direction determined by Microsoft.

87 Choosing between Java/J2EE and.Net  The ultimate choice usually depends not on technical superiority, but on:  Cultural/political preferences  Customer preference  Vendor relations  Cost  Platform Dependency  Skill set of your developers

88 Sources & Resources The J2EE Tutorial. Sun Microsystems IBM WebSphere Application Server manuals BEA WebLogic Server manuals www.java.sun.com/j2ee www.theserverside.com

89 Sources & Resources Java 2 Platform Enterprise Edition Specification, v1.3 Designing Enterprise Applications with the Java 2, Enterprise Edition. Nicholas Kassen and the Enterprise Team Does the App Server Maket Still Exist? Jean-Christophe Cimetiere The State of The J2EE Application Server Market. Floyd Marinescu


Download ppt "Internet Engineering Course Web Application Architectures."

Similar presentations


Ads by Google