Loading...
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..

2022. 5. 14. 20:21

[Spring] AOP (Aspect-Oriented Programming) ๊ธฐ๋ณธ๊ณผ ๊ฐœ๋…

Spring์—๋Š” AOP(Aspect-Oriented Programming, ๊ด€์  ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)์ด๋ผ๋Š” ํ•ต์‹ฌ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์Œ? OOP(๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)๋ผ๋Š” ๊ฒƒ์€ ๋“ค์–ด๋ดค๋Š”๋ฐ, AOP๋Š” ๋ฌด์—‡์ผ๊นŒ์š”? AOP vs OOP ? ๊ด€์  ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ(AOP)์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์ฝ”๋“œ๊ฐ€ ์ค‘๋ณต๋˜๊ณ  ๊ฐ•๋ ฅํ•˜๊ฒŒ ๊ฒฐํ•ฉ๋˜์–ด ๋‹ค๋ฅธ ๋กœ์ง๊ณผ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์—†๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ์ง๋“ค์„ ๋ณ„๋„์˜ ๊ด€์‹ฌ์‚ฌ๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ๋ชจ๋“ˆํšŒ ํ•˜๋Š” ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๋ณดํ†ต ์ด๋Ÿฌํ•œ ๋กœ์ง์„ ๋งŒ๋‚ฌ์„ ๋•Œ ์ฝ”๋“œ๋ฅผ ๋ณต์ œํ•˜์—ฌ ์˜์กด์„ฑ์„ ๋งŒ๋“ค๊ฒŒ ๋˜๋Š”๋ฐ, AOP๋Š” ์ด๋Ÿฌํ•œ ์˜์กด์„ฑ ์—†์ด๋„ ๋™์ž‘ํ•˜๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค. ๋Œ€ํ‘œ์ ์œผ๋กœ logging ์ฝ”๋“œ๋“ค์ด ์—ฌ๊ธฐ์— ํ•ด๋‹นํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด AOP์™€ OOP๋Š” ์„œ๋กœ ๊ฒฝ์Ÿํ•˜๋Š” ๊ด€๊ณ„์ธ๊ฐ€์š”? ๊ทธ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค. ์™œ๋ƒํ•˜๋ฉด ์šฐ๋ฆฌ๋Š” OOP๋งŒ์„ ๊ฐ€์ง€๊ณ  ..