- 博客(0)
- 资源 (4)
空空如也
Manning Java Reflection In Action
英文经典原著
Java Reflection in Action
Java Reflection in Action is unique in presenting a clear account of all
the cool things you can do with reflection, and at the same time providing
the sound conceptual basis that developers need to create
advanced applications. The book includes careful explanations of
sometimes perplexing programming techniques along with enough
background to understand how to extend and vary them. This book
overcomes reflection’s reputation as a mysterious and esoteric philosophical
pursuit, or as a set of messy error-prone coding tricks.
As reflection becomes increasingly common and useful in all sorts
of applications, it is great to finally have a book that features disciplined
yet still creative and fun software engineering practices based
on reflection. Even occasional users will immediately adopt the
book’s patterns and idioms to solve common problems. Many of the
examples can be directly adapted for customized solutions in diverse
areas such as XML processing, automated software testing, and program
analysis tools. Readers will also find underlying rationales for
code performing introspection, proxies, class loading, and so on,
that are often seen but not often explained well in everyday Java programs.
And even experts will find new ideas and well-thought out
advice for using some of the more subtle aspects of reflection.
—Prof. Doug Lea, SUNY Oswego,
author of Concurrent Programming in Java
2010-04-11
Manning-AspectJInAction
I’ve always felt that implementing a software system is much harder than it
needs to be. It is difficult to map requirements to the implementation and
then trace the implementation back to the requirements. Although many
approaches—such as object-oriented programming, component-oriented programming,
and design patterns—help to some extent, none of them satisfactorily
addresses the system-level requirements, often referred to as crosscutting
concerns, that must be included in multiple modules.
I came across AspectJ version 0.3 in 1998 while looking for better ways to
architect a Java-based system. AspectJ was an implementation of aspect-oriented
programming (AOP), a new methodology that specifically targeted the
management of crosscutting concerns. Even though AspectJ was in its infancy,
I became fascinated by its potential. The struggle to keep up with all the new
advances in the Java and XML world, along with other priorities in my life,
prevented me from pursuing it further. Still, exploring AspectJ was always on
my to-do list, and I started looking at it again when it was in version 0.8. By
then, AspectJ had evolved into a much more powerful language. I started
using AspectJ and found that the more I used it, the more I fell in love with it.
Today, the current version of AspectJ (1.1)—which this book is based on—has
morphed into a mature, robust language.
In early 2002, I wrote a series of articles for JavaWorld describing AOP and
AspectJ; the book you are holding grew out of that series. From reader
responses, I realized that most developers understand that AspectJ can be
xviii PREFACE
used to modularize the crosscutting concern of logging, but they struggle to
imagine how it may be applied beyond that. Logging, while an important concern,
is not something developers lose sleep over. Logging using AspectJ, therefore,
is best characterized as a vitamin and not a painkiller; while vitamins are
important, often the need for them is not pressing enough to require immediate
action. To further complicate the situation, the examples of AOP that are widely
available today either repeat the same logging problem or are too abstract to be
of immediate practical value.
My mission statement for this book is “to be a key element in bringing AOP
and AspectJ into everyday practice.” To accomplish this goal, the book not only
presents the AspectJ language but also provides practical AspectJ-based solutions
to a wide variety of real-world problems. You will find that you can utilize these
solutions to quickly reap the benefits of the language. I have tried to use current
technologies as the basis for these solutions so that you can readily apply them to
your system. This also demonstrates that these latest technologies by themselves
are not enough to manage crosscutting concerns, since combined with AspectJ,
they provide a better solution. The book also presents a few original design patterns
that increase the power of AspectJ significantly.
It is not often that one gets to write about such an exciting new programming
methodology and language. I enjoyed writing this book. I hope you will enjoy
reading it.
2010-04-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人