2. OBJECTIVE
Various computational logic’s.
Classification of client-server
architecture.
Middleware Logic and its need.
Types of Middleware.
Server side components – EJB.
4. When you develop a computer or
software application - Logic’s required,
Business Logic
Data Logic
Presentation Logic
Data Driver Logic
Transaction Logic
Security Logic
INTRODUCTION
5. CLIENT SEVER APPLICATIONS
Server
It is an entity which have resources that
can be shared by all of its clients.
Client
It is an entity which takes or consumes
resources from the server.
Client/Server Architecture
It is an architecture to develop an
application which is based on layering of
logic’s.
6. Single Tier Architecture
All the logic’s kept in a single place or
intermixing of various logic.
Presentation Logic
Business Logic
Data Logic
A STANDALONE
APPLICATION
A COMPUTER SYSTEM
7. Disadvantage
Changing of one logic affects the
other parts of logic.
It is difficult to modify the
changes.
9. Two Tier Architecture
Two levels of layering.
Advantage - Any modification in database
server which in reflects all the clients.
Disadvantage - Any change in one client
cannot be reflected in other clients.
11. Three Tier Architecture
Three levels of layering.
Advantage - Any modification in server side
program which reflects all the clients.
It is good for medium size applications.
Disadvantage
Not suitable for large scale applications or
enterprise applications…
The intermixing of business logic with other logic
leads to complexity.
12. Issues on Three-Tier Architecture
LOAD BALANCING
Server with lightest load.
If Server overloaded – different server
should be chosen.
TRANSPARENT FAIL-OVER
If a server crashes or if the network
crashes can clients rerouted to other
server without interruption of service.
TRANSACTIONS
What if two clients access the same row
of the database simultaneously.
What if the database crashes?
13. DYNAMIC REDEPLOYMENT
How do you perform software upgrades
while site is running?
Machine down or keep running.
THREADING
Processing multiple client requests
simultaneously – server multi-threaded
SECURITY
The servers and databases need to be
shielded from unknown users.
Issues on Three-Tier Architecture cont…
14. LOGGING AND AUDITTING
If something goes wrong, is there a log
that we can consult to determine the
cause of the problem.
OBJECT LIFE CYCLE
When client traffic increases or decreases
respectively.
The objects that live within server need to
be created or destroyed.
Issues on Three-Tier Architecture cont…
15. Together these services are called
MIDDLEWARE services.
Middleware services are available in Multi-
tier architecture.
Nowadays most of the applications are
developed using Middleware technology.
E.g.: EJB, CORBA, DCOM, .NET Framework.
MIDDLEWARE
17. In the past most of the companies built
their own Middleware.
The application servers were born to let
you buy these middleware services,
rather than build them yourself.
Application servers allow developers to
focus on server side application
development and NOT WORRY about
middleware services.
E.g. Web Logic, IBM Web Sphere,
Sun’s J2EE Server.
APPLICATION SERVERS
20. EXAMPLE
transfer(Account account1, Account
account2, long amount) {
// 1: Call middleware API to perform a security
check
// 2: Call middleware API to start a transaction
// 3: Call middleware API to load rows from the
database
// 4: Subtract the balance from one
account, add to the other – Business Logic
// 5: Call middleware API to store rows In the
database
// 6: Call middleware API to end the transaction
}
Example - Traditional distributed object
technologies such as CORBA, DCOM, or RMI
21. IMPLICIT MIDDLEWARE
Write your distributed object to contain only
business logic.
Do not write to complex middleware APIs.
For example, here’s the code that would run
inside the distributed object
transfer(Account account1, Account
account2, long amount) {
// 1: Subtract the balance from one
account, add to the other }
22. REQUEST INTERCEPTOR
Declare the middleware services that the
distributed object needs in a separate
descriptor file, such as a plain text file.
For example, you might declare that you
need transactions, persistence, and a
security check.
The request interceptor intercepts
requests from the client, performs the
middleware that your distributed object
needs and then delegates the call to the
distributed object.
23. IMPLICIT MIDDLEWARE (Gained through
declarations).
Newer, component-based technologies (EJB,
CORBA Component Model, and Microsoft COM+)
24. Enterprise Java Beans (EJB)
Enterprise Java Beans (EJB) is a server – side
component architecture that simplifies the process
of building enterprise – class distributed
component applications in java.
Multi-tiered Architecture
In multi-tiered application the various components
that make up application are logically separated,
across levels or layers of the network-computing
environment.
Distributed Applications
In distributed applications the communication lies
between two or more different objects running on
different machines.
25. SERVER SIDE COMPONENTS
Applications should be constructing as group of
components.
Component is code that implements a set of well-
defined interfaces.
Components are not entire application – they
cannot run alone.
Components can be used as puzzle pieces to solve
some larger problem.
EXAMPLE
Pricing Component – computes the prices of
goods.
Shipping Component – Cargo Shipping –
Tracking the cargo status.
26. PRICING RULES
Base prices – ordering for single hard disk.
Quantity discounts – ordering for more than
10 speakers.
Bundling discounts – ordering for both hard
disk and speakers.
Preferred customer – big-name customers
Locale discounts – depending upon where
customer lives
Overhead costs – shipping and taxes.
27. Each company develops – wastage of resources
Generic pricing component – reused for different
customers.
EXAMPLES
U.S POSTAL SERVICE - compute shipping costs
for mailing packages.
AUTOMOBILE MANUFACTURER – determine
prices for car
ONLINE TEXTILE SHOPPING – determine
prices for cloth items.
REUSABILITY - COMPONENTS
28. Types of EJB
SESSION BEANS
Session beans model business process.
They are like verbs because they are actions –
action could be anything.
They contains business process – related logic.
E.g.:- adding any numbers, Credit card
verification, etc.,
ENTITY BEANS
Entity beans model business data.
They contain data-related logic.
They are like nouns because they are data
objects
E.g.:- a product, an order, an employee or a
credit card.
30. Roles in EJB
EJB encourages participation of more than six different
parties,
The Bean Provider
Supplies business components or enterprise beans.
The Application Assembler
Make components fit together
Writes applications that combine components.
The EJB Deployer
How to deploy beans within servers
Customize the beans for specific environment.
The System Administrator
Oversee the stability of the operational environment
Monitoring of the deployed system.
31. The Container and Service Provider
EJB Container or Application server
This is the runtime environment in which the bean lives.
BEA’s Weblogic
IBM’s WebSphere
Oracle’s Oracle 9i
JBoss open source application server.
The Tool Vendor
Integrated Development Environments – IDEs
IBM’s visual age for Java
Borland’s JBuilder.