Java Enterprise Edition (JEE) Core Design Patterns JEE Core Design - - PowerPoint PPT Presentation

java enterprise edition jee core design patterns jee core
SMART_READER_LITE
LIVE PREVIEW

Java Enterprise Edition (JEE) Core Design Patterns JEE Core Design - - PowerPoint PPT Presentation

Java Enterprise Edition (JEE) Core Design Patterns JEE Core Design Patterns Presentation Business Integration Tier Tier Tier Intercepting Filter Business Delegate Data Access Object Front Controller Service Locator Service


slide-1
SLIDE 1

Java Enterprise Edition (JEE) “Core Design Patterns”

slide-2
SLIDE 2

JEE Core Design Patterns Presentation Tier Business Tier Integration Tier

Intercepting Filter Front Controller Context Object

App Controller View Helper

Composite View

Service to Worker Dispatcher View

Service Locator Session Facade Application Service

Business Object

Business Delegate

Composite Entity Transfer Object TO Assembler Value List Handler

Data Access Object Service Activator Domain Store

Web Service Broker

slide-3
SLIDE 3

Front Controller

http://java.sun.com/blueprints/corej2eepatterns/Patterns/FrontController.html

Intent

  • provide a single point for processing user requests
slide-4
SLIDE 4

Front Controller

Motivation

  • single processing point for all client requests

– across views & session – can be used to inject cross-cutting concerns

  • logging
  • security
  • separation of business code from presentation code
  • provides logical resource mapping

– http://server/resource.jsp – http://server/servlet/resourceController – actually we can map multiple requests to the same controller

slide-5
SLIDE 5

Front Controller

Motivation

  • reusability & organic growth

– controllers can be specialized (sub-classing) – dynamically or declaratively mapped – what is declarative mapping – why do we care?

slide-6
SLIDE 6

Intercepting Filter

Intent

  • preprocessing & post processing of user requests

http://java.sun.com/blueprints/corej2eepatterns/Patterns/InterceptingFilter.html

slide-7
SLIDE 7

Intercepting Filter

filter1 filter2 request response controller request request response response Filter chain

How is this different from pipes & filters?

slide-8
SLIDE 8

Intercepting Filter

Motivation

  • functionality injection
  • improved reusability

– filter chains can be defined in a number of ways

  • declarative configuration

Difficulties

  • information sharing
  • fault-tolerance
slide-9
SLIDE 9

Data Access Object (DAO)

Intent

  • abstract access to data repository

http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

slide-10
SLIDE 10

DAO - Example

slide-11
SLIDE 11

Concerns

Mapping

  • object to persistence mapping

– identifier, foreignkey – object to single table – how do we map associations

  • object to object
  • object to list of objects
  • object to map of objects

– how do we map inheritance

slide-12
SLIDE 12

Concerns

Mapping

  • deletions

– single object deletions are easy – deleting associated objects could cause violations

  • mappers

– allow to vary schema differently from object model

slide-13
SLIDE 13

DAO

Mappers

  • allow to vary schema differently from object model

User id fname Group id name lname belongs

slide-14
SLIDE 14

DAO

ER translates into

  • tables, columns
  • each table row represents an entity