|
libcats.org
Java Reflection in ActionIra R. Forman, Nate FormanI first ran across the concept of reflection in Java in Cornell's Core Java book back when I was first learning the Java programming language in 1998. However, that book just treated reflection as a set of cute pet tricks of which Java is capable. Interested in a particular aspect of a class? Use this or that method and inquire. Only thing was, as a developer of code and not of tools, I found this aspect of Java interesting but not particularly useful. This book gave me a whole new respect for the tool of reflection. In a large multimedia application, my main program was going through a long series of if statements and looking for matching strings and then calling the matching sub-application. It worked, but it was large, clunky, and not very maintainable. I read this book and got the idea for a much more elegant solution. Rather than enumerate each class, I build the class name of the object I need from my list of options to construct and instantiate using reflection at runtime. Mind you, I didn't read or buy this book with that solution in mind, the author was just so clear in talking about the usefulness of reflection that the idea came to me. That's just one of the uses I've found for reflection in reading this book. Trust me, you don't have to be a software tool developer to get good mileage from it. I highly recommend it. I list the table of contents just because the product description does not have it listed:
1 A few basics 1 2 Accessing fields reflectively 27 3 Dynamic loading and reflective construction 49 4 Using Java's dynamic proxy 73 5 Call stack introspection 107 6 Using the class loader 121 7 Reflective code generation 143 8 Design patterns 179 9 Evaluating performance 207 10 Reflecting on the future 225 appendix A Reflection and metaobject protocols 241 appendix B Handling compilation errors in the "Hello world!" program 253 appendix C UML 256 I subtract one star because this book was written before Java 1.5 came out, and new features have been added. However, it is still a good place to start when you want to see just what reflection in Java can do for you. EPUB | FB2 | MOBI | TXT | RTF
* Конвертация файла может нарушить форматирование оригинала. По-возможности скачивайте файл в оригинальном формате.
Популярные книги за неделю:
#2
![]() Самодельные детали для сельского радиоприемникаАвторы: З.Б.Гинзбург, Ф.И.Тарасов.Категория: радиоэлектроника
1.40 Mb
#6
![]() Тестирование Дот Ком, или Пособие по жестокому обращению с багами в интернет-стартапахРоман Савин
5.26 Mb
#7
![]() Система упражнений по развитию способностей человека (Практическое пособие)Петров Аркадий НаумовичКатегория: Путь к себе
818 Kb
#10
![]() Тренажер по математике к учебнику Л.Г.Петерсон. 2 классМАРКО ПОЛОКатегория: ДЛЯ ДЕТЕЙ, НАУКА и УЧЕБА
173.06 Mb
Только что пользователи скачали эти книги:
#3
![]() Materials Selection in Mechanical DesignMichael F. AshbyКатегория: Chemistry-Environmental-Material
24.66 Mb
#4
![]() Friction and Lubrication in Mechanical DesignA. A. SeiregКатегория: engeneering_technology
21.84 Mb
#6
![]() Probability Applications in Mechanical Design (Dekker Mechanical Engineering)Franklin FisherКатегория: Engineering
7.36 Mb
#7
![]() Собственные движения ''неподвижных'' звезд и их значение в астрономииКиселев А.А.Категория: Астрономия
85 Kb
#9
![]() Биология. Сборник задач по генетике. Базовый и повышенный уровень ЕГЭКириленко А.А.Категория: КНИГИ НАУКА и УЧЕБА
4.55 Mb
|
|