Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assignments/first_week/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Wed Apr 12 23:09:25 KST 2023
gradle.version=7.4
Binary file not shown.
Binary file added assignments/first_week/.gradle/file-system.probe
Binary file not shown.
Empty file.
17 changes: 17 additions & 0 deletions assignments/first_week/.idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions assignments/first_week/.idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions assignments/first_week/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assignments/first_week/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions assignments/first_week/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions assignments/first_week/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assignments/first_week/.idea/jpa-buddy.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions assignments/first_week/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assignments/first_week/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

167 changes: 167 additions & 0 deletions assignments/first_week/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions assignments/first_week/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## 💸 객체지향 개념을 활용하여 은행 구현해보기

## 기능 명세

### 사용자

- [x] 회원가입
- [x] 입금
- [x] 출금

### 계좌

- [x] 계좌 개설
- [x] 계좌번호 랜덤 생성 기능

## 객체들의 역할 -> SRP

- 하나의 객체가 하나의 역할만 하도록 역할을 분리

### Account 관련

1. Account : 계좌에 대하여 정의
2. AccountRepository : 계좌 관련 DB 저장 및 조회
3. AccountType : 계좌의 종류에 대하여 정의
4. TransactionType : 계좌를 이용한 거래의 종류에 대하여 정의
5. AccountRegisterDto : 계좌를 등록할 시에 사용하는 dto
6. AccountService : 저축 계좌, 입출금 계좌에 공통적으로 사용되는 비지니스 로직 명시
7. ChequingAccountService : 입출금 계좌에 사용되는 비지니스 로직 구현
8. SavingsAccountService : 저축계좌에 사용되는 비지니스 로직 구현
9. AccountController : 클라이언트로부터 들어온 계좌 관련 요청을 처리
10. LogGenerator : 계좌 거래 기록을 위해 일정한 형태로 가공
11. NumberGenerator : 계좌번호를 난수로 생성

### User 관련

1. User : 사용자에 대하여 정의
2. UserRepository : 사용자 관련 DB 저장 및 조회
3. UserService : 사용자 관련 비지니스 로직 구현
4. UserRegisterDto : 사용자 등록 시에 사용하는 dto
5. UserController : 클라이언트로부터 들어온 사용자 관련 요청을 처리

### 기타

1. CommandSign : 사용자의 입력값의 의미와 사인에 대하여 저장
2. BankController : 클라이언트의 요청을 처리
3. BankView : 입출력

## 활용 개념

1. 캡슐화

- UserRegisterDto, AccountRegisterDto: Dto 를 이용하여 클라이언트의 입력값을 캡슐화

1. 변경될 필요가 없는 파라미터에 안정성을 위해 final 키워드 사용
2. 전역적으로 접근할 수 있는 상수는 static final 이용
- 계좌번호 관련 정보, 계좌 개설 가능 연령
- 클라이언트가 입력하는 입력값에 대한 정보
3. 다형성
- 계좌를 저축 / 입출금 계좌로 나누어 인터페이스에 정의된 register, deposit, withdraw 와 같은 공통적인 메서드들을 계좌의 타입에 따라서 다르게 구현
4. 추상화

- 인터페이스를 이용하여 저축 / 입출금 계좌에서 필요한 공통적인 메서드들을 정의

5. 리스코브 치환의 원칙

- SavingsAccountService, ChequingAccountService 모두 AccountService로 대체될 수 있음
19 changes: 19 additions & 0 deletions assignments/first_week/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id 'java'
}

group 'org.bank'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
useJUnitPlatform()
}
Binary file not shown.
Binary file added assignments/first_week/gradle/.DS_Store
Binary file not shown.
Binary file added assignments/first_week/src/.DS_Store
Binary file not shown.
Binary file added assignments/first_week/src/main/.DS_Store
Binary file not shown.
Loading