Title: Unit 1: Introduction
1Unit 1 Introduction
- Building J2EE Applications in SilverStream
Instructor Notes To make the instructor notes
invisible in this unit, select ViewgtComments.
2Welcome
- 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
3Section 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
4Challenges 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
5Expectations 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.
6Expectations 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.
7Expectations 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
8Expectations 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.
9Using 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.
10Using 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.
11Connecting to Existing Data
- You may need to connect to many systems to
provide data to complete the transaction. - Legacy systems
- Remote data
12Expanded User Definition
- Your users now include
- Customers
- Employees, and
- Partners
13Fast 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.
14Multiple 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.
15What are Some Solutions?
- Component-based architecture
- Divide and conquer strategy
- Standards for infrastructure
- Provides bigger talent pool
- Larger choice of vendors
16Component-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
17Infrastructure 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.
18Section 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
19eBusiness 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
20Unified Platform
SilverStreamprovides aunifiedsolution.
21SilverStream 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.
22SilverStreams 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
23SilverStreams 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
24SilverStreams 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.
25Sample Portals
26Section 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
27J2EE 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!
28J2EE 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
29What makes up a J2EE Application?
30What makes up a J2EE Application? (3)
31Components
- 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
32Servlets
- 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)
33Java 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
34Enterprise 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
35Containers
- 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.
36Types of Containers
Just discuss on how the containers interact with
each other.
Client tier
Application tier
Enterprise tier
37Deployment 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
38Services
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.
39Enterprise 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!
40Naming 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
41Messaging - 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
42Corba 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
43Security
- 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.
44SecurityAuthentication
- 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
45SecurityAuthorization
- 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.
46Transaction 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
47Transaction 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
48Database 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.
49Connection Pooling
Scott F. Walter Just discuss with the students
the basics of connection pooling
50Section 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
51Developing J2EE Applications
- Develop components
- Package components and deployment descriptors
into modules - Integrate multiple modules into an application
- Deploy the final application
52What 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
53Deployment 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.
54What 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.
55Deployment 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
56Deployment Process
57Why 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.
58Archive 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
59Deployment Tools
- SilverCmd
- BuildWar
- DeployCAR
- DeployEAR
- DeployEJB
- DeployWar
- QuickDeployEJB
- QuickDeployWar
- ValidateEAR
- ValidateEJB
60Section 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
61SilverBooks 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.
62Course 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.
63Demo 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.
64Exercise 1-1 Run the Course Application
- Run the application.
- Buy some books.