-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...r-center-cp/cp-oc-domain/src/main/java/org/example/cp/oms/domain/facade/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* DDD Domain层和Infrastructure的粘合剂:通过倒置依赖. | ||
* | ||
* <p>domain层声明需要基础设施层实现的接口:RPC, DB, Cache, MQ等.</p> | ||
* <p>为了方便产品人员查看领域层代码,梳理业务,统一放在facade package,减少对产品同学的干扰.</p> | ||
*/ | ||
package org.example.cp.oms.domain.facade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...r-cp/cp-oc-domain/src/main/java/org/example/cp/oms/domain/model/vo/OrderItemDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.example.cp.oms.domain.model.vo; | ||
|
||
import org.example.cp.oms.domain.model.OrderModelCreator; | ||
import org.example.cp.oms.spec.model.vo.IOrderItem; | ||
import org.example.cp.oms.spec.model.vo.IOrderItemDelegate; | ||
import org.example.cp.oms.spec.model.vo.IProduct; | ||
import org.example.cp.oms.spec.model.vo.IProductDelegate; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class OrderItemDelegate implements IOrderItemDelegate { | ||
|
||
private List<OrderItem> items; | ||
|
||
private OrderItemDelegate() {} | ||
|
||
public static OrderItemDelegate createWith(@NotNull OrderModelCreator creator) { | ||
OrderItemDelegate delegate = new OrderItemDelegate(); | ||
delegate.items = new ArrayList<>(); | ||
return delegate; | ||
} | ||
|
||
@Override | ||
public List<? extends IOrderItem> getItems() { | ||
return items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...nter-cp/cp-oc-spec/src/main/java/org/example/cp/oms/spec/model/vo/IOrderItemDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.example.cp.oms.spec.model.vo; | ||
|
||
import java.util.List; | ||
|
||
public interface IOrderItemDelegate { | ||
List<? extends IOrderItem> getItems(); | ||
} |