์ ์ฒด ๊ธ (7) ์ธ๋ค์ผํ ๋ฆฌ์คํธํ IEnumerable<T>, ICollection<T>, IList<T> and List<T> IEnumerable Exposes the enumerator, which supports a simple iteration over a collection of a specified type. This is the base interface for any collection under system.Collection.Generic IEnumerable contains only GetEnumerator() method, like read-only iterate. Iteration means that you do not want any index based search or any write or any insert or remove.(only read records). You can only read r.. ์์กด์ฑ ์ฃผ์ (Dependency Injection) ์ข ๋ฅ /@RequiredArgsConstructor 1. ์์กด์ฑ ์ฃผ์ (Dependency Injection) ์ข ๋ฅ ์์กด์ฑ ์ฃผ์ ์ ์ข ๋ฅ๋ก๋ Field, Setter, Constructor(์์ฑ์) ๋ฐฉ์์ด ์๋ค. 1) Field Injection public class AccountController{ @Autowired AccountService accountService; @Autowired AccountRepository accountRepository; } 2) Setter Injection public class AccountConroller{ private AccountService accountService; private AccountRepository accountRepository; @Autowired pubic void setAccount.. LVM์ด๋ 1. LVM(Logical Volume Manager) - ๋ฆฌ๋ ์ค์ ์ ์ฅ ๊ณต๊ฐ์ ํจ์จ์ ์ด๊ณ ์ ์ฐํ๊ฒ ๊ด๋ฆฌํ๊ธฐ ์ํ ์ปค๋์ ํ ๋ถ๋ถ. - ๊ธฐ์กด ํ์ผ ์์คํ ์ ๋ฌผ๋ฆฌ์ ์คํ ๋ฆฌ์ง์ ์ง์ ์ ๊ทผํ์ฌ ์ฝ๊ณ ์ฐ๋ ์์ ์ ์งํํ๋ค. - LVM์ ์ถ์์ ๋ ์ด์ด๋ฅผ ๋์ด ๋ ผ๋ฆฌ์ ์คํ ๋ฆฌ์ง์์ ์ฝ๊ณ ์ฐ๊ธฐ ์์ ์ ํ๋ฏ๋ก์ ์คํ ๋ฆฌ์ง์ ํ์ฅ, ๋ณ๊ฒฝ์ ์ ์ฐํ๊ฒ ํ๋ค. - ํํฐ์ ๋์ ๋ณผ๋ฅจ์ด๋ผ๋ ๋จ์๋ก ์ ์ฅ ์ฅ์น๋ฅผ ๋ค๋ฃจ์ด, ๋ฌผ๋ฆฌ ๋์คํฌ๋ฅผ ๋ณผ๋ฅจ ๊ทธ๋ฃน์ผ๋ก ๋ฌถ๊ณ ์ด๊ฒ์ ๋ ผ๋ฆฌ ๋ณผ๋ฅจ์ผ๋ก ๋ถํ ํ์ฌ ๊ด๋ฆฌํ๋ค. - ์ฅ์น ์ด๋ฆ ์ง์ ๊ฐ๋ฅํ๋ฉฐ, disk striping, mirror volume ์ ๊ณต 2. ์ฉ์ด ์ ๋ฆฌ PV(Physical Volume) /dev/sda1, /dev/sda2 ๋ฑ์ ๋ธ๋ก ์คํ ๋ฆฌ์ง๋ฅผ PV๋ก ์ด๊ธฐํํ์ฌ, LVM์์ ์ฌ์ฉํ ์ ์๊ฒ.. JPA ๊ฐ์ฒด์ ์ํ / @Transactional 1. JPA ๊ฐ์ฒด์ ์ํ 1) Transient ๊ฐ์ฒด๋ฅผ ์์ฑํ๊ณ , ๊ฐ์ ์ฃผ์ด๋ JPA๋ hibernate๊ฐ ๊ทธ ๊ฐ์ฒด์ ๊ดํด ์๋ฌด๊ฒ๋ ๋ชจ๋ฅด๋ ์ํ. ์ฆ, ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋งคํ๋ ๊ฒ์ด ์๋ฌด๊ฒ๋ ์๋ค. 2) Persistent ์ ์ฅ์ ํ๊ณ ๋์, JPA๊ฐ ์๋ ์ํ(๊ด๋ฆฌํ๋ ์ํ)๊ฐ ๋๋ค. ๊ทธ๋ฌ๋ .save()๋ฅผ ํ๋ค๊ณ ํด์, ์ด ์๊ฐ ๋ฐ๋ก DB์ ์ด ๊ฐ์ฒด์ ๋ํ ๋ฐ์ดํฐ๊ฐ ๋ค์ด๊ฐ๋ ๊ฒ์ ์๋๋ค. JPA๊ฐ persistent ์ํ๋ก ๊ด๋ฆฌํ๊ณ ์๋ค๊ฐ, ํ์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ค.(1์ฐจ ์บ์, Dirty Checking(๋ณ๊ฒฝ์ฌํญ ๊ฐ์ง), Write Behind(์ต๋ํ ๋ฆ๊ฒ, ํ์ํ ์์ ์ DB์ ์ ์ฉ) ๋ฑ์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ค) 3) Detached JPA๊ฐ ๋์ด์ ๊ด๋ฆฌํ์ง ์๋ ์ํ. JPA๊ฐ ์ ๊ณตํด์ฃผ๋ ๊ธฐ๋ฅ๋ค์ ์ฌ์ฉํ๊ณ .. Model Binding : WebDataBinder, @InitBinder 1. Model Binding @ModelAttribute, @RequestParam, @PathVariable ๋ฑ์ ์ง์ ๋ ํ๋ผ๋ฆฌํฐ๋ฅผ @Controller ์ ์ถ๊ฐํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์์ ์ด ์๋์ผ๋ก ์งํ๋๋ค. 1) ํ๋ผ๋ฏธํฐ ํ์ ์ object๋ฅผ ๋ง๋ ๋ค. @ModelAttribute User user๋ผ๋ ํ๋ผ๋ฏธํฐ๋ฅผ ์ ์ธํ๋ค๋ฉด User ํ์ ์ Object๋ฅผ ์์ฑํ๋ค. @SessionAttributes์ ์ํด ์ธ์ ์ ์ ์ฅ๋ model object๊ฐ ์๋ค๋ฉด ๊ทธ๊ฑธ ๊ฐ์ ธ์จ๋ค. 2) model object์ property์ ์น ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐ์ธ๋ฉํด์ค๋ค. http๋ฅผ ํตํด ์ ๋ฌ๋๋ ํ๋ผ๋ฏธํฐ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฌธ์์ด๋ก ๋์ด ์๋ค. Spring์ ๊ธฐ๋ณธ PropertyEditor๋ฅผ ์ด์ฉํด์ http ํ๋ผ๋ฏธํฐ ๊ฐ์ model์ pr.. Thymeleaf 1. What is Thymeleaf Thymeleaf๋ server-side JAVA ๊ธฐ๋ฐ์ template engine ์ด๋ค. Spring boot ๊ฐ ๊ถ์ฅํ๋ ํ ํ๋ฆฟ ์์ง ์ค ํ๋์ด๋ค.(Groovy, Thymeleaf, FreeMarker..) ๊ทธ๋์ ์ฌ์ฉํด์๋ jsp๋ณด๋ค ๋ ๊ฐ๋จํ ์ค์ ๊ณผ ํ์ค ๋ฌธ๋ฒ์ผ๋ก HTML์ ์์ฑํ ์ ์๋ค. Thymeleaf๋ ์น ํ์ค, ํนํ HTML5 ์ ๋ง์ถฐ ์ค๊ณ๋์๊ธฐ์ ์์ ํ ๊ฒ์ฆ๋ ํ ํ๋ฆฟ์ ๋ง๋ค ์ ์๋ค. JSP์ ๊ฒฝ์ฐ, tag libraries๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, HTML ํ์ค ํ๊ทธ๊ฐ ์๋๊ธฐ์ ๋ธ๋ผ์ฐ์ ๊ฐ ํด์ํ ์ ์๋ ์ฝ๋๊ฐ ๋๋ค. Thymeleaf๋ฅผ ์ด์ฉํ์ฌ ์์ฑํ ๊ฒฝ์ฐ, ๋ธ๋ผ์ฐ์ ๊ฐ ํด์ํ ์ ์๋ ์ฝ๋๊ฐ ๋๋ค. ๋ฌธ๋ฒ ์ญ์ ๊น๋ํ๊ฒ ๋ณด์ธ๋ค. ์ด๋ก ์ธํด ํผ๋ธ๋ฆฌ์ , .. RAID์ด๋ 1. RAID(Redundant Array of Inexpensive Disks) - ์ฌ๋ฌ ๊ฐ์ ํ๋ ๋์คํฌ์ ์ผ๋ถ ์ค๋ณต๋ ๋ฐ์ดํฐ๋ฅผ ๋๋ ์ ์ ์ฅํ๋ ๊ธฐ์ . - ๋ฐ์ดํฐ๋ฅผ ๋๋๋ ๋ค์๋ฐฉ ๋ฐฉ๋ฒ์ด ๋ค์ํ๋ฉฐ ์ด ๋ฐฉ๋ฒ๋ค์ ๋ ๋ฒจ์ด๋ผ๊ณ ๊ตฌ๋ถํ๋ค. - striping, mirroring, parity ์ ๊ทผ์์ด ๋๋ ๊ธฐ์ ๋ก ์ด๋ฃจ์ด์ง๋ฉฐ ์ธ๊ฐ์ง ๊ธฐ์ ์ ์ ์ฉํ๋๋์ ๋ฐ๋ผ ๋ ๋ฒจ์ด ๋๋์ด์ง๋ค. - HW RAID, SW RAID ๋ก ๋๋๋ค. 2. STANDARD RAID LEVELS RAID 0 (striping) parity(์ค๋ฅ๊ฒ์ถ๊ธฐ๋ฅ) ์์ด striping๋ ํํ. ์์ ์ฑ ๋ณด๋ค๋ ๊ณ ์ฑ๋ฅ์ ์ํด ์ฌ์ฉ๋๋ค. ์ฅ์ : ๋น ๋ฅธ I/O ์ฑ๋ฅ, ๊ตฌ์ฑ๋ ๋์คํฌ N๊ฐ ์ฉ๋ ๋ชจ๋ ํ์ฉ ๊ฐ๋ฅ ๋จ์ : ๋ฎ์ ์์ ์ฑ RAID 1(Mirroring) ์.. ์ด์ 1 ๋ค์