Thursday, October 29, 2009

ECLIPSE









































Prev don't be afraid of buying books Next






























ECLIPSE



Eclipse[URL 32] is a fairly new development
environment that is becoming very popular. It was written by Object
Technology International (OTI), a subsidiary of IBM. OTI is the
company behind IBM's Smalltalk and Java tools. IBM's Websphere
Application Development Studio (WSAD) is built on top of Eclipse.
Eclipse is an open source project that is freely available for
download.



What makes Eclipse so interesting is how XP- and
TDD-friendly it is. It should be no surprise that one of the people
central to the Eclipse effort is Erich Gamma (coauthor of Design Patterns [19] and
JUnit).





JUnit integration




Eclipse is architected as a common core
platform and a series of plugins. In fact, the Java development
environment is itself a set of Eclipse plugins. The JUnit plugin is
of special interest, in particular for the way it is integrated
into the Java toolset. JUnit plugin's features include:







  • a TestCase creation wizard







  • a TestSuite creation and updating wizard







  • a deeply integrated TestRunner that
    provides:







    - a view for
    test results







    - the ability to hide packages in the stack
    trace







    - clickable test lists and stack trace (clicking
    opens the corresponding file/line in an editor)







    - an easy way to rerun tests











  • an integration with the Run menus, allowing a class to be run as
    a JUnit Test, including in the debugger







  • the ability to keep JUnit running to increase
    the speed of running tests, and to allow the rerunning of
    individual tests.







Having JUnit integrated this tightly with the
development environment greatly streamlines the TDD experience.





Problem indication



Eclipse indicates problems that will prevent
code from compiling. Offending code is underlined with a wavy red
line, and the line is flagged in the left margin with a yellow
lightbulb. You can have Eclipse offer corrections by clicking on
the lightbulb, or positioning the caret on the offending code and
typing CTRL-1. Select a correction from the list to have
it applied. Figure 6.7
shows an example of this in action.







Figure 6.7. Problem indication and
correction in Eclipse.

















This capability gets us to the point where
we have a compiling, failing test very quickly. It really
streamlines the process of letting the compiler tell you what you
need to do. You can skip the manual process of compiling, checking
the error messages, adding the appropriate stubs, etc. You can have
Eclipse add the stubs as appropriate (including classes,
interfaces, methods, instance variables, and local variables) while
you are still thinking about the problem at hand. Then you can get
on with making the test pass.





Refactoring support



Eclipse supports several automated refactorings
that greatly speed development. Refactoring provided includes:







  • Extracting a method







  • Renaming a package







  • Renaming a class or interface







  • Renaming a method







  • Renaming a field







  • Renaming a local variable







  • Renaming method parameters







  • Reordering method parameters







  • Extracting a local variable







  • Inlining a local variable







  • Self-encapsulating a field







  • Replacing a local variable with a query







  • Pulling members up to their superclass







  • Moving static members between types







Being able to use automated refactorings
increases both your confidence, since the refactorings are proven
not to introduce errors, and your speed, since you don't have to
perform each step of the refactoring manually.



Eclipse includes all of the standard features
expected in an IDE, such as code assist, incremental compilation,
documentation lookup, etc., all of which serve to streamline the
programming process.















































Amazon






No comments: