2022-12-05

최찬호·2022년 12월 5일

NullPointException을 피하는 방법
1. @Notnull or @Nullable을 사용 IDE에서 메세지를 통해 확인가능
2. assertion을 사용(개인적으로 가장 바람직하다고 생각) (단언)
3. Factory pattern(학습 필요)
4. 상황에 맞는 Exception Handling (가능성)
5. Common practice
6. Unit Test
7. Aspect Oriented Programming
8. Null Object pattern

방어적인 프로그램을 작성하는 방식. 명심하고 또 명심할 것!

profile
체득하고 이해하자

0개의 댓글