Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
starslink
dddplus-17
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
dddplus-17
/
dddplus-spec
/
src
/
main
/
java
/
io
/
github
/
dddplus
/
model
/
IAggregateRoot.java
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
30 lines (27 loc) · 1.59 KB
master
Breadcrumbs
dddplus-17
/
dddplus-spec
/
src
/
main
/
java
/
io
/
github
/
dddplus
/
model
/
IAggregateRoot.java
Copy path
Top
File metadata and controls
Code
Blame
30 lines (27 loc) · 1.59 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* Copyright DDDplus Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.github.dddplus.model;
import io.github.dddplus.ext.IIdentity;
/**
* 聚合根,Aggregate Facade,(具有全局身份,负责维护聚合内一致性).
*
* <p>Aggregate is a tree with a single root:the {@link IAggregateRoot},聚合内其他{@code Entity}都是Local Entity,Local Entity不能脱离Global Entity存在和被引用.</p>
* <p>聚合的本质就是建立了一个比类粒度更大的边界,聚集那些紧密关联的对象,形成了一个业务整体(边界).</p>
* <p>这样,外部需要关心的模型元素数量减少,复杂性下降:避免了错综复杂难以维护的对象关系网的形成.</p>
* <p>寻找对象关系天然就比较少的地方作为聚合的边界划分!</p>
* <p>聚合边界外有side effect的交互都必须通过{@link IAggregateRoot},只有这样才能保证业务一致性,副作用局部化,satisfy invariants,状态变化才可跟踪.</p>
* <ol>聚合根,作为聚合的门面,如何把住大门?记住这2个原则:
* <li>The root entity controls access and cannot be blindsided by changes to its internals</li>
* <li>passing out references to internal members that support MUTATION operations is NOT Allowed</li>
* </ol>
* <ol>设计聚合边界内的对象应满足如下一致性规则:
* <li>生命周期一致性</li>
* <li>问题域一致性</li>
* <li>场景一致性</li>
* </ol>
*/
public interface IAggregateRoot extends IIdentity, IDomainModel {
}
You can’t perform that action at this time.