[Android] @AutoValue 에 대하여.
An Introduction to AutoValue 라는 글을 보면서 @AutoValue의 사용에 대해 한글로 정리된 글이 별로 없어서 아래와 같이 정리해본다. ( An Introduction to AutoValue 에서 예시들을 가져왔음을 밝힌다) 우선 들어가기 전에 Java에서 유명한 책인 Effective Java의 저자 Joshua Bloch가 AutoValue와 관련해서 아래와 같은 말을 했다고 한다. "AutoValue is a great tool for eliminating the drudgery of writing mundane value classes in Java. It encapsulates much of the advice in Effective Java Chapter 2, and frees you to concentrate on the more interesting aspects of your program. The resulting program is likely to be shorter, clearer, and freer of bugs. Two thumbs up." -- Joshua Bloch, author, Effective Java 위의 말을 발로 번역을 해보자면 "AutoValue는 평범한 Value Class 작성의 힘든 작업들을 줄여주기 위한 훌륭한 툴이다. Effective Java 2장의 많은 Advice들을 캡슐화해서, 당신의 프로그램에서 흥미로운 부분에 좀 더 집중할 수 있게 해준다. 그 결과로 프로그램은 좀 더 짧아지고, 깨끗하지며, 버그로부터 자유로워 질수 있다. 쌍따봉!!" -- Joshua Bloch, author, Effective Java 은근 책을 홍보하는 내용이 담겨있기는 하지만, AutoValue는 우리 코드 작성을 줄여주는데 도움을 주는 도구이다. 라는 정도만 이해하고 진행하도록 하자. 1. 기본적인 용도 Android를 개발하다보...