Top Banner
1 A domain model-centric approach to J2EE development Keiron McCammon CTO Versant Corporation
55

A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

Mar 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

1

A domain model-centric approach to J2EE development

Keiron McCammonCTOVersant Corporation

Page 2: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

2©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

OverviewOverview

nWhat is a domain model centric approach?nWhen should you consider using it?n How would you use it?uArchitectureuDesignuImplementationuEIS Integration

Patterns of Enterprise Application Architecture – Martin Fowler, at. al.

Page 3: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

3©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

What

Page 4: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

4©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Implementing Business LogicImplementing Business Logic

n Using objects to model the business domainnModel supports complex application logicuIts more than data validation/verification

n Persistence is secondary considerationuFocus is the business logic not the data

n Essentially its an OO application

Process-centric approach versus data-centricProcess-centric approach versus data-centric

Page 5: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

5©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

When

Page 6: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

6©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

DataData--centric centric vrsvrs ProcessProcess--centriccentric

Data-centricn Data-drivenn Adhoc query based,

decision supportn Record oriented, batch

processingn Wrapping existing

database

Process-centricn Process-drivenn Navigational accessn Complex application logicn Object-orientedn Building a new application

Page 7: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

7©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Complexity of Business Logic

Com

plex

ity to

Impl

emen

t

Domain model-centric

Data-centric

Page 8: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

8©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Pro’s & Con’sPro’s & Con’s

Pro’sn Fully leverage OO benefitsn Long term payoff as

application complexity increases

Con’sn Requires OO expertisen Higher cost of entry for

simply application

Page 9: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

9©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

How

Page 10: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

10©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Application Data & Enterprise DataApplication Data & Enterprise Data

n Application Data is the domain model objects, distinct from Enterprise DatauApplication data modeled as objectsuEnterprise data already exists in other systems

n Interact with application data and transact with enterprise datan Application data doesn’t need to leave the middle-

tier

Page 11: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

11©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

What about the database?What about the database?

n Still need to persist application datan Interest is in storing/retrieving objects not

rows/columns

Page 12: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

12©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Alternative SolutionsAlternative Solutions

n O/R Mapping Toolsn DAO Design Patternu http://developer.java.sun.com/developer/restricted/patterns/Dat

aAccessObject.html

n EJB 2.0 CMPn Java Data Objectsu http://jcp.org/jsr/detail/012.jspu Transparent object persistenceu Could use ODB as middle-tier databasel http://www.versant.com/products/enjin/index.html

3 Reduces coding effort5 Proprietary 5 Mapping overhead

5 Extra coding effort5 Mapping overhead

3 No coding effort3 Java standard3 Open choice of datastore

3 Reduces coding effort3 J2EE standard5 Mapping overhead5 Ease of use

Page 13: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

13©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Contentious Conjecture…Contentious Conjecture…

“J2EE doesn’t offer much support fordomain model-centric applications”

Page 14: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

14©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

How(Architecture)

Page 15: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

15©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Business Users

ObjectRepository

PresentationLogic

BusinessLogic

Web ContentDelivery

EIS

Users

Clustering

Line of Business Systems

HTTP Servers

Load Balancing

Web A

pplication Servers

Application Servers

JSP/Servlet EJB

Java

XML/HTML XML

SOAP

UD

DI

Clustering

Firewall Firewall

DataW

arehouse

Data Migration

LDAP

Firewall

JCA/JDBC

Page 16: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

16©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

How(Design)

Page 17: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

17©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Domain Domain vrsvrs Component ModelsComponent Models

n Crucial to distinguish between Domain & Component modelsuDomain modellModels the data and relationships as Objects

u Component modellModels external, remote interfaces

n Merging the two leads to “fine grained” EJBs, every Java class being an EJBu Fine structure is too inefficient for heavy weight components

n Focus on “coarse grained” EJBsu Coarse structure diminishes benefits of OO approachu But good for defining interfaces & enterprise services

Page 18: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

18©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Modeling the DomainModeling the Domain

n Data ObjectsuObjects that represent “real-world” entitieslCustomer; Order; Product

uAnd their relationshipslCustomer “can have many” Orders

n Built using Java ClassesuLight-weightuIntra-VM access only

http://martinfowler.com/eaaCatalog/domainModel.html

Page 19: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

19©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Modeling the ComponentsModeling the Components

n Enterprise Java BeansuInterfaces that represent interactionslA customer “can place” an Orderl Provides a view or “façade” onto the domain model

uAnd their enterprise servicesl Security; naming; transaction management

n Built using Enterprise Java BeansuHeavy-weightuInter-VM access, distributed

http://martinfowler.com/eaaCatalog/remoteFacade.html

Page 20: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

20©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Component ModelDomain model

Account

Portfolio

Position

Trade

Instrument

Equity

0..*

0..*

1..*

AdminBeancreateCustomer()createInstrument()

Façade for Account/InstrumentSeparates business methods for managing domain model

AccountBeanmakeTrade()getPortfolioDetails()getTradeHistory()

Façade for AccountCustomer interactions, hides underlying navigational model

InstrumentBeangetAll ()getQuote()

Façade for InstrumentManipulates all Instruments, hides underlying inheritance model

Combines benefits of both Object modeling and EJB development

Page 21: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

21©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

How(Implementation)

Page 22: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

22©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Software LayeringSoftware Layering

n Separate implementation and isolate dependenciesuSimplifies development, testing, debug, maintenance

n Loosely-coupled componentsuIsolate client versus server-side classesuSimplifies distributed deployment

n Three main layersuModeluViewuControl

Page 23: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

23©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Software LayersSoftware Layers

viewaccountexception

controlejbAccountControllerTraderControllerInstrumentController

modelAccountPortfolioPositionTradeInstrumentEquity

<<manage>>

<<representation>>

<<instantiate>>

Classes in this package do not depend on any external classes and are all serializable

Page 24: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

24©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Model (Domain Object Model)Model (Domain Object Model)

n Data ObjectsuComplex data, complex data relationshipsuFine-graineduPersistent and transactional

n No business logicuMainly getters/setters

n Independent of View and Controller layersuAlthough may throw exceptions

Page 25: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

25©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

package trade.model

Page 26: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

26©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

View (External Data Interchange)View (External Data Interchange)

n Light-weight Java classesuSerializable, non-persistent, non-transactionaluSimple data and simple data relationshipsuIdeally immutableuNo external dependencies

n No business logicuMainly getters/setters

n Instantiated by Controller layer, representation of Model layer

http://martinfowler.com/eaaCatalog/dataTransferObject.html

Page 27: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

27©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

package trade.view

Page 28: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

28©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Control (Business Logic)Control (Business Logic)

n External InterfacesuBusiness LogicuCoarse-grained operations on domain modeluHandles persistence and transactions

nManages the Model Layer and instantiates the View Layer

Page 29: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

29©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Control (cont’d)Control (cont’d)

n Implement business logic as normal Java classesuSimplifies unit testing and debugginguCan be re-used with JSP/Servlets

n EJBs layer on top of business logic classesuAdd inter-component interactionsuAdd transaction propagation/managementuSupports distributed deployment

Page 30: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

30©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

package trade.control

Page 31: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

31©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

package trade.control.ejb

Page 32: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

32©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

ExceptionsExceptions

n Identify internal versus external exceptionsuInternal exceptions never thrown outside of Control

Layer

n External exceptions belong to View LayeruNo internal dependencies

Page 33: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

33©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

package trade.view.exception

Page 34: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

34©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

AccountSessionBean

Account

login(user:String,password:String):AccountRefdetails(ref:AccountRef):AccounDetailscreatePortfolio(ref:AccountRef):void

SessionBean

AccountRef AccountDetails

AccountControllerlogin(user:String,password:String):AccountRefdetails(ref:AccountRef):AccounDetailscreatePortfolio(ref:AccountRef):void

control

view model

<<delegates>>

<<creates>> <<manages>>

An Example…An Example…

Page 35: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

35©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Caller

getDetails

login

getAccountById

getId

getCashBalance

getPassword

findAccountByUserId

getDetails

login

AccountControllerBean AccountController Account

AccountRef

AccountDetails

Page 36: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

36©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Roles & ResponsibilitiesRoles & Responsibilitiesn J2EE + light-weight object persistence allows the

Domain model to be separated from the Component modeln Domain model is implemented as Java objectsn J2EE manages the Component modeluComponents manipulate the domain model as Java objectslComponents are stateless SessionBeans

Page 37: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

37©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

How(EIS Integration)

Page 38: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

38©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Enterprise CoordinationEnterprise Coordination

n Coordination of “Application Data” with Enterprise Information Systems (EIS)

n Different approaches depending on needsu Synchronousl Distributed Transaction Management (XA)

u Asynchronousl Omni or bi-directional

n Connectivityu Point-to-pointl JDBC/JCA

uMessage-orientedl JMS

Page 39: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

39©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Synchronous CoordinationSynchronous Coordination

n J2EE provides a Java Transaction ServiceuDistributed Transaction Manager

n Use J2EE architecture to build applicationu “Application Data” managed in the middle-tieru EIS connectivity via JDBC/CMP/JCA/JMS

n Transform objects to/from EIS representation as requiredu Tables/XML/…u Cache EIS data as “Application Data” for long running transactions

n Synchronization controlled by J2EEu Just need to call appropriate EJBs

n Message-driven Beans facilitate near-synchronous coordination

Page 40: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

40©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

J2EE

AccountSessionBean

TradeSessionBean

SynchronousSynchronous

Sequence of events:(1) AccountSessionBean

updates Account(2) AccountSessionBean calls

TradeSessionBean to execute a trade

(3) TradeSessionBeanexecutes trade

(4) J2EE commits transaction

ObjectRepository

TradeExecution

Engine

(2)

coordinated

(4)

(3)

(1)

Page 41: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

41©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

ConsiderationsConsiderations

Prosn Guaranteed consistency

Consn Expensiven Prone to unavailability of

external systemsu Unless using JMS

n Prone to performance bottlenecks of external systems

Page 42: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

42©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

J2EE

AccountSessionBean

TradeSessionBean

Using MessageUsing Message--driven Beansdriven Beans

Sequence of events:(1) AccountSessionBean

updates Account(2) AccountSessionBean

sends message toTradeSessionBean

(3) TradeSessionBean reads message

(4) TradeSessionBeanexecutes trade

ObjectRepository

TradeExecution

Engine

(1)

(3)

(2)

(4)

Queue

coordinated

coordinated

Page 43: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

43©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

ConsiderationsConsiderations

Prosn De-couples middle-tier

from enterprise systems

Consn Not synchronousn Additional complexity

Page 44: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

44©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Asynchronous CoordinationAsynchronous Coordination

n Middle-tier persistence guarantees long term storageu It’s a database!

n Use J2EE architecture to build applicationu “Application Data” managed in middle-tier

n Periodically propagate “business transactions” from middle-tier to enterprise systems and vice-versau Time-based; # of transactions; …

n Omni-directionalu From or to the middle-tier

n Bi-directional

Page 45: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

45©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Propagating changes from MiddlePropagating changes from Middle--tiertier

n Within J2EEu External event triggers EJB to perform synchronizationl EIS connectivity via JDBC/CMP/JCA/JMS

u Transform objects to EIS representationl Tables/XML/flat-files

n Outside J2EEu Batch processingl External application periodically exports changes from middle-tier to

appropriate EIS representation

n Suitable for propagating new “data”u No conflicts, “data” owner by middle-tier

Page 46: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

46©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Within J2EEWithin J2EE

Sequence of events:(1) AccountSessionBean

updates Accounts(2) An external trigger calls

TradeSessionBean(3) TradeSessionBean gets

trades from middle-tier(4) TradeSessionBean

executes batch of trades

J2EE

AccountSessionBean

TradeSessionBean

ObjectRepository

TradeExecution

Engine

(1)

(4)

(2)

(3)

Page 47: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

47©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Outside J2EEOutside J2EE

Sequence of events:(1) AccountSessionBean

updates Account(2) External application reads

updates(3) External application

executes batch of trades

J2EE

AccountSessionBeanObject

Repository

TradeExecution

Engine

(1)

(3)

(2)

ExternalApplication

Page 48: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

48©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Propagating changes to the MiddlePropagating changes to the Middle--tiertier

n Within J2EEu External event triggers EJB to perform synchronizationl EIS connectivity via JDBC/CMP/JCA/JMS

u Transform EIS data to appropriate object representation

n Outside J2EEu Batch processingl External application periodically exports changes from EIS to

appropriate object representation

n Suitable for propagating new “data” or changes to reference datau No conflicts, “data” owned by Enterprise

Page 49: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

49©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Within J2EEWithin J2EE

Sequence of events:(1) External system sends

message toInstrumentSessionBean

(2) InstrumentSessionBeanreads message

(3) InstrumentSessionBeancreates new instrument in the middle-tier

J2EE

InstrumentSessionBeanObject

Repository

TradeExecution

Engine

(3)

(1)

(2) ExternalApplication

Page 50: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

50©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Outside J2EEOutside J2EE

Sequence of events:(1) External application reads

changes from external system

(2) External application creates new instruments in the middle-tier

(3) InstrumentSessionBeancan read new instruments

J2EE

ObjectRepository

TradeExecution

Engine

(3)

(1)

(2)

ExternalApplication

InstrumentSessionBean

Page 51: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

51©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

ConsiderationsConsiderations

Prosn Decouples middle-tier

from enterprise systemsn Possible to coordinate with

batch-oriented systems

Consn Not synchronousn Not bi-directional

Page 52: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

52©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

BiBi--directional Coordinationdirectional Coordination

n Replication of changes to/from middle-tieruData changed both in the middle-tier and enterprise

system

n Introduces potential for conflicting updatesuBest approach is to avoid need for bi-directional updates

Page 53: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

53©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

SummarySummary

n Domain model-centric approach is good for process-centric applicationsuKeep object management orthogonal to the component

modelingn Domain model can easily support many use-cases

and applicationsn Software layering simplifies development and

reduces software dependenciesn Utilize J2EE capabilities for EIS Integration

Page 54: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

54©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Interesting Design PatternsInteresting Design Patterns

Sun Java Center J2EE Patternshttp://developer.java.sun.com/developer/restricted/patterns/J2EEPatternsAtAGlance.html

n Session Façaden Value Objectn Data Access Objectn Value Object AssemblerMartin Fowler’s Information System Architecturehttp://martinfowler.com/eaaCatalog/

n Domain Modeln Data Transfer Objectn Remote Façade

Page 55: A domain model-centric approach to J2EE developmentcarfield.com.hk/document/software+design/Keiron+Domain+Model+Centric.pdf · A domain model-centric approach to J2EE development

55©2003 Versant Corporation

All products are trademarks or registered trademarks of their respective companies in the United States and other countries. The information contained in this document is property of Versant Corporation.

Thank you