|
|
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
* Конвертация файла может нарушить форматирование оригинала. По-возможности скачивайте файл в оригинальном формате.
Популярные книги за неделю:
Проектирование и строительство. Дом, квартира, садАвтор: Петер Нойферт, Автор: Людвиг Нефф
Размер книги: 20.83 Mb
Система упражнений по развитию способностей человека (Практическое пособие)Автор: Петров Аркадий НаумовичКатегория: Путь к себе
Размер книги: 818 Kb
Сотворение мира (3-х томник)Автор: Петров Аркадий НаумовичКатегория: Путь к себе
Размер книги: 817 Kb
Радиолюбительские схемы на ИС типа 555Автор: Трейстер Р.Категория: Электротехника и связь
Размер книги: 13.64 Mb
Только что пользователи скачали эти книги:
Немец в валенкахАвтор: Воробьев КонстантинКатегория: Русская классическая проза
Размер книги: 23 Kb
0743471490__19Автор: Eric Flint & Mercedes Lackey & Dave Freer - This Rough Magic (BAEN) (v5) [htm jpg]
Размер книги: 18 Kb
Габриэль Гарсия Маркес. СССР: 22 400 000 квадратных километров без единой рекламы кока-колы!Автор:
Размер книги: 72 Kb
Буровые промывочные и тампонажные растворы: Учеб. пособие для вузовАвтор: Булатов А.И., Автор: Макаренко П.П., Автор: Проселков Ю.М.Категория: Геология И Изыскания, Нефть
Размер книги: 10.28 Mb
Исследование земной рефракции и методов геодезического нивелированияАвтор: Изотов А.А., Автор: Пеллинен Л.П.Категория: P_Physics, PGp_Geophysics
Размер книги: 3.54 Mb
Русский мир и Транснациональное русскоеАвтор: Щедровицкий ПетрКатегория: Научная литература
Размер книги: 42 Kb
|
|
|