Unit 1: Introduction - PowerPoint PPT Presentation

1 / 64
About This Presentation
Title:

Unit 1: Introduction

Description:

Collection of APIs from Sun. Introduces containers which provide low-level services ' ... Supporting APIs. JDBC Database handles transactions. Java Transaction API ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 65
Provided by: scottf9
Category:

less

Transcript and Presenter's Notes

Title: Unit 1: Introduction


1
Unit 1 Introduction
  • Building J2EE Applications in SilverStream

Instructor Notes To make the instructor notes
invisible in this unit, select ViewgtComments.
2
Welcome
  • Agenda
  • Unit 1 Introduction
  • Unit 2 Introduction to XML and DTD
  • Unit 3 Java Naming and Directory Interface -
    JNDI
  • Unit 4 Java Database Connectivity - JDBC
  • Unit 5 Servlets
  • Unit 6 Java Server Pages - JSPs
  • Unit 7 Enterprise Java Beans - EJBs
  • Unit 8 Java Mail
  • Unit 9 Java Message Service - JMS
  • Unit 10 Wrap Up

3
Section Objective
  • Understand eBusiness problems facing companies
    today
  • Identify SilverStream products and solutions
  • Define the J2EE environment
  • Assembling and Deploying Applications
  • Be familiar with the course application

4
Challenges Facing Companies
  • Must do business over the internetto compete
  • Now in Internet 2.0 era
  • More than static HTML pages
  • Push to provide full serviceon the web, such as
  • Online purchases
  • Personalized news
  • Employee benefits
  • Business orders

5
Expectations Speed
  • Competition
  • User can click away to competitor if response is
    too slow
  • Global customer base
  • Handle thousands of simultaneous hits
  • Need efficient, scalable server

Instructor Notes As an example of competition,
Amazon.com and Hotmail were the first ones in
their niche.
6
Expectations Availability
  • Hours
  • Users want server up 24 x 7 to answer off-hour
    questions.
  • Example Dont make customer wait until Monday to
    speak to customer service representative.
  • Reliability
  • No downtime. Business depends on being up.
  • Need reliable server and failover procedure.

7
Expectations Safety
  • Privacy issues
  • Passwords and logins
  • Hide sensitive data
  • Whether to share personal data with other
    companies
  • Tamper-proof
  • Encrypted communication for sensitive portions
  • Protected access to enterprise data

8
Expectations Customized Content
  • Display just what the user wants
  • Barrage of information on web
  • Provide relevant content based on users
    interests
  • Opportunity to customize your business
  • Remember customer settings
  • Offer specials based on customers history

Instructor Notes For example, Amazon.com shows
what other books were bought by persons who
bought the current book.
9
Using Internet to Make Certain Tasks Easier
  • Example configure wireless devices
  • Limited display and inputcapabilities
  • Incompatible vendors
  • Use internet to updateoptions such as
    whichvendor and userpreferences

Instructor Notes You may need to support multiple
layers in your application to address differing
vendors.
10
Using Internet to Provide Comprehensive Processes
  • Put your entire business on web.
  • Example In addition to product catalog, customer
    wants to see delivery schedule and inventory
    levels.
  • Do not let one piece of the process stop a
    transaction from being completed online.
  • Example Customer service site that is not aware
    of which products the user owns.
  • Example User found a fix but cannot order
    upgrade online.

11
Connecting to Existing Data
  • You may need to connect to many systems to
    provide data to complete the transaction.
  • Legacy systems
  • Remote data

12
Expanded User Definition
  • Your users now include
  • Customers
  • Employees, and
  • Partners

13
Fast Web Application Lifecycle
  • Must develop quickly and be able to change
    quickly
  • Fast time-to-market
  • Short lifecycle
  • Industry changes quickly

Instructor Notes The old client-server lifecycle
used to be about six to 18 months. Today, most
Internet applications have a one to three month
lifecycle.
14
Multiple Developer Roles
  • Must address mix of skills and goals
  • Graphic designers do not want to wait for
    programmers in order to change look.
  • Programmers do not want others to make the logic
    break.

15
What are Some Solutions?
  • Component-based architecture
  • Divide and conquer strategy
  • Standards for infrastructure
  • Provides bigger talent pool
  • Larger choice of vendors

16
Component-Based Architecture
  • Separates UI from logic
  • Easier maintenance. Make changes without
    affecting other parts of application.
  • Better resource fit. Assign developers to roles
    matching their skills.
  • Components mean reusable code
  • Makes development quicker
  • Allows third parties to provide plug-in solutions

17
Infrastructure for Web Applications
  • Web applications need to handle transactions,
    security, database connections, and more.
  • Not trivial to implement
  • Similar needs for many web applications
  • Vendors could provide these low-level services
  • Standards are needed.
  • J2EE is the new standard from Sun.
  • Lets developers focus on business logic and
    presentation.
  • Code is portable to any compliant vendor.

Instructor Notes Though the code is portable to
any compliant vendor, you need to answer
deployment issues.
18
Section Objective
  • Understand eBusiness problems facing companies
    today
  • Identify SilverStream products and solutions
  • Define the J2EE environment
  • Assembling and Deploying Applications
  • Be familiar with the course application

19
eBusiness Needs
Complexpiecesareneededto servicethe user.
Instructor Notes The Portal component builds a
website and adds personalization.eCRM
electronic Customer Relationship ManagementEAI
Enterprise Application Integration, linking
applications to support a business processB2B
Business to business
20
Unified Platform
SilverStreamprovides aunifiedsolution.
21
SilverStream eBusiness Platform
Tools
Components
Components
3rd PartyComponents
CustomComponents
Portal Component Framework
eBusiness Services
ContentManagement
Web Publishing
Personalization
Rules Engine
ContentCaching
Workflow
User Profiling
XML Integration
J2EE Application Server
Presentation
Business Logic
Transactions
Messaging
Scalability
Reliability
Security
Management
Enterprise Connectivity
Instructor Notes You may have seen this slide in
sales presentations. It shows SilverStreams
platform.
22
SilverStreams J2EEApplication Server
  • J2EE certified
  • Scalable
  • Reliable
  • Secure
  • Full EJB 1.1 support
  • Integrated tools and support for Java IDEs
  • Broad connectivity
  • Rich HTML and Java client support
  • Enterprise deployment services

23
SilverStreams xCommerce Solution
  • Quickly define electronic connections with
    trading partners
  • Within hours
  • Visual user interfaces
  • Enterprise Enablers
  • Allow business applications to become XML-enabled
  • Supports IBM mainframes and AS400 hosts

24
SilverStreams ePortal Solution
  • Quickly build a portal web site
  • Well-architected framework of services and tools
  • Operates on J2EE application server
  • Provides personalization
  • Rules
  • Supports content management

Instructor Notes For example, the SilverTrade
sample database changes its presentation based on
the investor.
25
Sample Portals
26
Section Objective
  • Understand eBusiness problems facing companies
    today
  • Identify SilverStream products and solutions
  • Define the J2EE environment
  • Assembling and Deploying Applications
  • Be familiar with the course application

27
J2EE Environment
  • Java 2 Platform, Enterprise Edition (J2EE)
  • Collection of APIs from Sun
  • Introduces containers which provide low-level
    services

...With this model, developers can focus on
solving business problems, leverage the power and
speed of server-side technology, and leave the
low-level programming details to the
architecture. -- Sun
...J2EE is one of the best solutions that weve
had so far for meeting the demands of todays
enterprise. J2EE specifies both the
infrastructure for managing your applications,
and the service APIs for building them. -- Wrox
Press
Instructor Notes Stress that J2EE is not a
product!
28
J2EE Certification
  • Suns J2EE Compatibility Test Suite
  • Vendors must pass test to be certified
  • Over 5,000 individual tests
  • Covers EJB 1.1 (session and entity beans,
    bean-managed and container-managed
    persistence) Servlet 2.2 JSP 1.1 JDBC 2.0 JTA
    1.0 JavaMail 1.0 JNDI 1.2 RMI over IIOP 1.0
  • Look for proof of this certification

29
What makes up a J2EE Application?
30
What makes up a J2EE Application? (3)
31
Components
  • Application level reusable units
  • Provides the requisite business functionality
  • Depend on the container to provide services
  • Applications are assembled together with an array
    of components.
  • Component types include
  • Servlets
  • JavaServer Pages
  • Enterprise JavaBeans
  • Java classes

32
Servlets
  • Servlets are a J2EE technology
  • Web components
  • Support dynamic content generation
  • A Servlet is a Java class used to extend the
    capabilities of servers that host applications
    accessed via a request-response programming
    model.
  • Based on the behavior of Hypertext Transfer
    Protocol (HTTP)

33
Java Server Pages (JSPs)
  • JSPs are a J2EE technology
  • Web components
  • Support dynamic content generation
  • The JSP technology provides a way to create web
    contents with both static and dynamic components
  • JSP is Java embedded into HTML as opposed to
    servlets with content embedded into Java code

34
Enterprise JavaBeans (EJBs)
  • From Suns J2EE Blueprints
  • Enterprise JavaBeans technology provides a
    distributed component model that enables
    developers to focus on solving business problems
    while relying on the J2EE platform to handle
    complex system-level issues.
  • An EJB is a Java body of code with fields and
    methods to implement modules of business logic
  • Two types of EJBs
  • Session
  • Entity

35
Containers
  • Runtime environments that manage application
    components and provide access to J2EE APIs.
  • Containers contain
  • components - servlets, JSPs, EJBs, etc.
  • deployment descriptors - an XML file that
    contains information about the application
    components
  • services - transaction processing, database
    access, messaging, etc.

36
Types of Containers
Just discuss on how the containers interact with
each other.
Client tier
Application tier
Enterprise tier
37
Deployment Descriptor
  • XML file that describes the application and its
    components
  • Based on DTDs created by Sun
  • May include
  • Definitions of components
  • Servlet/JSP mappings
  • Establish a reference to an external entityejb,
    connection pool, mail server, and so on
  • Identify security roles
  • Starting URL or default page for the application
  • Initialization of parameters

38
Services
Discuss briefly what are the services that the
J2EE server provides to the web container. The
next few slides goes into each one in more depth.
  • Components can expect these services to be
    available on any J2EE platform.
  • Developed by the J2EE vendor.

39
Enterprise Connectivity
  • J2EE Connector API
  • Single API to connect to various enterprise data
    sources
  • ERP
  • CRM
  • Legacy
  • And so on
  • Not yet part of the J2EE standard, but soon will
    be
  • Watch for it!

40
Naming Services - JNDI
  • JNDIJava Naming and Directory Interface
  • Allows applications to access services without
    knowing the physical name or even the location
  • Used throughout J2EE
  • Locating components
  • Locating services

41
Messaging - JavaMail, JMS
  • JavaMail
  • Can send and receive email messages from
    applications
  • JMS
  • Can send messages both synchronously and
    asynchronously
  • Messages can be simple text, XML or complex Java
    objects

42
Corba Integration
  • Java IDL
  • Can invoke Corba services running on Corba
    servers
  • RMI-IIOP
  • RMIRemote Method Invocation
  • IIOPInternet Inter-Orb Protocol
  • Allows you to wrap Corba objects around the RMI
    protocol
  • Enterprise JavaBeans uses the RMI-IIOP protocol

43
Security
  • J2EE supports authentication and authorization.
  • Unified security model
  • Supports single sign-on through the containers
  • If you present your security credentials to the
    Web container, you dont need to pass them to the
    EJB container.

44
SecurityAuthentication
  • Identify an individual as a valid user to the
    J2EE application.
  • In J2EE terminology a user is called a Principal.
  • Three types of authentication
  • HTTP Basic Authentication
  • HTTPSHTTP over SSL
  • Form-basedcontrol the look and feel of HTTP
    basic authentication

45
SecurityAuthorization
  • Authorization in J2EE applications is based on
    roles.
  • A logical grouping of users
  • Developers work with logical roles in their
    components and not actual users/groups of the
    application server.
  • Authorization can either be performed by the
    container or programmatically.

46
Transaction Management
  • Supporting APIs
  • JDBCDatabase handles transactions
  • Java Transaction API
  • JTA provides a standard API for controlling
    transactions across resources
  • Database
  • Messaging services
  • And so on

47
Transaction Management (2)
  • Declarative
  • Container handles transaction management (i.e.
    begin, commit, rollback)
  • Available in the EJB container
  • Programmatic
  • Developer is responsible for transaction
    management
  • Available in both the EJB and Web containers

48
Database Connectivity
  • Access to most any relational database that is
    based on the SQL language.
  • Available from both the Web and EJB containers.
  • Single point of access to databases.
  • Can work together with transaction services.
  • Based on the JDBC API.

49
Connection Pooling
Scott F. Walter Just discuss with the students
the basics of connection pooling
50
Section Objectives
  • Understand eBusiness problems facing companies
    today
  • Identify SilverStream products and solutions
  • Define the J2EE environment
  • Assembling and Deploying Applications
  • Be familiar with the course application

51
Developing J2EE Applications
  • Develop components
  • Package components and deployment descriptors
    into modules
  • Integrate multiple modules into an application
  • Deploy the final application

52
What is Assembling?
  • After developing a component you just dont put
    the components on the J2EE server.
  • Components are logically grouped together and
    placed into an archive file.
  • Via the JAR utility
  • Also you identify configuration information for
    the application in the deployment descriptor
  • For example starting url, error page, and so on

53
Deployment Descriptor
  • XML file that describes the application and its
    components
  • Created by the component developer and
    application assembler
  • Based on DTDs created by Sun
  • application_1_2.dtd
  • application-client_1_2.dtd
  • ejb-jar_1_1.dtd
  • web-app_2_2.dtd
  • Options available in the deployment descriptors
    will be discussed in future units.

54
What is Deployment?
  • Taking archives received from the assembler and
    installing them into the J2EE application server
  • Resolving runtime dependencies
  • For example, which database connection pool to
    use
  • Deployment tools create platform specific runtime
    classes
  • Compiles JSP pages into servlets
  • Creates EJB wrapper classes
  • Deployment is vendor specific.

55
Deployment Plan
  • Resolves dependencies created in the deployment
    descriptor
  • Seperate deployment plan for each component type
  • war deploy_war.dtd
  • ejb deploye_ejb.dtd
  • ear deploy_ear.dtd
  • car deploy_car.dtd

56
Deployment Process
57
Why are There Dependencies?
  • Component developers dont want to hard-code
    references inside their code
  • In case the component is deployed on another
    application server.
  • In case the location of the reference is changed,
    wont need to go and change/compile source code.
  • Dependencies are declared in the deployment
    descriptor and resolved in the deployment plan.

58
Archive Types
Scott F. Walter Each component type will be
discussed later, just inform students of the
different types
  • Web Archive
  • .war file
  • EJB Archive
  • .jar file
  • Client Archive
  • .car file
  • Enterprise Application
  • .ear file
  • Contains one or more Web,EJB,Client components

59
Deployment Tools
  • SilverCmd
  • BuildWar
  • DeployCAR
  • DeployEAR
  • DeployEJB
  • DeployWar
  • QuickDeployEJB
  • QuickDeployWar
  • ValidateEAR
  • ValidateEJB

60
Section Objective
  • Understand eBusiness problems facing companies
    today
  • Identify SilverStream products and solutions
  • Define the J2EE environment
  • Assembling and Deploying Applications
  • Be familiar with the course application

61
SilverBooks Online Store
  • The user can
  • Browse for books
  • Search
  • Place an order
  • Implementation
  • JSP pages
  • Servlets
  • EJBs

Instructor Notes The SilverBooks application in
this course was rewritten from earlier versions
of the sample database shipped with the product.
It is now implemented in J2EE.
62
Course Application Flow
Chooselanguage
Localizedhome page
My Account
Featured book
Search
Browsecategories
Bookdetail
Shoppingcart
Login, ifneeded
Add
Checkout
Searchresults
New
Existing
Existing
Currentorder
Editaccount
Accountstatus
Processorder
Orderconfirmation
Instructor Notes Note In the applications
database, each book might be associated with many
categories. If there is only one book in the
search results, the application automatically
displays the book detail page.
63
Demo The Course Application
Instructor Notes Demonstrate the steps that the
students will follow in the exercise. Note Do
not confuse the course application with the
sample database SilverBooks37, which is similar
but separate.
64
Exercise 1-1 Run the Course Application
  • Run the application.
  • Buy some books.
Write a Comment
User Comments (0)
About PowerShow.com