Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add client-side pattern (#2685) #2755

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions localization/zh/marker/READEME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Marker Interface
category: Structural
language: ch
tag:
- Decoupling
---

## 目的
使用空接口作为标记来区分特殊处理的对象。

## 类图
![alt text](./etc/MarkerDiagram.png "Marker Interface")

## 适用场景
在以下场景使用Marker Interface pattern

* 您希望将特殊对象与普通对象区分开来(以不同方式处理它们)
* 您希望标记某些对象可用于某些类型的操作

## 应用案例

* [javase.8.docs.api.java.io.Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)
* [javase.8.docs.api.java.lang.Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html)

## 鸣谢

* [Effective Java](https://www.amazon.com/gp/product/0134685997/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0134685997&linkCode=as2&tag=javadesignpat-20&linkId=4e349f4b3ff8c50123f8147c828e53eb)
Binary file added localization/zh/marker/etc/MarkerDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions localization/zh/marker/etc/MarkerDiagram.ucls
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<class-diagram version="1.2.0" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
realizations="true" associations="true" dependencies="false" nesting-relationships="true" router="FAN">
<class id="1" language="java" name="Guard" project="marker" file="/marker/src/main/java/Guard.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="416" y="348"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<interface id="2" language="java" name="Permission" project="marker" file="/marker/src/main/java/Permission.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="261" y="175"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</interface>
<class id="3" language="java" name="Thief" project="marker" file="/marker/src/main/java/Thief.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="236" y="355"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<realization id="4">
<end type="SOURCE" refId="1"/>
<end type="TARGET" refId="2"/>
</realization>
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</classifier-display>
<association-display labels="true" multiplicity="true"/>
</class-diagram>
2 changes: 2 additions & 0 deletions localization/zh/marker/etc/marker.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@startuml
@enduml
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<module>thread-local-storage</module>
<module>optimistic-offline-lock</module>
<module>crtp</module>
<module>client-side</module>
</modules>
<repositories>
<repository>
Expand Down
Loading