Skip to content

Commit c9f2d26

Browse files
committed
translation: translation of marker factory pattern to chinese iluwatar#2289
1 parent 163c301 commit c9f2d26

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

localization/zh/marker/READEME.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Marker Interface
3+
category: Structural
4+
language: ch
5+
tag:
6+
- Decoupling
7+
---
8+
9+
## 目的
10+
使用空接口作为标记来区分特殊处理的对象。
11+
12+
## 类图
13+
![alt text](./etc/MarkerDiagram.png "Marker Interface")
14+
15+
## 适用场景
16+
在以下场景使用Marker Interface pattern
17+
18+
* 您希望将特殊对象与普通对象区分开来(以不同方式处理它们)
19+
* 您希望标记某些对象可用于某些类型的操作
20+
21+
## 应用案例
22+
23+
* [javase.8.docs.api.java.io.Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)
24+
* [javase.8.docs.api.java.lang.Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html)
25+
26+
## 鸣谢
27+
28+
* [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)
6.31 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<class-diagram version="1.2.0" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
3+
realizations="true" associations="true" dependencies="false" nesting-relationships="true" router="FAN">
4+
<class id="1" language="java" name="Guard" project="marker" file="/marker/src/main/java/Guard.java" binary="false"
5+
corner="BOTTOM_RIGHT">
6+
<position height="-1" width="-1" x="416" y="348"/>
7+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
8+
sort-features="false" accessors="true" visibility="true">
9+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
10+
<operations public="true" package="true" protected="true" private="true" static="true"/>
11+
</display>
12+
</class>
13+
<interface id="2" language="java" name="Permission" project="marker" file="/marker/src/main/java/Permission.java"
14+
binary="false" corner="BOTTOM_RIGHT">
15+
<position height="-1" width="-1" x="261" y="175"/>
16+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
17+
sort-features="false" accessors="true" visibility="true">
18+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
19+
<operations public="true" package="true" protected="true" private="true" static="true"/>
20+
</display>
21+
</interface>
22+
<class id="3" language="java" name="Thief" project="marker" file="/marker/src/main/java/Thief.java" binary="false"
23+
corner="BOTTOM_RIGHT">
24+
<position height="-1" width="-1" x="236" y="355"/>
25+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
26+
sort-features="false" accessors="true" visibility="true">
27+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
28+
<operations public="true" package="true" protected="true" private="true" static="true"/>
29+
</display>
30+
</class>
31+
<realization id="4">
32+
<end type="SOURCE" refId="1"/>
33+
<end type="TARGET" refId="2"/>
34+
</realization>
35+
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
36+
sort-features="false" accessors="true" visibility="true">
37+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
38+
<operations public="true" package="true" protected="true" private="true" static="true"/>
39+
</classifier-display>
40+
<association-display labels="true" multiplicity="true"/>
41+
</class-diagram>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@startuml
2+
@enduml

0 commit comments

Comments
 (0)