Slide 13
Slide 13 text
サンプルコー
ドで示すサー
ビスクラス
c
l
a
s
s R
e
g
i
s
t
e
r
H
o
g
e
h
o
g
e
S
e
r
v
i
c
e
d
e
f i
n
i
t
i
a
l
i
z
e
(
m
o
d
e
l
A
, m
o
d
e
l
B
, m
o
d
e
l
C
)
d
e
f e
x
e
c
u
t
e #
起動以外のp
u
b
l
i
c
メソッドは持たせない
A
c
t
i
v
e
R
e
c
o
r
d
:
:
B
a
s
e
.
t
r
a
n
s
a
c
t
i
o
n d
o
r
e
s
u
l
t
A = m
o
d
e
l
A
.
d
o
_
s
o
m
e
s
h
i
n
g
A
r
e
s
u
l
t
B = m
o
d
e
l
B
.
d
o
_
s
o
m
e
t
h
i
n
g
B
(
r
e
s
u
l
t
A
)
m
o
d
e
l
C
.
d
o
_
s
o
m
e
t
h
i
n
g
C
(
r
e
s
u
l
t
B
)
e
n
d
r
e
s
c
u
e
n
i
l
e
n
d
e
n
d
可読性のために一時的な状態やメソッド抽出をプライベー
トメソッドで
行える様にインスタンスメソッドレイヤー
に処理を定義する方が良い。
特にクラスレイヤー
で色々
やるとマルチスレッド時に危険。
ex
ecut
e以外で持ってよいメソッドはエラー
ハンドルぐらい。