역할과 구현을 나누어서,
즉, 인터페이스와 구현할 객체를 나누어서 개발을 해보겠습니다.
단, 순수한 자바로만 개발을 해봅시다.
그래서 실제 요구사항이 나중에 변경이 되었을 때 정말 유연하게 대처가 가능한지, 다형성, OCP, DIP가 잘 지켜지고 있는지 확인 해보겠습니다.
→ 자세히
다운로드 했다면 알집을 풀어서 build.gradle을 열어줍니다. 이 때 open as Project로 열어줍니다.
build.gradle
설정이 변경되면 코끼리를 눌러서 적용을 해줘야합니다. 그래야 라이브러리 같은게 변경이 됩니다.
plugins {
id 'org.springframework.boot' version '2.5.4' //스프링 부트 버전이 2.5.4
id 'io.spring.dependency-management' version '1.0.11.RELEASE' //의존관계 관련된 부분 설정
id 'java'
}
group = 'hello' //적어준대로 hello
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11' //자바 버전 11
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter' //의존관계가 spring-boot-starter만 쓰고 있음
testImplementation('org.springframework.boot:spring-boot-starter-test') { //test 관련된 라이브러리
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
이제 실행이 잘 되는지 확인합니다.
실행이 되고 끝나면 정상입니다.
🌟 [TIP]
Gradle 모드에서 IntelliJ 모드로 변경
인텔리제이로 바로 실행하기 때문에 좀 빠름