測試驅動的Rails開發系列之二——實體
The Building Blocks of Domain Driven Design
This time I’d like to start talking about the buildingblocks of Domain Driven Design, and how they can be used for modeling.
Entities and Values
In Domain Driven Design, an important distinction is drawnbetween Entities and Value Objects.
“An Entity is an object defined not by its attributes, butby a thread of continuity and identity.” An example of an Entity would be abank account. Many bank accounts can exist in our system at the same time. Someof them can be assigned to the same branch or have the same owner, but it’simportant for our system to treat them as different accounts as long as theyhave different identities. In case of a Rails application, an identity of anEntity is usually represented by an auto-generated primary key.
“A Value Object is an object that describes somecharacteristic or attribute but carries no concept of identity.” As there is noidentity, two Value Objects are equal when all their attributes are equal. Anexample of a Value Object would be Money.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-730952/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 測試驅動的Rails開發系列之一——分層架構AI架構
- "測試"驅動開發
- 談“測試驅動的開發”
- 【敏捷開發】驅動測試開發敏捷
- 測試驅動開發(TDD)的思考
- 測試驅動開發(TDD)實戰心得 - DeniMoka
- Scrum敏捷軟體開發之技術實踐——測試驅動開發TDDScrum敏捷
- 小議測試驅動開發
- 測試驅動開發在專案中的實踐
- 基於Python的測試驅動開發實戰Python
- 基於測試驅動的iOS開發iOS
- 面向 C++ 的測試驅動開發C++
- Laravel 測試驅動開發 -- 正向單元測試Laravel
- TDD(測試驅動開發)死了嗎?
- 你這不是測試驅動開發
- 什麼是測試驅動開發
- 變異測試是測試驅動開發(TDD)的演變
- 測試驅動開發(TDD)例項演示
- 測試驅動開發到底好不好
- 簡單的11步在Laravel中實現測試驅動開發Laravel
- 簡單的 11 步在 Laravel 中實現測試驅動開發Laravel
- 是否使用TDD(測試驅動開發)進行UI開發UI
- 測試驅動開發(TDD)跟敏捷開發有衝突敏捷
- 拒絕測試驅動開發(TDD)的10個理由
- 測試驅動開發上的五大錯誤
- 模型驅動的軟體測試技術模型
- 行為驅動開發在 Python 開發測試中的應用Python
- 測試驅動開發(TDD)總結——原理篇
- 驅動開發目標測試機器設定
- Kent Beck 的《測試驅動開發》(TDD) Money示例Ruby版
- Python 實現行為驅動開發 (BDD) 自動化測試詳解Python
- 在Ruby on Rails/Naked Objects精神指引下的域驅動開發框架AIObject框架
- 有自驅力的測試開發實習生
- 軟體開發中的自動化測試
- 測試驅動開發(TDD)—— 資料庫查詢篇資料庫
- Fitness function-driven development(測試驅動開發) 翻譯Functiondev
- SOA 環境中的測試驅動的開發,第 1 部分: 測試資料對映
- TDD---測試驅動開發,簡單的一點認識