μ μ TDD κΈ°μ¬ μΌμλ μ½μΌλ©΄μ κ΅μ₯ν κ°λͺ
κΉμλ ꡬμ . λμμΈμμ λ‘μ§/UI λΆλ¦¬κ° μ΄λ»κ² μ΄λ£¨μ΄μ ΈμΌ νλκ°λ₯Ό μμ£Ό κ°λ¨νλ©΄μλ λͺ
λ£νκ² λ§ν΄μ€λ€. κ°μΈμ μΌλ‘ RefactoringBook μ μ½μμλλ³΄λ€ μ΄ κΈμ λ³Έ κ²μ΄ λ 좩격μ μ΄μλκ²μΌλ‘ κΈ°μ΅λλ€. (νΉν, RefactoringBook μ μ½μμλλ³΄λ€ μλμ μΌλ‘ λμμΈμ λν μ§μμ΄ λ μμμλμμλ μΆ©κ²©μ΄ λ μ»Έμμ.) :
{{|
When separating the presentation from the domain, make sure that no part of the domain code makes any reference to the presentation code. So if you write an application with a WIMP (windows, icons, mouse, and pointer) GUI, you should be able to write a command line interface that does everything that you can do through the WIMP interface -- without copying any code from the WIMP into the command line.
{{|
When separating the presentation from the domain, make sure that no part of the domain code makes any reference to the presentation code. So if you write an application with a WIMP (windows, icons, mouse, and pointer) GUI, you should be able to write a command line interface that does everything that you can do through the WIMP interface -- without copying any code from the WIMP into the command line.
λλ©μΈλͺ¨λΈλ‘λΆν° νλ μ ν
μ΄μ
λΆλΆμ΄ λΆλ¦¬λμμλ, λλ©μΈ μ½λμ μ΄λ ν λΆλΆλ presentattion μ½λμ κ΄λ ¨μ΄ μλλ‘ ν΄μΌ νλ€. 그리νμ¬ λ§μΌ WIMP GUI μ΄ν리μΌμ΄μ
μ μμ±νμλ λΉμ μ WIMP μΈν°νμ΄μ€λ₯Ό ν΅ν΄ ν μ μλ λͺ¨λ κ²λ€μ command line interface λ‘ μμ±ν μ μμ΄μΌ νλ€. WIMP μ½λλ‘λΆν° μ΄λ ν μ½λλ 볡μ¬νμ§ μκ³ .
|}}
|}}
μ΄λ UI λΆλΆμλ§ μ μ©λμ§ μλλ€. μΌμ’
μ InformationHiding μ κ°λ
μΌλ‘ νμ₯ν μ μλ€. μλ₯Ό λ€λ©΄ λ€μκ³Ό κ°μ΄ μμ©ν μ μμ§ μμκΉ.
{{|
λλ©μΈλͺ¨λΈλ‘λΆν° νΌμμ€ν΄μ€ λΆλΆμ΄ λΆλ¦¬λμμλ, λλ©μΈ μ½λμ μ΄λ ν λΆλΆλ νΌμμ€ν΄νΈ λ μ΄μ΄ μ½λμ κ΄λ ¨μ΄ μλλ‘ ν΄μΌ νλ€. λ§μΌ MySQL Repositoryμ μμ±νμλ λΉμ μ MySQL μΈν°νμ΄μ€λ₯Ό ν΅ν΄ ν μ μλ λͺ¨λ κ²λ€μ Flat File Repository interface λ‘ μμ±ν μ μμ΄μΌ νλ€. MySQL μ½λλ‘λΆν° μ΄λ ν μ½λλ 볡μ¬νμ§ μκ³ .
|}}
λ무 μ΄μμ μ΄λΌκ³ λ§ν μ§ λͺ¨λ₯΄κ² μ§λ§, DIP μ μ리λ₯Ό μ μ§ν¨λ€λ©΄(Dependency λ Abstraction μ λν΄μλ§ λ§Ίλλ€ λ±) κ°λ₯νμ§ μμκΉ μκ°. λλ, μμμμ WIMPλ₯Ό κ·Έλλ‘ μΉμΌλ‘ λ°κΎΈμ΄λ. μ΄λ ν λμμΈμ΄ λμ¬κΉ μμν΄λ³Έλ€.
--1002
{{|
λλ©μΈλͺ¨λΈλ‘λΆν° νΌμμ€ν΄μ€ λΆλΆμ΄ λΆλ¦¬λμμλ, λλ©μΈ μ½λμ μ΄λ ν λΆλΆλ νΌμμ€ν΄νΈ λ μ΄μ΄ μ½λμ κ΄λ ¨μ΄ μλλ‘ ν΄μΌ νλ€. λ§μΌ MySQL Repositoryμ μμ±νμλ λΉμ μ MySQL μΈν°νμ΄μ€λ₯Ό ν΅ν΄ ν μ μλ λͺ¨λ κ²λ€μ Flat File Repository interface λ‘ μμ±ν μ μμ΄μΌ νλ€. MySQL μ½λλ‘λΆν° μ΄λ ν μ½λλ 볡μ¬νμ§ μκ³ .
|}}
λ무 μ΄μμ μ΄λΌκ³ λ§ν μ§ λͺ¨λ₯΄κ² μ§λ§, DIP μ μ리λ₯Ό μ μ§ν¨λ€λ©΄(Dependency λ Abstraction μ λν΄μλ§ λ§Ίλλ€ λ±) κ°λ₯νμ§ μμκΉ μκ°. λλ, μμμμ WIMPλ₯Ό κ·Έλλ‘ μΉμΌλ‘ λ°κΎΈμ΄λ. μ΄λ ν λμμΈμ΄ λμ¬κΉ μμν΄λ³Έλ€.
--1002