Erik Dörnenburg JAOO 2003

Similar documents
EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

~ Ian Hunneybell: CBSD Revision Notes (07/06/2006) ~

Appendix A - Glossary(of OO software term s)

com Spring + Spring-MVC + Spring-Boot + Design Pattern + XML + JMS Hibernate + Struts + Web Services = 8000/-

Chapter 6 Enterprise Java Beans

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Deccansoft Software Services. J2EE Syllabus

Course Content for Java J2EE

Migrating traditional Java EE applications to mobile

Introduction to componentbased software development

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Distributed Multitiered Application

SUN Sun Certified Enterprise Architect for J2EE 5. Download Full Version :

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Advanced Java Programming

NetBeans IDE Field Guide

Fast Track to EJB 3.0 and the JPA Using JBoss

Application Servers in E-Commerce Applications

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

Using JNDI from J2EE components

index_ qxd 7/18/02 11:48 AM Page 259 Index

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Java EE 7: Back-End Server Application Development

POJOs to the rescue. Easier and faster development with POJOs and lightweight frameworks

1Z Oracle. Java Enterprise Edition 5 Enterprise Architect Certified Master

Oracle9iAS Tech nicaloverview

J2EE Interview Questions

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Oracle 10g: Build J2EE Applications

Java Enterprise Edition

Enterprise JavaBeans. Layer:01. Overview

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

Lightweight J2EE Framework

ive JAVA EE C u r r i c u l u m

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

2005, Cornell University

J2EE Technologies. Industrial Training

IBM. Enterprise Application Development with IBM Web Sphere Studio, V5.0

CO Java EE 7: Back-End Server Application Development

Professional JSP : Using JavaServer Pages, Servlets, EJB, JNDI, JDBC, XML, XSLT, And WML By Karl Avedal, Danny Ayers

presentation DAD Distributed Applications Development Cristian Toma

Java EE Patterns 176

Spring & Hibernate. Knowledge of database. And basic Knowledge of web application development. Module 1: Spring Basics

Master Thesis An Introduction to the Enterprise JavaBeans technology and Integrated Development Environments for implementing EJB applications

Writing Portable Applications for J2EE. Pete Heist Compoze Software, Inc.

Not just an App. Server

Object-relational mapping EJB and Hibernate

Agenda. Summary of Previous Session. Extreme Java G Session 3 - Main Theme Java Core Technologies (Part I)

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved.

Architecting Java solutions for CICS

In the most general sense, a server is a program that provides information

Multi-tier architecture performance analysis. Papers covered

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

MTAT Enterprise System Integration. Lecture 2: Middleware & Web Services

Hibernate Interview Questions

Client/Server-Architecture

Java Training For Six Weeks

QUALITY SUPPORT FROM THE SOURCE.

Rational Application Developer 7 Bootcamp

A General ecommerce Platform with Strong International and Local Aspects

Services Oriented Architecture and the Enterprise Services Bus

Ellipse Web Services Overview

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Designing a Distributed System

Architect Exam Guide. OCM EE 6 Enterprise. (Exams IZO-807,1ZO-865 & IZO-866) Oracle Press ORACLG. Paul R* Allen and Joseph J.

Sitesbay.com. A Perfect Place for All Tutorials Resources. Java Projects C C++ DS Interview Questions JavaScript

HIBERNATE MOCK TEST HIBERNATE MOCK TEST IV

Problems in Scaling an Application Client

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

THIS IS ONLY SAMPLE RESUME - DO NOT COPY AND PASTE INTO YOUR RESUME. WE ARE NOT RESPONSIBLE Name: xxxxxx

COWLEY COLLEGE & Area Vocational Technical School

Exam Questions 1Z0-850

The team that wrote this redbook

Table of Contents EJB 3.1 and JPA 2

The Umbilical Cord And Alphabet Soup

Goal. Outline. Outline. J2EE architecture. Enterprise JavaBeans. J2EE Performance Scalability and Clustering Part 1

Developing Applications with Java EE 6 on WebLogic Server 12c

BEAWebLogic. Server. Introduction to WebLogic Server and WebLogic Express. Version 8.1 Revised: June 28, 2006 Part Number:

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions

Building the Enterprise

3C05 - Advanced Software Engineering Thursday, April 29, 2004

BEA WebLogic Server. and BEA WebLogic Express. Introduction to BEA WebLogic Server 6.1

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

(9A05803) WEB SERVICES (ELECTIVE - III)

Data Management in Application Servers. Dean Jacobs BEA Systems

History of Enterprise Java

Projects. How much new information can fit in your brain? Corporate Trainer s Profile TECHNOLOGIES

WebSphere 4.0 General Introduction

Component models. Page 1

Enterprise JavaBeans, Version 3 (EJB3) Programming

Transcription:

Persistence Neutrality using the Enterprise Object Broker application service framework Erik Dörnenburg JAOO 2003

Sample project Simple application Heavy client One business entity Basic operations Person has id, name, gender with getters and setters as appropriate Gender is a custom value class PersonService has methods to retrieve all, as well as add, remove and update individual persons 2

Demo Explore interfaces in IntelliJ 3

Enterprise Applications Modern enterprise applications comprise multiple layers and components Client / Consumer Presentation / Web Service Domain Model / Commands Data Access / Integrations Database / Data Store / Directory Technology preferences change: CORBA, EJB, Patterns are explored and crystallised: Façade, IoC 4

J2EE Java 2 Enterprise Edition Sun standard application server framework for Java Client/Consumer Presentation Business Layer Web Browser Swing JSP, Servlets Client Session Beans / Entity Beans WebLogic Orion, Data Access/Integration CMP, JDBC, JMS, Database / Data Store / Directory Application components hosted in containers Several complimentary technologies Mix and match Application code tightly coupled to infrastructure 5

Demo Explore EJB solution 6

J2EE implementation Client side adapter from PersonService to Remote interface Adapter discovers server using JNDI PersonService implemented as stateless session bean on server Person idea implemented as PersonBean PersonBean is persisted using CMP Beans hosted in Orion application server 7

The Enterprise Object Broker approach Mix and match independently developed components Client/Consumer Presentation Web Browser JSP, Servlets, Tapestry, Velocity Swing Client EOB Business Layer POJO / Handcrafted facades Data Access/Integration Hibernate, Prevayler, JDO, Database / Data Store / Directory Core values: Transparency and Simplicity Utilises AltRMI for remote method invocation Application code not coupled to infrastructure 8

Enterprise Object Broker Application beans transparently published remotely Blurs differences between Local and Remote dependant component lookup Built-in services Servlet Container (Jetty), facilitates JSP, Tapestry etc. Not coupled to an object level persistence service CMP & BMP no equivalent Can use Hibernate, Prevayler, JDO, XML, serialization, etc. Most suitable for Intranet apps presently 9

AltRMI Transparent Remote Procedure Call technology Does not throw RemoteException uses RuntimeException derived instead No extending of UnicastRemoteObject No implementing of Remote in interfaces Code with normal Java interfaces Multiple and pluggable choices for Transport Native (TCP/pipes), RMI, etc. Interop with SOAP, CORBA, DCOM planned In the Incubator at Apache 10

Demo Explore Enterprise Object Broker 11

EOB implementation InMemoryPersonService No persistence Reference implementation Gives GUI team a head start Good for Unit,Integration and eyeball testing beans.xml Describes the façade and its implementation Bundled in JAR with classes application.xml Describes the remote publication characteristics Bundled in EOB file with JARs and WARs 12

Hibernate Object-relational persistence and query service Developers W rite Plain Old Java Objects (POJO) Use idioms like association, inheritance, collection Describe mapping to schema using XML file or Java Doc Query language is a 'minimal' OO extension to SQL Uses reflection and runtime bytecode generation Generates SQL at system startup time 13

Demo Explore Hibernate Service 14

Hibernate implementation Person is a Plain Old Java Object (POJO) No superclass or interface requirements, but Person must provide a default constructor and a (nonpublic) setter for its primary key. Mapping between the object's properties and database columns is described in an XML file PersonService has a HibernateSession: Composition PersonService is a lightweight adaptor between app specific requirements and general persistence service 15

Prevayler Persistence without a relational database Developer W rites Plain Old Java Objects (POJO) Uses association and other Java idioms Expresses transactions in command objects Does not have access to a set-based query language Prevayler Keeps the entire set of 'business objects' is in memory Takes snapshots from time to time Records all commands in a separate log 16

Prevayler (cnt'd) Programming model Queries directly against business objects All modifications to business objects through commands All commands are serialised Prevayler performance Queries: orders of magnitude compared to relational databases; even if these have the database in RAM Modifications: on par with comparable database Snapshots: 10 000 objects per second Recovery: 5000 commands per second Uses a replica for writing snapshots 17

Demo Explore Prevayler Service 18

Prevayler implementation Person is a Plain Old Java Object (POJO) Must be Serializable No further requirements, not even an id Requires a 'prevalent' system to hold the objects Uses classes to express transaction on the system PersonService implemented as a façade which creates instances of commands and executes these on the system. 19

Test-Driven Development & Continuous Integration Test-Driven Development (TDD) focuses on the consumer view on an object. The developer concentrates on the responsibilities of a class by writing unit tests that fail. Tests drive the development of the producer aspect, the actual implementation of the object. Continuous integration means that all tests, unit tests and integration tests, are run on every check-in. CI therefore requires very fast test suites; something that can only be achieved by minimising DB hits. 20

Stubbed implementations & Mock Objects Mock objects and stubs are used to simulate interaction help explore responsibilities/interfaces test conditions which are difficult to simulate substitute long-running implementations with dummies Stubs are handcrafted implementations of existing APIs that return hard-coded values. Mock objects also verify usage of the API through expectations set by the application developer. Dynamic Mocks are created automatically at run time. 21

Live demo Explore stubbed services 22

Summary J2EE and EJB require the application developer to add infrastructure code to the domain model and commands. Conventional O/R mappers as well as new approaches to persisting objects are constantly evolving. Enterprise Object Broker is a lightweight container for application components. EOB and AltRMI allow transparent access to the application components. Application specific interfaces decouple objects, allowing for substitution and mocking. 23

Links Enterprise Object Broker www.enterpriseobjectbroker.org Sourcecode for the demonstrations, via cvs :pserver:anonymous@cvs.sourceforge.net:/cvsroot/eob (module: jaoo) Hibernate www.hibernate.org Prevayler www.prevayler.org Mock Objects www.mockobjects.com ThoughtWorks www.thoughtworks.com 24