springboot4 [TIL] 221111 - SpringBoot Part2 : ํธ๋์ญ์ ๊ณผ AoP SpringBoot Part2 (5) AoP - ๊ด์ ์งํฅ ํ๋ก๊ทธ๋๋ฐ ๊ธฐ๋ฅ,๊ด์ฌ ์งํฅ์ ํ๋ก๊ทธ๋๋ฐ Cross Cutting Concern https://www.codejava.net/frameworks/spring/understanding-spring-aop : ์ค๋ณต์ฝ๋๋ฅผ ์ผ์ผํ ์ฌ์ฉํ๋ ๊ฒ์ด ์๋ ํ๋จ์ผ๋ก ๊ฑธ์ณ์ ์ ์ฉํด์ผํ๋ ๋ถ๊ฐ๊ธฐ๋ฅ(Cross Cutting Concern)์ ๋ถ๋ฆฌํด์ ๋ฐฉ์ ํต์ฌ๋ก์ง์ ๋ถ๊ฐ๊ธฐ๋ฅ์ ์ฝ๊ฒ ์ถ๊ฐํ ์ ์๊ฒํ๋ค. class ๊ณ์ข์ด์ฒด์๋น์ค { method ์ด์ฒด() { AAAA ๋น์ฆ๋์ค ๋ก์ง BBBB } method ๊ณ์ขํ์ธ() { AAAA ๋น์ฆ๋์ค ๋ก์ง BBBB } } class ๋์ถ์น์ธ์๋น์ค { method ์น์ธ() { AAAA ๋น์ฆ๋์ค ๋ก์ง BBBB } } ๋น์ง๋์ค ๋ฉ์๋๋ ๋น.. 2022. 11. 22. [TIL] 221108 - SpringBoot Part2 : JDBC SprintBoot part2 (2) JDBC ์์ํ๊ธฐ JDBC allows a java application to connect a relational database ํฌ๊ฒ ๋ ๋จ๊ณ ๋ ์ด์ด๋ก ๊ตฌ์ฑ๋๋ค. JDBC API JDBS DB Driver docker๋ฅผ ์ด์ฉํด mysql ์คํ IntelliJ ์ฐ๊ฒฐ maven dependency ์ถ๊ฐ JDBC CURD ์ค์ต 1. jdbc connection public class JdbcCustomerRepository { private static final Logger logger = LoggerFactory.getLogger(JdbcCustomerRepository.class); public static void main(String[] args) throws.. 2022. 11. 8. [TIL] 221107 - SpringBoot Part2 : Spring Test ์์ํ๊ธฐ SpringBoot Part2 - Spring Test ์์ํ๊ธฐ 1. ์ํํธ์จ์ด ํ ์คํ ์ํํธ์จ์ด์ ๊ฒฐํจ์ ์ฐพ๋ ๊ณผ์ https://martinfowler.com/bliki/TestPyramid.html Testing Level Unit tests Integration tests Component tests End-to-end tests 2. ๋จ์ ํ ์คํธ ๊ฐ์ฅ ์์ ๋จ์์ ํ ์คํธ : ๋ณดํธ์ ์ผ๋ก ํ๋์ class์ ํ๋์ ๋จ์ํ ์คํธ๋ฅผ ์์ฑํ๋ค. : ๊ณ ๋ฆฝํด์ ํ ์คํธ ํ๋ค. : ์๋ก์ด ๊ธฐ๋ฅ์ ์ถ๊ฐํ์๋ ๊ธฐ์กด ๊ธฐ๋ฅ๋ค์ด ๋จ์ํ ์คํธ์ ์ํด ์ ์๋ํ๋์ง ํ์ธํ ์ ์๋ค. : ํ ์คํธ ์ฝ๋(ํ ์คํธ ์ผ์ด์ค) ์์ฒด๊ฐ ๊ธฐ๋ฅ ๋ช ์ธ์๊ฐ ๋ ์ ์๋ค. : Spring ํ๊ฒฝ์์๋ ์ ๊ณต์ด ๋๋ ํ๋์ class์ ๊ธฐ๋ฅ์ ์ง์คํ ํ ์ค.. 2022. 11. 8. [TIL] 221103 - SpringBoot Part1 - ์ ํ๋ฆฌ์ผ์ด์ ์์ฑ ๊ด๋ฆฌ SpringBoot Part1 (4) 1. Enviroment profile ApplicationContext๋ EnvironmentCapable ์ธํฐํ์ด์ค๋ฅผ ์์๋ฐ์ผ๋ฉฐ getEnvironment() ๋ฉ์๋๋ฅผ ์ ๊ณตํ๋ค. profile์ ๋ฐ๋ผ ํ๊ฒฝ์ด ๋ฐ๋๊ณ ๊ทธ์ ๋ฐ๋ผ properties๊ฐ ๋ฐ๋๋ค. properties : ๋ค์ํ ์ ํ๋ฆฌ์ผ์ด์ ์์ฑ์ property๋ก ์ ์ํ๊ณ ์ค์ ํ๋ค. ๋ค์ํ ๋ฐฉ์์ผ๋ก ์ค์ ์ด ๊ฐ๋ฅํ๋ค. resources > application.properties : springboot์์ default๋ก ์ฌ์ฉํ๋ property ํ์ผ : key/value ํ์์ผ๋ก ์์ฑ version = v1.0.0 kdt.version = v1.0.0 kdt.support-vendors = a,b,c,d,.. 2022. 11. 6. ์ด์ 1 ๋ค์