νΌμ‚¬λ“œ

μ–΄λ–€ νŠΉμ • μ„œλΈŒμ‹œν…œμ΄ 일련의 μΈν„°νŽ˜μ΄μŠ€μ— λŒ€ν•œ ν†΅ν•©λœ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ œκ³΅ν•œλ‹€.

νΌμ‚¬λ“œμ—μ„œλŠ” κ³ μˆ˜μ€€μ˜ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ •μ˜ν•˜κΈ° λ•Œλ¬Έμ— μ„œλΈŒμ‹œμŠ€ν…œμ„ 더 μ‰½κ²Œ μ‚¬μš©ν•  수 μžˆλ‹€.

Facade Pattern - Before

μœ„μ—μ„œ Employee Data λΌλŠ” λ¦¬μ†ŒμŠ€λ₯Ό μ–»κΈ° μœ„ν•΄ Pay Calculator Hour Reporter Employee Saver λ“±κ³Ό 같은 클래슀λ₯Ό μ΄μš©ν•˜λŠ” κ²½μš°κ°€ μžˆλ‹€.

μ΄λ•Œ κ°œλ°œμžλŠ” 세가지λ₯Ό μΈμŠ€ν„΄μŠ€ν™”ν•΄μ„œ μ‚¬μš©ν•΄μ•Ό ν•˜λŠ”λ° μœ„ μ„Έκ°€μ§€μ˜ μΈμŠ€ν„΄μŠ€λ₯Ό μ ‘κ·Όν•˜λŠ” κ³ μˆ˜μ€€μ˜ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ μš©ν•˜μ—¬ μ΄μš©ν•˜λŠ” 방식이닀.

Facade Pattern - After

μœ„μ™€ 같이 Employee Facade μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ μš©ν•˜μ—¬ 쒀더 μœ μ—°ν•˜κ²Œ 접근이 κ°€λŠ₯ν•˜λ‹€.

참고자료

https://jusungpark.tistory.com/23