More Related Content Similar to 领域驱动设计实例讲解 (20) 领域驱动设计实例讲解2. A. DDD
B. DDD
C. DDD
GAP
Book Store GAP DDD
3. DDD(1)
2004 Eric Evans
Domain-Driven Design –Tackling Complexity in
the Heart of Software —
“ (
DDD)”
5. DDD
•
•
•
•
•
•
•
•
• CRUD
•
9. DDD Ref POJO in action
10. DDD (1)
Object
Entities Objects with a distinct identity
ID
Value objects Objects with no distinct identity
Factories Define methods for creating entities
Repositories Manage collections of entities and
encapsulate the persistence framework DAO
Services Implement responsibilities that can’t be assigned
to a single class and encapsulate the domain model
12. A.
B.
GAP
Book Store GAP DDD
17. A. GAP
GAP B. GAP DDD
C.
Book Store GAP DDD
19. GAP (2)
View GAP B/S
web JSP JS
AJAX
Control
Action
Domain
Persistence O/R
Mapping JDBC
IOC
21. GAP (2)
GAP
(Business Service)
(DAO)
(OrderModel)
VO Entity
Entity Entity
DAO
GAP VO
22. GAP
Business Service
Business Service
Domain Model VO Entity
UML
27. Book Store
(Order)
gap.template.bookstore.model.Order
init(Account account,List newItems)
Items
submit(IBookStoreDao dao,List newItems)
cancle(IBookStoreDao dao) item
“ ” dao
dispose(IBookStoreDao dao) service
Acount payment
dispose
29. Book Store
(Accoun)
gap.template.bookstore.model.Account
payment(IBookStoreDao dao,BigDecimal price)
(
)
dao
augmentMoney(BigDecimal moeny)
service
setDiscount isAdmin
31. Book Store
(Cart)
ItemVO(
javabean) List
addItem(ItemVO item)
removeItem(ItemVO item)
removeItemByBookId(String bookId)
item book bookId item bookId
item
35. TM
IT
: 68 A (100094)
: 86-10-62431717
: 86-10-62431800
: info@use.com.cn