언어/객체지향
-
입출금 내역 분석기 (1) - 응집도와 결합도에 따른 클래스 분리언어/객체지향 2024. 5. 24. 17:12
1. 목표단일책임원칙을 배워보자응집도와 결합도에 대해 생각해보자 2. 요구사항텍스트 파일이 콤마로 분리된 값으로 주어진다. 이 값을 파싱해서 결과를 얻을 것이다.입출금 내역의 총 수입과 총 지출은 각각 얼마인가? 결과는 양수인가 음수인가?특정 달엔 몇 건의 입출금 내역이 발생했는가?지출이 가장 높은 상위 10건은 무엇인가?돈을 가장 많이 소비하는 항목은 무엇인가?30-01-2017,-100,Deliveroo//..3. KISS 원칙 keep it short and simple 원칙을 의미한다. 코드 설계나 내용을 불필요하게 복잡하게 만들지 말자는 원칙 public class BankTransactionAnalyzerSimple { private static final String RESOURCES ="..