슬라이드 1

Similar documents
Spring Data JPA Many To Many 양방향 관계 예제

ETL_project_best_practice1.ppt

Web Application을 구성하는 패턴과 Spring ROO의 사례

슬라이드 1

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

- JPA를사용하는경우의스프링설정파일에다음을기술한다. <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localentitymanagerfactorybean" p:persistenceunitname=

Spring Boot/JDBC JdbcTemplate/CRUD 예제

thesis

유니티 변수-함수.key

Microsoft PowerPoint - Smart CRM v4.0_TM 소개_ pptx

[Brochure] KOR_TunA

DW 개요.PDF


Service-Oriented Architecture Copyright Tmax Soft 2005

Intro to Servlet, EJB, JSP, WS

JAVA PROGRAMMING 실습 05. 객체의 활용

Design Issues

쿠폰형_상품소개서

SQL Developer Connect to TimesTen 유니원아이앤씨 DB 기술지원팀 2010 년 07 월 28 일 문서정보 프로젝트명 SQL Developer Connect to TimesTen 서브시스템명 버전 1.0 문서명 작성일 작성자

ecorp-프로젝트제안서작성실무(양식3)

q 이장에서다룰내용 1 객체지향프로그래밍의이해 2 객체지향언어 : 자바 2

Microsoft PowerPoint - 인소프트.ppt

PowerPoint 프레젠테이션

금오공대 컴퓨터공학전공 강의자료

untitled

PowerPoint Presentation

PowerPoint Presentation

DBMS & SQL Server Installation Database Laboratory

Interstage5 SOAP서비스 설정 가이드

UML

thesis

4 CD Construct Special Model VI 2 nd Order Model VI 2 Note: Hands-on 1, 2 RC 1 RLC mass-spring-damper 2 2 ζ ω n (rad/sec) 2 ( ζ < 1), 1 (ζ = 1), ( ) 1

김기남_ATDC2016_160620_[키노트].key

쉽게 풀어쓴 C 프로그래밍

PowerPoint Presentation

The Self-Managing Database : Automatic Health Monitoring and Alerting

PowerPoint Presentation

JAVA PROGRAMMING 실습 08.다형성

MVVM 패턴의 이해

No Slide Title

논리적 구조 설계: 패키지도

슬라이드 1

Windows 8에서 BioStar 1 설치하기

이도경, 최덕재 Dokyeong Lee, Deokjai Choi 1. 서론

TTA Journal No.157_서체변경.indd

PowerPoint Presentation

PCServerMgmt7

Microsoft PowerPoint - Lect04.pptx

final_thesis

Microsoft PowerPoint 장강의노트.ppt

쉽게 풀어쓴 C 프로그래밊

Portal_9iAS.ppt [읽기 전용]


엔젤입문 초급자과정

- 목차 - 1. 프로젝트소개 배경및목적 프로젝트기능 4 2. 관련기술 웹사이트개발 패션데이터분석알고리즘 기대효과 진행상황 참조

Model Investor MANDO Portal Site People Customer BIS Supplier C R M PLM ERP MES HRIS S C M KMS Web -Based

1217 WebTrafMon II

금오공대 컴퓨터공학전공 강의자료

Microsoft PowerPoint - 27.pptx

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

Intra_DW_Ch4.PDF

DocsPin_Korean.pages

슬라이드 1

Ç¥Áö

초보자를 위한 ADO 21일 완성

Microsoft PowerPoint - JCO2007_Spring2.0_발표자료_Rev-A.ppt [호환 모드]

I. Introduction... 1 II. Jdbc Support 구현배경 사용자요구사항 p6spy Architecture Architecture InjectionPa

Mstage.PDF

파워포인트 템플릿

JDBC 소개및설치 Database Laboratory

SchoolNet튜토리얼.PDF

Spring 정의 2012 년 1 월 31 일화요일 오젂 9:17 1. 개요 1.1. 목적 수많은프로젝트에서프레임워크나아키텍체에대한관심없이대부분의개발을개발자의능력에젂담시키는것이일반적이다. 이는프로젝트의위험요소를증가시킬뿐만아니라개발완료후유지보수비용을증가시킴으로써추가적인비

10.ppt

교육2 ? 그림

Chap7.PDF

윈도우시스템프로그래밍

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

[Brochure] KOR_LENA WAS_

2 단계 : 추상화 class 오리 { class 청둥오리 extends 오리 { class 물오리 extends 오리 { 청둥오리 mallardduck = new 청둥오리 (); 물오리 redheadduck = new 물오리 (); mallardduck.swim();

gnu-lee-oop-kor-lec06-3-chap7

JAVA PROGRAMMING 실습 05. 객체의 활용

PowerPoint 프레젠테이션

제목

제11장 프로세스와 쓰레드

레이드과정을통해서소개될것을기대해왔다. 하지만 DDD라는단어와의만남은그리쉽게예측할수없었던것이라스프링커뮤니티와관련개발자들사이에서도적지않은화제를불러일으키게되었다. 대다수의스프링개발자들은 2.0에대한발표소식을들으며, 함께소개된 DDD에대해서도많은관심을가지기시작했다. 2006년

슬라이드 제목 없음

PowerPoint Presentation

PowerPoint 프레젠테이션

Microsoft PowerPoint - 04-UDP Programming.ppt

쉽게 풀어쓴 C 프로그래밍

(, sta*s*cal disclosure control) - (Risk) and (U*lity) (Synthe*c Data) 4. 5.

MasoJava4_Dongbin.PDF

No Title

PowerPoint 프레젠테이션

혼자서일을다하는 JSP. 이젠일을 Servlet 과나눠서한다. JSP와서블릿의표현적인차이 - JSP는 <html> 내에서자바를사용할수있는수단을제공한다. - 서블릿은자바내에서 <html> 을작성할수있는수단을제공한다. - JSP나서블릿으로만웹페이지를작성하면자바와다양한코드가

JVM 메모리구조

PowerPoint 프레젠테이션

슬라이드 1

<FEFF E002D B E E FC816B CBDFC1B558B202E6559E830EB C28D9>

歯Writing_Enterprise_Applications_2_JunoYoon.PDF

Transcription:

Continuous Integration 엔터프라이즈어플리케이션아키텍처 조영호카페PJT팀 2008.10.01 youngho.cho@nhncorp.com

목차 1. Domain Logic Pattern 2. Data Source Pattern 3. Putting It All Together

1. Domain Logic Pattern

Layered Architecture 3 레이어아키텍처 프리젠테이션 (Presentation) 사용자요청처리처리결과에따른뷰생성화면네비게이션처리도메인로직 (Domain Logic) 비즈니스로직처리어플리케이션플로우처리 Presentation Domain Logic Service Domain Model Presentation Domain Logic Transaction Script Anemic Domain Model 퍼시스턴스 (Persistence) DB 관련로직처리 Persistence Persistence 4 / 문서의제목

Transaction Script 작동원리 비즈니스로직을단일프로시저로구성프로시저는하나의트랜잭션을의미각트랜잭션은하나의트랜잭션스크립트로구성 EJB의기본아키텍처 사용시점 도메인로직이단순한경우적합 단점 코드중복 Anemic Domain Model 행위와데이터분리유지보수성저해 RecognitionSevice recognizedrevenue(contractid, asof) : Money caculaterevenuerecognitions(contractid) : void 5 / 문서의제목

Transaction Script 중앙집중식 (Centralized) 제어스타일 트랜잭션스크립트가대부분의중요사항결정 Anemic Domain Model 수반트랜잭션스크립트주변의오브젝트는 dumb object getter/setter 메소드만포함 Value Object, Data Transfer Object, Transfer Object a Recognition Service a Data Gateway caculaterecgontions(contractid) findcontract(contractid)) a contract result set get data *insert revenue recognition 6 / 문서의제목

Domain Model 작동원리 행위와데이터를통합하는도메인의객체모델 상호연결된객체들간의협동을통해비즈니스로직처리 사용시점 비즈니스로직이복잡한경우적합요구사항이계속변하는경우 Data Mapper를사용하는경우 DDD(Domain-Driven Design) [DDD] 단점 OO 분석 / 설계능력을보유한팀필요 Contract recognizedrevenue(date) calculaterecognitions() * 1 Product calculaterecognitions(contract) 1 RecognitionStrategy CompleteRecognition Strategy 7 / 문서의제목

Domain Model 위임식 (delegated), 분산식 (dispersed) 제어스타일 연관된오브젝트들에게책임을분산특정오브젝트가모든동작을제어하기보다는오브젝트들이상호협력및조율모든결정들은조그만책임들로축소 Real Object-Oriented a Contract a Product a Recognition Strategy caculaterecgontions caculaterecgontions(a Contract) caculaterecgontions(a Contract) * new a Revenue Recognition 8 / 문서의제목

Domain Model 예 영화예약시스템 Region 0..* Theater ShowingType 1 1 0..* 1 Seat 0..1 leftseat 0..* 0..1 rightseat ShowingRoom 1 0..* Showing getavailableadjacentseats() reserveseats() sellreservationseats() seatid 1 1 Movie SeatState isavailable() next() previous() 1 1 ReservationSeat isadjacent() isavailable() reserve() Sell() 0..* 0..1 Reservation caculatereservationprice() calculatepurchaseprice() Paid() AbstractSeatState 0..1 leftseat 0..1 rightseat 1 0..1 Purchase 0..1 nextseatstate 0..1 previousseatstate Occupied Reserved Sold 9 / 문서의제목

Service Layer 작동원리어플리케이션경계정의 비즈니스오퍼레이션집합을정의 트랜잭션제어 오퍼레이션의응답조정 어플리케이션비즈니스로직캡슐화 Transaction Script 패턴의경우 Transaction Script 자체가 Service Layer 의역할수행 구현방법 Domain Façade Domain Model 위의얇은 Façade 집합으로구현 Operation Script 일련의두꺼운클래스로구현 어플리케이션로직을직접구현하지만도메인로직은 Domain Model 로위임 자바구현 POJO Façade AOP 를사용한 POJO Session Façade EJB Sessio Bean 10 / 문서의제목

Layered Architecture Presentation Presentation Domain Logic Service Domain Logic Transaction Script Domain Model Anemic Domain Model Persistence Persistence Domain Model Transaction Script 11 / 문서의제목

2. Data Source Pattern

Table Data Gateway 작동원리데이터베이스테이블에대한 Geateway 역할을하는객체 하나의테이블데이터게이트웨이는단일테이블또는뷰에접속하는 SQL 처리 사용시점간단한도메인모델이나트랜잭션스크립트를사용하는경우 Person Gateway find(id) : RecordSet findwithlastname(string) : RecordSet update(id, lastname, firstname, numberofdependents) insert(lastname, firstname, numberofdependents) delete(id) 13 / 문서의제목

DAO(Data Access Object) 작동원리독립된레이어에데이터접근및조작에관련된로직을캡슐화 클라이언트에게단일한 API 를제공 자바인터페이스의추상화계층제공 사용시점비즈니스로직과영속성로직간의분리를원하는경우 비즈니스객체로부터서로다른데이터접근전략을감추려는경우 Business Object Business Object DAO DAO JdbcDAO EjbDao CmpEntity Bean CmpEntity Bean CmpEntity Bean 14 / 문서의제목

Data Mapper 작동원리객체와데이터베이스간의독립성을유지하면서객체와데이터베이스간에데이터이동 Impedance Mismatch 해결 메모리객체는데이터베이스의존재를인식하지않아도됨 ORM(Object-Relational Mapper) Domain Model 패턴기반의 POJO 개발을위한필수요소 사용시점데이터베이스스키마와객체모델이독립적으로발전하기를바라는경우 Domain Model 패턴적용시 비즈니스로직이복잡한경우 Data Mapper 를자체개발하지말것 Person lastname firstname numberofdependents getexemption isflaggedforaudit gettaxableearnings insert update delete PersonMapper 15 / 문서의제목

Repository 작동원리생명주기중간에 Entity 를 traverse 하기위한시작지점제공 Entity 컬렉션을관리 Entity 를검색하고삭제하기위한메소드정의 사용시점 Domain Model 패턴을사용하여 Domain Logic 을구성하는경우 Domain Logic Layer 내에서 Entity 에대한전역접근이필요한경우 Entity 에대한가상적인 in-memory 컬렉션을제공하려는경우 Repository 는 Domain Logic Layer 에포함 fortrackingid( t456 ) client t456 :TradeOrderRepository fortrackingid(string) : TradeOrder outstandingforbreakerageaccountid(string) : Collection locate/reconstitute t456:tradeorder trackingid = t456 brokerageaccountid = 123 type = BuyOrder security = WCOM numberofshares = 500 16 / 문서의제목

Lazy Loading 작동원리오브젝트가실제로사용될때데이터베이스로부터자동로드 불필요한경우로드시간절약 :Customer the database getorders() [ objects not loaded ] Customer * Order load orders orders 17 / 문서의제목

3. Putting It All Together

Transaction Script Based Architecture 기본패턴 Transaction Script 비즈니스로직제어중앙집중화 Table Data Gateway DAO 구현시테이블별로데이터접근로직구성 Anemic Domain Model getter/setter 메소드만을가지는데이터전송용객체 프레임웍구성 Spring Aspect-Oriented Programming Dependency Injection ibatis SQL Maps SQL Mapper DAO 내부구현 Table Data Gateway 구성 SQL 을 XML 로관리 Anemic Domain Model 과 SQL 결과값간의자동매핑 19 / 문서의제목

Transaction Script Based Architecture EJB Example <<session bean>> TransfrerService TrasactionDetails transfer(fromaccountid, toaccountid, amount) AccountDAO TrasactionDAO TransaferResultDTO AccountDTO Account(accountId) saveaccount(accountdto) AccountDTO Account(accountId) saveaccount(accountdto) AccountDTO accountid balance txnid date TransactionDetailsDTO 20 / 문서의제목

Transaction Script Based Architecture POJO Example Spring AOP Spring Dependency Injection RevenueRecognitionDAO Spring Transaction Interceptor RecognitionSevice recognizedrevenue(contractid:long, asof:data):money caculaterevenuerecognitions(contractid:long) : void -recognitiondao RecognitionSeviceImpl Anemic Domain Model ReveneuRecognition findrevenuerecognition(id:long) : RevenueRecognition saverevenuerecognition(recognition:revenuerecognition) : void getamount() : Money setamount(money:money) : void getdate() : Date setdate(date:data) : void SqlMapRevenueRecognitionDAO Table SQL Mapping XML Document Data Gateway 21 / 문서의제목

영화예약 Class Diagram ScheduleBO reserve(showingid:long, seats:long[],adultseatcount:int, teenagerseatcount:int) : Reservation ReservationDAO createreservation(reservatio) : Reservation ScheduleBOImpl ReservationSeatDAO updatereservationseatstate(reservationseat) : int getreservationseat(seatid:long, lock:boolean):reservationseat Reservation getid() : long setid(long) : void getshowingid() : long setshowingid(long) : void getadultseatcount() : int setadultseatcount(int) : void getteenagerseatcount() : int setteenagerseatcount() : int ReservationSeat getid() : long setid(long) : void getseatstate() : String setseatstate(string) : void 22 / 문서의제목

영화예약 Sequence Diagram reservation=r eserve(showingid, seatids, adultseatcount, teenagerseatcount) :TransactionScript reservation :Reservation :ReservationDAO :ReservationSeatDAO reservationseat :ReservationSeat <<create>> createreservation(reservation) reservationseat=getreservationseat(seatid, true) setstate( 02 ) reservationid=getreservationid() updatereservationid(reservationid) updatereservationseatstate() 23 / 문서의제목

Domain Model Based Architecture 기본패턴 Service Layer 어플리케이션경계정의트랜잭션제어 Domain Model 행위와데이터를함께가지는도메인객체들로구성객체들의협력을통해비즈니스로직처리 Data Mapper 도메인객체와데이터베이스간의매핑수행 ORM(Object-Relational Mapper) 사용 프레임웍구성 Spring Aspect-Oriented Programming Dependency Injection Hibernate Open-Source ORM Repository 내부구현 Data Mapper 구성투명한영속성 (Transparent Persistence) Metadata Mapping 24 / 문서의제목

Domain Model Based Architecture POJO Example Spring AOP Spring Transaction Interceptor TransferService BankingTransaction transfer(fromid, toid, amount) Spring Dependency Injection Domain Model TransferServiceImpl Banking Transaction Account debit(amount) credit(amount) AccountRepository findaccount(id) BankingTransactionRepository createtransaction(..) Data Mapper OverdraftPolicy Hibernate AccountRepository BankingTransaction Repository New OverdraftPolicy Limitted OverdraftPolicy Hibernate Object/relational mapping XML document 25 / 문서의제목

영화예약 Class Diagram ScheduleService reserve(showingid:long, seats:long[],adultseatcount:int, teenagerseatcount:int) : Reservation ShowingRepository -showingrepository ScheduleServiceImpl -reservationrepository ReservationRepository getshowingwithlock(showingid) :Showing savereservation(reservation) Showing seatid 1 SeatState 1 1 ReservationSeat 0..* 0..1 Reservation 0..1 leftseat 0..1 rightseat AbstractSeatState 0..1 nextseatstate 0..1 previousseatstate Occupied Reserved Sold 26 / 문서의제목

영화예약 Sequence Diagram reservation= reserve(showingid, seatids, adultseatcount, teenagerseatcount) :ScheduleService :Showing Repository showng :Showing seat :ReservationSeat Unoccupied State :Unoccupied reservedstat e :Reserved :Reservation Repository showing=getshowingwithlock(showingid) reservation=reserveseats(seatids, adultseatcount, teenagerseatcount) <<create>> reservation :Reservation calculatereservationprice( ) loop reserve(reservation) [for ReservationSeats in seatids] next(reservation) setstate( reservedstate) savereservation(reservation) 27 / 문서의제목

Thank you.

Question.