Index 46 (8) 10XX Bettelheim Bruno Cudowne i pożyteczne O znaczeniach i wartoÂściach baÂśni (5) 116 01 (6) rozdzial 07 (15) cyrk Rice Anne Sluga kosci ch21 (4) KRWAWBOG.TXT tip2 (29) |
[ Pobierz całość w formacie PDF ] .One of my favorite phrases from Extreme Programming (and one I find that I violate often for usually silly reasons) is do the simplest thing that could possibly work. Most of the time, the simplest and most expedient approach, if you can discover it, is the best one.Exercisesl Create a class containing a static clause that throws an exceptionif assertions are not enabled.Demonstrate that this test works correctly.ll Modify the above example to use the approach inLoaderAssertions.java to turn on assertions instead of throwing anexception.Demonstrate that this works correctly.ll In LoggingLevels.java, comment out the code that sets the severitylevel of the root logger handlers and verify that messages of levelCONFIG and below are not reported.Commentll Inherit from java.util.Logging.Level and define your own level, witha value less than FINEST.Modify LoggingLevels.java to use your new leveland show that messages at your level will not appear when the logging level isFINEST.ll Associate a FileHandler with the root logger.Commentll Modify the FileHandler so that it formats output to a simple textfile.Commentll Modify MultipleHandlers.java so that it generates output in plaintext format instead of XML.Commentll Modify LoggingLevels.java to set different logging levels for thehandlers associated with the root logger.Commentll Write a simple program that sets the root logger logging level based on acommand-line argument.Commentll Write an example using Formatters and Handlers to output a log file asHTML.Commentll Write an example using Handlers and Filters to log messages with anyseverity level over INFO in one file and any severity level including and belowINFO in other file.The files should be written in simple text.Commentll Modify log.prop to add an additional initialization class thatinitializes a custom Formatter for the logger com.Commentll Run JDB on SimpleDebugging.java, but do not give the commandcatch Exception.Show that it still catches the exception.ll Add an uninitialized reference to SimpleDebugging.java (youllhave to do it in a way that the compiler doesnt catch the error!) and useJDB to track down the problem.ll Perform the experiment described in the Coverage Testingsection.ll Create a doclet that displays identifiers which might not follow the Javanaming convention by checking how capital letters are used for thoseidentifiers.l It is primarily oriented to static checking, however.There is an alternative system, called latent typing or dynamic typing or weak typing, in which the type of an object is still enforced, but it is enforced at run-time, when the type is used, rather than at compile time.Writing code in such a language Python (http://www.python.org) is an excellent example gives the programmer much more flexibility and requires far less verbiage to satisfy the compiler, and yet still guarantees that objects are used properly.However, to a programmer convinced that strong, static type checking is the only sensible solution, latent typing is anathema and serious flame wars have resulted from comparisons between the two approaches.As someone who is always in pursuit of greater productivity, I have found the value of latent typing to be very compelling.In addition, the ability to think about the issues of latent typing help you, I believe, to solve problems that are difficult to think about in strong, statically typed languages.Although the electronic version of this book is freely available, it is not open source.Inspired by Pythons doctest module.Originally placed in Thinking in Patterns, available at www.BruceEckel.com.However, with the addition of the reflection approach in JUnit, my framework doesnt make much sense anymore and will probably be removed.A key phrase from Extreme Programming (XP).Ironically, one of the JUnit authors (Kent Beck) is also the author of Extreme Programming Explained (Addison-Wesley 2000) and a main proponent of XP.Bill Venners and I have discussed this at some length, and we havent been able to figure out why it is done this way rather than creating each object right before the test is run.It is likely that it is simply an artifact of the way JUnit was originally implemented.Design by contract is described in detail in Chapter 11 of Object-Oriented Software Construction, 2nd Edition, by Bertrand Meyer, Prentice-Hall 1997.Except by the occasional company which, for reasons beyond comprehension, is still convinced that closed-source tools are somehow better or have superior tech support [ Pobierz całość w formacie PDF ] |
||||
Wszelkie Prawa Zastrzeżone! Kawa była słaba i bez smaku. Nie miała treści, a jedynie formę. Design by SZABLONY.maniak.pl. | |||||