Loading...
2023. 12. 25. 12:19

[Java] ๊ฐ€์ƒ ์Šค๋ ˆ๋“œ (Virtual Thread) ํ›‘์–ด๋ณด๊ธฐ

Java์˜ Thread๋ฅผ ๋ณด๋ฉด ๋Š˜์ƒ ๊ณ ๋ฏผ์ด์—ˆ๋˜ ๋ถ€๋ถ„์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. Java์˜ Thread API๋Š” ์šด์˜์ฒด์ œ์˜ ์Šค๋ ˆ๋“œ์™€ 1:1๋กœ ๋งคํ•‘๋˜์–ด ์žˆ์–ด ์“ธ ๋•Œ๋งˆ๋‹ค ์ปจํ…์ŠคํŠธ ์Šค์œ„์นญ์œผ๋กœ ์ธํ•œ ๋น„์šฉ ๋ฌธ์ œ๊ฐ€ ๊ฑธ๋ฆผ๋Œ์ด๊ณ , ์„œ๋ฒ„๋ฅผ ๊ฐœ๋ฐœํ•˜๋Š” ์ž…์žฅ์—์„œ ๋Œ€์šฉ๋Ÿ‰ ํŠธ๋ž˜ํ”ฝ์˜ ๋ฐœ์ƒ์„ ๊ณ ๋ คํ•ด์•ผ ํ•œ๋‹ค๋ฉด ์Šค์ผ€์ผ ์•„์›ƒ์„ ํ•ด์•ผํ• ์ง€ ๋ฆฌ์•กํ‹ฐ๋ธŒ ํ”„๋กœ๊ทธ๋ž˜๋ฐ(Reactive Programming)์„ ํ•ด์•ผํ• ์ง€ ์„ ํƒ์˜ ๊ณ ๋ฏผ์— ํœฉ์‹ธ์ด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๊ฐœ๋ฐœ์ž ์ž…์žฅ์—์„œ ๊ฐ€์žฅ ์‰ฝ๊ฒŒ ์ƒ๊ฐํ•œ๋‹ค๋ฉด ์Šค์ผ€์ผ ์•„์›ƒ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์š”์ƒˆ๋Š” ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค(k8s)์™€ ๊ฐ™์€ ์ปจํ…Œ์ด๋„ˆ ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜ ์‹œ์Šคํ…œ ๋‚ด์ง€ ํด๋ผ์šฐ๋“œ์—์„œ ์˜คํ†  ์Šค์ผ€์ผ๋ง ๊ธฐ๋Šฅ์„ ์ž˜ ์ง€์›ํ•˜๊ณ  ์žˆ์–ด ํŠธ๋ž˜ํ”ฝ์ด ๋Œ€๋Ÿ‰์œผ๋กœ ๋ฐœ์ƒํ•ด๋„ ์ž๋™์œผ๋กœ ์Šค์ผ€์ผ ์•„์›ƒํ•˜์—ฌ ํŠธ๋ž˜ํ”ฝ ๋ฐœ์ƒ์„ ์กฐ์ ˆํ•ด์ฃผ๋‹ˆ ๊ฐ€์žฅ ํŽธํ•œ ๋ฐฉ๋ฒ•์ด์ง€์š”. ํ•˜์ง€๋งŒ ์ด๋Š” ์—ฌ์ „ํžˆ ๋‚ด๊ฐ€ ์šด์˜ํ•˜๋Š” ์„œ..

2023. 12. 4. 15:46

[Spring boot] HTMX + Thymeleaf ์กฐํ•ฉ์œผ๋กœ ์›น ํŽ˜์ด์ง€ ๊ฐœ๋ฐœ ์‹œ์ž‘ํ•˜๊ธฐ

[Web] HTML ๋ง๊ณ  HTMX(HyperText Markup eXtension) ์›นํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“œ๋ ค๋ฉด ๋ฐ˜๋“œ์‹œ ๋ฐฐ์›Œ์•ผ ํ•˜๋Š” ์–ธ์–ด ์ค‘ ํ•˜๋‚˜๊ฐ€ ๋ฐ”๋กœ HTML(HyperText Markup Language)์ž…๋‹ˆ๋‹ค. HTML์€ ํฐ ํ™”๋ฉด์— ํ…์ŠคํŠธ(๊ธ€์ž)๋ฅผ ํ‘œ๊ธฐํ•˜๋Š” ๋งˆํฌ์—… ์–ธ์–ด ์ค‘ ํ•˜๋‚˜๋กœ ๊ณผ๊ฑฐ HTTP ํ†ต์‹ ์„ ์ด์šฉํ•˜์—ฌ ํฐ ํ… blog.neonkid.xyz ์ง€๋‚œ ํฌ์ŠคํŠธ์—์„œ ์šฐ๋ฆฌ๋Š” HTMX๋ผ๋Š” HTML ํ™•์žฅ ๊ฐœ๋…์— ๋Œ€ํ•ด ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์ด๋ฒˆ ํฌ์ŠคํŠธ์—์„œ๋Š” Spring๊ณผ Spring์—์„œ ์ง€์›ํ•˜๋Š” ํ…œํ”Œ๋ฆฟ ์—”์ง„์ธ ํƒ€์ž„๋ฆฌํ”„(Thymeleaf) ์กฐํ•ฉ์œผ๋กœ ๊ฐ„๋‹จํ•œ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ดˆ๊ธฐ ๊ตฌ์„ฑ Spring Initializer๋ฅผ ์ด์šฉํ•˜์—ฌ ๋จผ์ € ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋กœ์ ํŠธ ๊ตฌ์„ฑ์„ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉํ•  ํŒจํ‚ค์ง€๋Š” ์•„๋ž˜..

2023. 12. 3. 17:26

[Web] HTML ๋ง๊ณ  HTMX(HyperText Markup eXtension)

์›นํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“œ๋ ค๋ฉด ๋ฐ˜๋“œ์‹œ ๋ฐฐ์›Œ์•ผ ํ•˜๋Š” ์–ธ์–ด ์ค‘ ํ•˜๋‚˜๊ฐ€ ๋ฐ”๋กœ HTML(HyperText Markup Language)์ž…๋‹ˆ๋‹ค. HTML์€ ํฐ ํ™”๋ฉด์— ํ…์ŠคํŠธ(๊ธ€์ž)๋ฅผ ํ‘œ๊ธฐํ•˜๋Š” ๋งˆํฌ์—… ์–ธ์–ด ์ค‘ ํ•˜๋‚˜๋กœ ๊ณผ๊ฑฐ HTTP ํ†ต์‹ ์„ ์ด์šฉํ•˜์—ฌ ํฐ ํ…์ŠคํŠธ ํŒŒ์ผ์„ ์ฃผ๊ณ  ๋ฐ›๋Š”๋ฐ ์‚ฌ์šฉ๋˜์—ˆ๋˜ ํ‘œ์ค€ ์–ธ์–ด์˜€์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํ˜„๋Œ€์—๋Š” ํ…์ŠคํŠธ๋ณด๋‹ค ๋” ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๊ธฐ๋ฅผ ์›ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผํ…Œ๋ฉด ํ…์ŠคํŠธ ๋ณด๋‹ค๋Š” ์ด๋ฏธ์ง€, ๋น„๋””์˜ค, ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋“ฑ ๋™์ ์ธ ์ปจํ…์ธ ๋ฅผ ์ฃผ๊ณ  ๋ฐ›๊ธฐ๋ฅผ ์›ํ•˜์—ฌ ์ดํ›„ HTML 5 ๋ฒ„์ „์—์„œ๋Š” ์ด๋ฏธ์ง€, ๋น„๋””์˜ค ์ „์†ก์„ ์œ„ํ•œ ํ‘œ์ค€ ํƒœ๊ทธ๊ฐ€ ์ •์˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , ํŽ˜์ด์ง€์— ๋” ๋งŽ์€ ํšจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์œ„ํ•ด Javascript, jQuery ๋“ฑ์„ ์‚ฌ์šฉํ•˜๊ธฐ๋„ ํ–ˆ์ฃ . ํ•˜์ง€๋งŒ ์ด๋“ค์€ ๋„ˆ๋ฌด ๋ฐฐ์šฐ๊ธฐ ์–ด๋ ต๊ณ  ๋ฌด๊ฑฐ์›Œ์„œ ์ „๋ฌธ์ ์œผ๋กœ ๋ฐฐ์šฐ์ง€ ์•Š์œผ๋ฉด ..

2023. 10. 9. 20:52

[Spring boot] Node Gradle์„ ์ด์šฉํ•˜์—ฌ Spring ํ”„๋กœ์ ํŠธ์™€ Node ํ”„๋กœ์ ํŠธ ๋ถ™์ด๊ธฐ

Spring boot๋ฅผ ์ด์šฉํ•˜์—ฌ ์›น ํŽ˜์ด์ง€๋ฅผ ๊ฐœ๋ฐœํ•  ๋•Œ๋Š” REST API ์„œ๋ฒ„๋กœ ๋ฐฑ์—”๋“œ๋ฅผ ๊ตฌํ˜„ํ•˜๊ณ , ํŽ˜์ด์ง€๋Š” ์„œ๋ฒ„ ์‚ฌ์ด๋“œ ๋ Œ๋”๋ง(SSR)์„ ์ด์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ์ˆ ์€ ์•„๋ž˜์˜ 2๊ฐ€์ง€ ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. JSP (Java Server Page) Thymeleaf JSP์™€ Thymeleaf๋Š” Spring์„ ์ด์šฉํ•˜์—ฌ ํ™”๋ฉด์„ ๊ตฌํ˜„ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ทฐ ํ…œํ”Œ๋ฆฟ ์—”์ง„์œผ๋กœ ๊ณผ๊ฑฐ์—๋Š” JSP๋ฅผ ์ด์šฉํ•˜์—ฌ ํ™”๋ฉด์„ ๊ตฌํ˜„ํ–ˆ์ง€๋งŒ ์ตœ๊ทผ์—๋Š” Thymeleaf๋ฅผ ๋งŽ์ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ HTML ์ฝ”๋“œ๋ฅผ ์ง์ ‘ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋‹ค๋ค„ Controller์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ด์šฉํ•ด ๋™์ ์œผ๋กœ ํ™”๋ฉด์„ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ฒƒ์„ ์„œ๋ฒ„ ์‚ฌ์ด๋“ค ๋ Œ๋”๋ง์ด๋ผ ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ตœ๊ทผ์—๋Š” ํด๋ผ์ด์–ธํŠธ ์‚ฌ์ด๋“œ ๋ Œ๋”๋ง(CSR) ๊ธฐ๋ฒ•์„ ์ด์šฉํ•œ React.js, Vue.js๋ฅผ ์ด..

2023. 1. 15. 16:27

[Netty] Netty๋กœ ๋ฐฐ์›Œ๋ณด๋Š” Non-blocking I/O ๊ธฐ์ดˆ

์˜ค๋Š˜์€ Java ๋„คํŠธ์›Œํฌ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์˜ ๊ฝƒ์ธ Netty์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. What is Netty ? Netty๋ฅผ ๋“ค์–ด๋ณด์‹  ๋ถ„๋“ค์ด๋ผ๋ฉด ์•„๋งˆ ํ•œ ๋ฒˆ ์ฏค c10k ๋ฌธ์ œ๋ผ๋Š” ๊ฒƒ์„ ๊ฒฝํ—˜ํ•ด๋ณด์…จ๊ฑฐ๋‚˜ ๊ด€์‹ฌ์„ ๊ฐ€์กŒ์„๋งŒํ•œ ๋ถ„์ด์‹ค ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. Netty๋Š” JVM์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Java NIO ๊ธฐ๋ฐ˜์˜ Non-blocking ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค. ์–ด๋Š ํŠน์ • ํ”„๋กœํ† ์ฝœ(HTTP ๋“ฑ)์˜ ์„œ๋ฒ„๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ TCP, UDP์˜ ๋„คํŠธ์›Œํฌ ํ†ต์‹ ์„ Non-blocking I/O๋กœ ์ฒ˜๋ฆฌํ•˜์—ฌ ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ๋ฅผ ๊ฐœ๋ฐœํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค. Non-blocking์ด ๋ฌด์—‡์ธ๊ฐ€์š”? ๊ฐ„๋‹จํ•˜๊ฒŒ ์„ค๋ช…ํ•˜์ž๋ฉด, ์–ด๋– ํ•œ ์ž‘์—…์„ ๋ง‰ํž˜์—†์ด ์ด์–ด๋‚˜๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ์˜ˆ์‹œ๋ฅผ ๋“ค์–ด๋ณด์ž๋ฉด ์šฐ๋ฆฌ๊ฐ€ ๋ง›์žˆ๋Š” ๋ง›์ง‘์—๊ฐ€์„œ ์Œ์‹์„ ๋จน์œผ๋Ÿฌ ๊ฐ”์Šต๋‹ˆ๋‹ค. ..

2022. 11. 6. 21:49

[Spring] ๋น„๋™๊ธฐ ์ž‘์—…๊ณผ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ์œ„ํ•œ TaskExecutor, TaskScheduler ๊ธฐ๋ณธ

Spring Framework๋Š” TaskExecutor ์ธํ„ฐํŽ˜์ด์Šค์™€ TaskScheduler ์ธํ„ฐํŽ˜์ด์Šค๋กœ Task(์ž‘์—…)์˜ ๋น„๋™๊ธฐ ์‹คํ–‰๊ณผ ์Šค์ผ€์ค„๋ง์— ๋Œ€ํ•œ ์ถ”์ƒํ™” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฐ ๊ฒƒ์ด ํ•„์š”ํ•œ ์ด์œ ๋Š” ๋ฌด์—‡์ผ๊นŒ์š”? ๊ธฐ๋ณธ์ ์œผ๋กœ Spring์€ Multi-Thread ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๋ฉฐ Singleton Pattern์„ ์ด์šฉํ•ด ๋ชจ๋“  Bean๋“ค์„ ๊ณต์œ ํ•˜์—ฌ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ API๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ณผ์ •์„ Blockingํ•˜์ง€ ์•Š๊ณ  ๋‹ค์ค‘ ์‚ฌ์šฉ์ž๊ฐ€ ์š”์ฒญ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ์ฒ˜๋ฆฌํ•œ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์šฐ๋ฆฌ๊ฐ€ API ํ˜ธ์ถœ ์ดํ›„ Bean ๋‚ด ์–ด๋–ค ํŠน์ • ์ž‘์—…์— ๋Œ€ํ•œ ๋น„๋™๊ธฐ ์‹คํ–‰์€ ๋ณด์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. TaskExecutor TaskExecutor๋Š” Spring 2.0์—์„œ ๋“ฑ์žฅํ•œ ๋น„๋™๊ธฐ ์‹คํ–‰ ์ถ”์ƒํ™” ์ธํ„ฐํŽ˜์ด์Šค๋กœ..

2022. 10. 30. 16:57

[Rust] ๊ฐœ๋…๋ถ€ํ„ฐ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•๊นŒ์ง€ ์ฐจ๊ทผ์ฐจ๊ทผ ์‹œ์ž‘ํ•ด๋ณด๊ธฐ

์š”์ฆ˜ ๋ชจ๋˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๊ฐ€ ๋งŽ์ด ๋‚˜์˜ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ตฌ๊ธ€์˜ Golang, ๋ชจ์งˆ๋ผ์˜ Rust ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ํ•จ์ˆ˜ํ˜• ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์ธ Clojure, Rescript ๋“ฑ ๋‹ค์–‘ํ•œ ์–ธ์–ด๊ฐ€ ๋งŽ์ด ๋‚˜์˜ค๊ณ  ์žˆ๋Š”๋ฐ์š”. ํŠนํžˆ ์ตœ๊ทผ์—๋Š” ๊ตฌ๊ธ€์—์„œ C++ ๋Œ€ํ•ญ ์–ธ์–ด๋กœ Carbon์ด๋ผ๋Š” ์–ธ์–ด๊นŒ์ง€๋„ ๋‚˜์™”์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ์— ๋‹ค๋ฃฐ ์ฃผ์ œ๋Š” ๋ฐ”๋กœ ๋ชจ์งˆ๋ผ์˜ Rust์ธ๋ฐ์š”. ์ตœ๊ทผ ๋ฆฌ๋ˆ…์Šค ์ปค๋„ ๊ฐœ๋ฐœ์—๋„ Rust ์–ธ์–ด๊ฐ€ ๊ณต์‹ ์ฑ„ํƒ๋˜์–ด ํ™”๋‘๊ฐ€ ๋˜๊ณ  ์žˆ๋Š” Rust์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. What is Rust? ์ œ๊ฐ€ ์ฒ˜์Œ Rust ์–ธ์–ด๋ฅผ ๋“ค์—ˆ์„ ๋•Œ๋Š” 3๋…„ ์ „, YouTube์˜ ์ผ€๋นˆ๋‹˜ ๋ฐฉ์†ก์—์„œ์˜€์Šต๋‹ˆ๋‹ค. ๊ทธ ๋•Œ๋ถ€ํ„ฐ ์ญˆ์šฑ ์•„๋ฌด๊ฒƒ๋„ ํ•ด์˜ค์ง€ ์•Š์•˜์—ˆ์Šต๋‹ˆ๋‹ค๋งŒ Golang๊ณผ Rust ๋‘˜ ์ค‘ ์—„์ฒญ ์ €์šธ์งˆ์„ ํ–ˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์ด์—ˆ์ฃ . ํ•˜์ง€๋งŒ ์ด์ œ๋Š” ์ž์‹ ์žˆ๊ฒŒ Rust ์–ธ..

2022. 10. 29. 22:07

[Spring] Spring Advisor์™€ Pointcut - ์‹ค์ „ํŽธ

์ด์ „ ๊ธ€์—์„œ DefaultPointcutAdvisor์™€ ๋‹ค์–‘ํ•œ Pointcut๋“ค์— ๋Œ€ํ•œ ๊ฐœ๋…์„ ๋‹ค๋ค„๋ดค์Šต๋‹ˆ๋‹ค. 2022.10.10 - [Programming/Spring] - [Spring] Spring Advisor์™€ Pointcut - ๊ฐœ๋…ํŽธ [Spring] Spring Advisor์™€ Pointcut - ๊ฐœ๋…ํŽธ Spring AOP ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ด์šฉํ•ด Advice๋ฅผ ๋งŒ๋“ค์–ด ๋ฉ”์„œ๋“œ์˜ ์ „ํ›„์ฒ˜๋ฆฌ๋ฅผ ํ”„๋ก์‹œ ๊ฐ์ฒด๋ฅผ ํ†ตํ•ด ๊ตฌํ˜„ํ•ด๋ดค์Šต๋‹ˆ๋‹ค. 2022.05.16 - [Programming/Spring] - [Spring] Spring Advice๋กœ ์ปค์Šคํ…€ ์–ด๋“œ๋ฐ”์ด์Šค ๋งŒ๋“ค๊ธฐ [Spring] Spr.. blog.neonkid.xyz Pointcut์€ ์ธํ„ฐํŽ˜์ด์Šค ํ˜•ํƒœ๋กœ ๋˜์–ด ์žˆ์ง€๋งŒ Spring AOP์—์„œ ์ด๋ฏธ ๋งŽ์€ ๊ตฌํ˜„์ฒด๋“ค์ด..

2022. 10. 10. 19:11

[Spring] Spring Advisor์™€ Pointcut - ๊ฐœ๋…ํŽธ

Spring AOP ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ด์šฉํ•ด Advice๋ฅผ ๋งŒ๋“ค์–ด ๋ฉ”์„œ๋“œ์˜ ์ „ํ›„์ฒ˜๋ฆฌ๋ฅผ ํ”„๋ก์‹œ ๊ฐ์ฒด๋ฅผ ํ†ตํ•ด ๊ตฌํ˜„ํ•ด๋ดค์Šต๋‹ˆ๋‹ค. 2022.05.16 - [Programming/Spring] - [Spring] Spring Advice๋กœ ์ปค์Šคํ…€ ์–ด๋“œ๋ฐ”์ด์Šค ๋งŒ๋“ค๊ธฐ [Spring] Spring Advice๋กœ ์ปค์Šคํ…€ ์–ด๋“œ๋ฐ”์ด์Šค ๋งŒ๋“ค๊ธฐ ์ด๋ฒˆ ํฌ์ŠคํŠธ๋ถ€ํ„ฐ๋Š” Spring AOP ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ด์šฉํ•˜์—ฌ ์‹ค์ œ Advice๋ฅผ ๋งŒ๋“ค์–ด๋ณด๊ณ , ์œ„๋น™ํ•˜๋Š” ์‹œ๊ฐ„์„ ๊ฐ€์ ธ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Advice Interface Advice์— ๋Œ€ํ•ด ๋‹ค์‹œ ๋ณต์Šตํ•ด๋ณด์ž๋ฉด Advice๋Š” ํŠน์ • ์กฐ์ธํฌ์ธํŠธ ์ฆ‰, ๋ฉ”์„œ๋“œ๊ฐ€ blog.neonkid.xyz Spring AOP์˜ ProxyFactory ํด๋ž˜์Šค๋Š” ์šฐ๋ฆฌ๊ฐ€ ์ž‘์„ฑํ•œ ๋ฉ”์„œ๋“œ์—์„œ AOP ํ”„๋ก์‹œ ์ธ์Šคํ„ด์Šค๋ฅผ ์–ป๊ณ  ๊ตฌ์„ฑํ•˜๋Š” ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์„ ..

2022. 7. 2. 15:21

[OpenCV] ์›ํ•˜๋Š” ์ด๋ฏธ์ง€ ์˜์—ญ(๊ด€์‹ฌ์˜์—ญ, ROI) ์ž๋ฅด๊ธฐ(Crop)

๋ธ”๋กœ๊ทธ ๊ธ€์„ ์“ฐ๋‹ค๋ณด๋ฉด ํŠน์ • ์˜์—ญ๋งŒ์„ ์ž˜๋ผ์„œ ์ €์žฅํ•˜๊ณ  ์‹ถ์„ ๋•Œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์œˆ๋„๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋ฉด ์œˆ๋„์—์„œ ์ œ๊ณตํ•˜๋Š” Windows ์‚ฌ์ง„ ๋ทฐ์–ด ๋“ฑ์˜ ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•ด ์›ํ•˜๋Š” ์ด๋ฏธ์ง€์˜ ์˜์—ญ์„ ์ž๋ฅผ ์ˆ˜ ์žˆ๋Š”๋ฐ, Mac OS X๋‚˜ Ubuntu์— ์žˆ๋‹ค๋ณด๋ฉด ๊ธฐ๋ณธ ํ”„๋กœ๊ทธ๋žจ์œผ๋กœ ์ด๋Ÿฐ ๊ฒƒ๋“ค์„ ์ œ๊ณตํ•˜์ง€ ์•Š๋‹ค๋ณด๋‹ˆ ์“ธ ํ”„๋กœ๊ทธ๋žจ์„ ์ฐพ๊ฒŒ ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žฆ์•˜๋Š”๋ฐ์š”. ์ด๋ ‡๊ฒŒ ์›ํ•˜๋Š” ์ด๋ฏธ์ง€๋ฅผ ๋ถˆ๋Ÿฌ์™€์„œ ๊ฐ„๋‹จํ•˜๊ฒŒ ์›ํ•˜๋Š” ์˜์—ญ์„ ์ž๋ฅผ ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ํ•œ ๋ฒˆ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. MouseEvent OpenCV์—์„œ MouseEvent๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ฝœ๋ฐฑ ํ•จ์ˆ˜๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ฝœ๋ฐฑ ํ•จ์ˆ˜์— ๋Œ€ํ•ด ์ž˜ ๋ชจ๋ฅด์‹œ๊ฒ ๋‹ค๋ฉด ์•„๋ž˜์˜ ๊ธ€์„ ์ฐธ๊ณ ํ•ด๋ณด์„ธ์š”. 2016.12.18 - [Programming/OpenCV] - OpenCV์—์„œ Mouse Even..

2022. 7. 2. 14:02

[OpenCV] C++์™€ OpenCV 4.x๋กœ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ

๊ฐ„๋งŒ์— OpenCV ๊ธ€์„ ์ž‘์„ฑํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์š” ๋ช‡๋…„ ๋ฐฑ์—”๋“œ ์—”์ง€๋‹ˆ์–ด๋ง ๊ณต๋ถ€๋ฅผ ํ•˜๊ฒŒ ๋˜๋ฉด์„œ ์žฅ๋‚œ๊ฐ์ฒ˜๋Ÿผ ์—ฌ๊ฒจ์˜ค๋˜ OpenCV ๊ธ€์„ ๋‹ค์‹œ ์“ฐ๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ์š”. ์•ˆ ๋ณธ ์‚ฌ์ด์— ๋ฒŒ์จ OpenCV 4.6 Pre-release๋กœ OpenCV 5.x ๋ฒ„์ „๊นŒ์ง€ ์˜ฌ๋ผ์˜จ ๊ฒƒ์„ ๋ณด๊ณ  ์ •๋ง ์‹œ๊ฐ„์ด ๋นจ๋ฆฌ ํ˜๋Ÿฌ๊ฐ€๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์ƒˆ์‚ผ ๋Š๊ผˆ์Šต๋‹ˆ๋‹ค. ๋งŒ๋“ค ํ™˜๊ฒฝ ์˜ค๋Š˜์€ ์•„๋ž˜์˜ 3๊ฐ€์ง€ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•ด์„œ OpenCV ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. JetBrains CLion / CMake OpenCV 4.6 Ubuntu Linux 20.04 ์‚ฌ์‹ค OpenCV๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์€ C++ ์™ธ์—๋„ Python์ด ์žˆ๋Š”๋ฐ์š”. ๋”ฅ๋Ÿฌ๋‹์ด๋‚˜ ๋จธ์‹ ๋Ÿฌ๋‹์„ ์ฃผ๋กœ ํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ Python์„ ์ด์šฉํ•  ๊ฒƒ์ด๊ณ , ๊ทธ ์™ธ IoT๋‚˜ ์นด๋ฉ”๋ผ ๋“ฑ ํ•˜๋“œ์›จ์–ด๋ฅผ ์ฃผ๋กœ ..

2022. 6. 26. 15:50

[Spring] OSIV๋กœ ์•Œ์•„๋ณด๋Š” Spring Transaction ํ—ค์งš๊ธฐ

Spring boot์—๋Š” spring.jpa.open-in-view๋ผ๊ณ  ํ•˜๋Š” ์˜ต์…˜์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์˜ต์…˜์€ JPA์˜ OSIV ๊ธฐ๋Šฅ์„ ON/OFF ํ•  ์ˆ˜ ์žˆ๋Š” ์˜ต์…˜์ธ๋ฐ์š”. ์ด ์˜ต์…˜์ด ๋ฌด์—‡์ธ์ง€ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. OSIV ๋จผ์ € ์ด ์˜ต์…˜์€ JPA์˜ OSIV ๊ธฐ๋Šฅ์˜ ์‚ฌ์šฉ ์œ ๋ฌด๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š”๋ฐ, OSIV๋ž€, ์˜์†์„ฑ ์ปจํ…์ŠคํŠธ๋ฅผ View๊นŒ์ง€ ์—ด์–ด๋‘๋Š” ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค. ์˜์†์„ฑ ์ปจํ…์ŠคํŠธ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ์ž˜ ๋ชจ๋ฅด์‹œ๊ฒ ๋‹ค๋ฉด ์•„๋ž˜ ๊ธ€์„ ์ฐธ๊ณ ํ•ด๋ณด์„ธ์š”. 2020.06.23 - [Programming/Spring] - [Spring] JPA์˜ ์˜์†์„ฑ ์ปจํ…์ŠคํŠธ์™€ ์ƒ๋ช…์ฃผ๊ธฐ [Spring] JPA์˜ ์˜์†์„ฑ ์ปจํ…์ŠคํŠธ์™€ ์ƒ๋ช…์ฃผ๊ธฐ Spring Framework๋ฅผ ์ด์šฉํ•˜์—ฌ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด๋‚˜ ์„œ๋ฒ„ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ฐœ๋ฐœํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” DB ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค..

2022. 6. 22. 21:33

[Programming] SOLID - ๊ฐ์ฒด ์ง€ํ–ฅ 5๋Œ€ ์„ค๊ณ„ ์›์น™

์ด๋ฒˆ ํฌ์ŠคํŠธ์—์„œ๋Š” ํŠน์ • ์–ธ์–ด์— ๋Œ€ํ•œ ํ•™์Šต์ด ์•„๋‹Œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์Šคํ‚ฌ์— ๋Œ€ํ•ด ์ ์–ด๋ณด๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค. ๋…์ž ์—ฌ๋Ÿฌ๋ถ„๋“ค ์ค‘ Java, C#, Python๊ณผ ๊ฐ™์€ ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๊ณ  ๊ณ„์‹ ๋‹ค๋ฉด OOP(๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)์ด๋ผ๋Š” ๋‹จ์–ด๋ฅผ ์‰ฝ๊ฒŒ ์ ‘ํ•ด๋ณด์…จ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค. OOP (Object Oriented Programming) OOP๋Š” ์šฐ๋ฆฌ ๋ง๋กœ ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์ด๋ผ๋Š” ๋œป์ž…๋‹ˆ๋‹ค. ์ด ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์œ„ํ‚ค์—์„œ ๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ - ์œ„ํ‚ค๋ฐฑ๊ณผ, ์šฐ๋ฆฌ ๋ชจ๋‘์˜ ๋ฐฑ๊ณผ์‚ฌ์ „ ko.wikipedia.org ์‰ฝ๊ฒŒ ์–˜๊ธฐํ•˜์ž๋ฉด ์šฐ๋ฆฌ๊ฐ€ C ์–ธ์–ด๋กœ ์ž‘์„ฑ๋˜์—ˆ๋˜ ๋ช…๋ น ํ˜•์‹์˜ ์ ˆ์ฐจ ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ๊ณผ๋Š” ๋‹ฌ๋ฆฌ OOP๋Š” ๊ฐ์ฒด๋ผ๋Š” ๋…๋ฆฝ๋œ ๋‹จ์œ„๋กœ ํ”„๋กœ๊ทธ๋žจ์„ ํ˜•์„ฑ์‹œํ‚ค๋Š” ์Šคํ‚ฌ์ž…๋‹ˆ๋‹ค. ์ ˆ์ฐจ ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์—์„œ '์ ˆ..

2022. 5. 29. 18:18

[Algorithm] - 2022 ์นด์นด์˜ค ์‹ ์ž… 1์ฐจ ์˜จ๋ผ์ธ ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ (Kakao Newbie Primary Online Coding Test) for Tech developers ๋ฌธ์ œ ํ’€์ด

๋งค๋…„ ์ด๋ค„์ง€๋Š” ์นด์นด์˜ค ์‹ ์ž… ์˜จ๋ผ์ธ ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ ๋ฌธ์ œ ํ’€์ด๋ฅผ ๋˜ ์ ๊ฒŒ ๋˜์—ˆ๋„ค์š”. ํšŒ์‚ฌ ์—…๋ฌด๋ฅผ ์ข€ ๋” ์‹ ๊ฒฝ์จ์•ผ ํ•˜๋‹ค๋ณด๋‹ˆ ๋งˆ๋ƒฅ ํ‘ธ๋Š” ๊ฒƒ์„ ๋ฏธ๋ค„๋†“๊ณ ๋งŒ ์žˆ๋‹ค ์ด์ œ์„œ์•ผ ๋ฌธ์ œ ํ’€์ด๋ฅผ ์ง„ํ–‰ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ์—๋„ ๋จผ์ € ๋ฌธ์ œ ํ’€์ด ์ „ ํ›„๊ธฐ๋ฅผ ์ž ๊น ๋ง์”€๋“œ๋ฆฌ์ž๋ฉด ์ž‘๋…„ ๋ฌธ์ œ์— ๋น„ํ•˜์—ฌ ๋‚œ์ด๋„๊ฐ€ ๋งŽ์ด ๊ฐœ์„ ๋œ ๋ชจ์Šต์ด์—ˆ์Šต๋‹ˆ๋‹ค. ์ž‘๋…„๊ณผ ๋‹ฌ๋ฆฌ Lv 4 ๋ฌธ์ œ๋Š” ์ถœ์ œ ๋˜์ง€ ์•Š์•˜๊ณ , ๊ตฌํ˜„ ์ค‘์‹ฌ์˜ ์•ž ๋ฌธ์ œ์™€ ์ข€ ๋” ์‹ค๋ ฅ์„ ๋ณด๊ธฐ ์œ„ํ•œ Lv 3 ๋‚œ์ด๋„ ๋ฌธ์ œ 1~2๋ฌธ์ œ๋กœ ์ถ”๋ ค์ง„ ๋ชจ์Šต์ด์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ ๋ฌธ์ œ ํ’€์ด๋ฅผ ์ง„ํ–‰ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Question 01. ์‹ ๊ณ  ๊ฒฐ๊ณผ ๋ฐ›๊ธฐ ๋ฌธ์ œ ์›๋ฌธ: (https://programmers.co.kr/learn/courses/30/lessons/92334) ์‹ ์ž…์‚ฌ์› ๋ฌด์ง€๋Š” ๊ฒŒ์‹œํŒ์˜ ๋ถˆ๋Ÿ‰ ์ด์šฉ์ž๋ฅผ ์‹ ๊ณ ํ•˜๊ณ  ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ๋ฉ”..

2022. 5. 22. 21:13

[FastAPI] 16. Pulumi๋ฅผ ์ด์šฉํ•ด FastAPI Serverless ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•ด๋ณด๊ธฐ

์šฐ๋ฆฌ๋Š” ์ง€๋‚œ ๊ธ€์—์„œ FastAPI, Magnum, AWS Serverless Stack(Lambda, API Gateway)์„ ์ด์šฉํ•˜์—ฌ FastAPI ์„œ๋ฒ„๋ฆฌ์Šค ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ–ˆ์Šต๋‹ˆ๋‹ค. 2022.05.22 - [Programming/Python] - [FastAPI] 15. FastAPI๋ฅผ Serverless๋กœ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ• - Mangum [FastAPI] 15. FastAPI๋ฅผ Serverless๋กœ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ• - Mangum ์ด๋ฒˆ ํฌ์ŠคํŠธ์—์„œ๋Š” FastAPI์™€ Serverless(์„œ๋ฒ„๋ฆฌ์Šค) ์กฐํ•ฉ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ œ๊ฐ€ ์ดˆ๊ธฐ ์„œ๋ฒ„๋ฆฌ์Šค๋ฅผ ๋ฐฐ์› ์„ ๋•Œ๋Š” AWS์˜ Lambda๋ผ๋Š” ์„œ๋น„์Šค๊ฐ€ ๋‚˜์™”์„ ๋•Œ์˜€๋Š”๋ฐ์š”. ๋‹น์‹œ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๋ณ„๋„์˜ ํ”„ blog.neonkid.xyz ํ•˜์ง€๋งŒ AWS Lambda์™€ API..

2022. 5. 22. 00:03

[FastAPI] 15. FastAPI๋ฅผ Serverless๋กœ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ• - Mangum

์ด๋ฒˆ ํฌ์ŠคํŠธ์—์„œ๋Š” FastAPI์™€ Serverless(์„œ๋ฒ„๋ฆฌ์Šค) ์กฐํ•ฉ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ œ๊ฐ€ ์ดˆ๊ธฐ ์„œ๋ฒ„๋ฆฌ์Šค๋ฅผ ๋ฐฐ์› ์„ ๋•Œ๋Š” AWS์˜ Lambda๋ผ๋Š” ์„œ๋น„์Šค๊ฐ€ ๋‚˜์™”์„ ๋•Œ์˜€๋Š”๋ฐ์š”. ๋‹น์‹œ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๋ณ„๋„์˜ ํ”„๋ ˆ์ž„์›Œํฌ ํ•„์š”์—†์ด ํ•จ์ˆ˜์˜ ๊ตฌํ˜„๋งŒ์œผ๋กœ API ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” Cloud Native(ํด๋ผ์šฐ๋“œ ๋„ค์ดํ‹ฐ๋ธŒ) ๊ฐœ๋ฐœ ๋ชจ๋ธ์ด์—ˆ์Šต๋‹ˆ๋‹ค. Serverless Serverless(์„œ๋ฒ„๋ฆฌ์Šค)๋ผ๋Š” ๋‹จ์–ด๋ฅผ ์ผ๋ฐ˜์ ์œผ๋กœ ํ•ด์„ํ•˜๋ฉด '์„œ๋ฒ„ ์—†๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜', '์„œ๋ฒ„ ์—†๋Š” ์„œ๋น„์Šค'๋ผ๋Š” ๋œป์ด ๋ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์‹ค์ œ๋กœ ์„œ๋ฒ„๋ฆฌ์Šค๋Š” ์„œ๋ฒ„ ์—†์ด ์„œ๋น„์Šค๋ฅผ ์šด์˜ํ•˜๊ฑฐ๋‚˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค. ์‹ค์ œ ์„œ๋ฒ„๋ฆฌ์Šค๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ๋ณ„๋„๋กœ ์„œ๋ฒ„ ๊ด€๋ฆฌ๋ผ๋Š” ๋น„์šฉ์—†์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋นŒ๋“œํ•˜๊ณ  ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฐœ๋ฐœ ๋ชจ๋ธ๋กœ์จ ๋Œ€ํ‘œ์ ์œผ..

2022. 5. 16. 22:06

[Spring] Spring Advice๋กœ ์ปค์Šคํ…€ ์–ด๋“œ๋ฐ”์ด์Šค ๋งŒ๋“ค๊ธฐ

์ด๋ฒˆ ํฌ์ŠคํŠธ๋ถ€ํ„ฐ๋Š” Spring AOP ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ด์šฉํ•˜์—ฌ ์‹ค์ œ Advice๋ฅผ ๋งŒ๋“ค์–ด๋ณด๊ณ , ์œ„๋น™ํ•˜๋Š” ์‹œ๊ฐ„์„ ๊ฐ€์ ธ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Advice Interface Advice์— ๋Œ€ํ•ด ๋‹ค์‹œ ๋ณต์Šตํ•ด๋ณด์ž๋ฉด Advice๋Š” ํŠน์ • ์กฐ์ธํฌ์ธํŠธ ์ฆ‰, ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋˜๋Š” ์‹œ์ ์— ์‹คํ–‰ํ•  ์ฝ”๋“œ๋ฅผ ์ •์˜ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ProxyFactory ํด๋ž˜์Šค์—์„œ addAdvice ๋ฉ”์„œ๋“œ๋ฅผ ์ด์šฉํ•ด ์–ด๋“œ๋ฐ”์ด์Šค๋ฅผ ์ง์ ‘ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ Advisor ๊ตฌํ˜„์ฒด๋ฅผ addAdvice์— ์ „๋‹ฌํ•˜์—ฌ ๊ฐ„์ ‘์ ์œผ๋กœ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ์ฃ . ๋‘ ๋ฐฉ๋ฒ•์— ์ฐจ์ด๊ฐ€ ์žˆ๋‹ค๋ฉด ์–ด๋“œ๋ฐ”์ด์Šค์™€ ๋‹ฌ๋ฆฌ Advisor๋Š” ๊ด€๋ จ PointCut๊ณผ ํ•จ๊ป˜ ์–ด๋“œ๋ฐ”์ด์Šค๋ฅผ ์ „๋‹ฌํ•œ๋‹ค๋Š” ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. PointCut์€ ์‹ค์ œ ์–ด๋“œ๋ฐ”์ด์Šค๋ฅผ ์–ธ์ œ ์‹คํ–‰ํ• ์ง€๋ฅผ ์ •ํ•˜๋Š” AOP ์šฉ์–ด๋กœ ์–ด๋“œ๋ฐ”์ด์Šค๋ฅผ ์‹คํ–‰ํ•  ์ง€์ ์„ ์ƒ์„ธํ•˜๊ฒŒ ์ง€์ •..

2022. 5. 15. 22:37

[Spring] Spring AOP - Spring์—์„œ๋Š” AOP๋ฅผ ์–ด๋–ป๊ฒŒ ์ด์šฉํ• ๊นŒ?

์•ž์„œ ์šฐ๋ฆฌ๋Š” AOP(Aspect Oriented Programming, ๊ด€์  ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)์— ๋Œ€ํ•œ ๊ธฐ๋ณธ๊ณผ ๊ฐœ๋…์— ๋Œ€ํ•ด ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์ฝ์–ด๋ณด์ง€ ๋ชปํ–ˆ๋‹ค๋ฉด ์ด ๊ธ€์„ ์ฝ๊ธฐ ์ „ ๋ฐ˜๋“œ์‹œ ์ฝ์–ด๋ณด์‹œ๊ธธ ๊ถŒ์žฅ๋“œ๋ฆฝ๋‹ˆ๋‹ค. 2022.05.14 - [Programming/Spring] - [Spring] AOP (Aspect-Oriented Programming) ๊ธฐ๋ณธ๊ณผ ๊ฐœ๋… [Spring] AOP (Aspect-Oriented Programming) ๊ธฐ๋ณธ๊ณผ ๊ฐœ๋… Spring์—๋Š” AOP(Aspect-Oriented Programming, ๊ด€์  ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)์ด๋ผ๋Š” ํ•ต์‹ฌ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์Œ? OOP(๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)๋ผ๋Š” ๊ฒƒ์€ ๋“ค์–ด๋ดค๋Š”๋ฐ, AOP๋Š” ๋ฌด์—‡์ผ๊นŒ์š”? AOP vs OOP ? ๊ด€์  ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ blog..