Hooray! You have added the first book to your bookshelf. Check it out now!
Create your own shelf sign up
[−]
  • Search Digit-count Valid ISBN Invalid ISBN Valid Barcode Invalid Barcode

Refactoring

Improving the Design of Existing Code

By Kent Beck,Don Roberts,William Opdyke,John Brant,Martin Fowler

(230)

| Hardcover | 9780201485677

Like Refactoring ?
Join aNobii to see if your friends read it, and discover similar books!

Sign up for free

Book Description

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. With refactoring you can even tak Continue

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. With refactoring you can even take a bad design and rework it into a good one. This book offers a thorough discussion of the principles of refactoring, including where to spot opportunities for refactoring, and how to set up the required tests. There is also a catalog of more than 40 proven refactorings with details as to when and why to use the refactoring, step by step instructions for implementing it, and an example illustrating how it works The book is written using Java as its principle language, but the ideas are applicable to any OO language.

18 Reviews

Login or Sign Up to write a review
  • 1 person finds this helpful

    Refactoring is the process of rewriting software, without changing the way it functions, in order to improve its readability, testability or maintanability. A book has been written on the subject by Martin Fowler. Some of the chapters were written by ...(continue)

    Refactoring is the process of rewriting software, without changing the way it functions, in order to improve its readability, testability or maintanability. A book has been written on the subject by Martin Fowler. Some of the chapters were written by other people.

    “Refactoring: Improving the Design of Existing Code” is focused on OO programming (lots of Java examples) and Agile practices. It is setup as a catalog of refactoring techniques. Each page dedicated to a refactoring is clearly marked, so that you can easily look up a refactoring.

    The book was written a decade ago. At that time IDE’s did not support advanced refactorings. Most of the methods described are fully automated in modern IDE’s. This means that you don’t have to follow the text that closely any more.
    Refactoring Book

    The first chapter starts with a simple example. Java code is used throughout the example as well as UML diagrams.

    2. Principles in Refactoring

    The Why and When of refactoring are discussed. Also we get instructions on what to tell our manager about refactoring. This seems a bit silly to me, since I have never had to explain refactoring to my managers.

    3. Bad Smells in Code

    “Code Smells” is a frequently used Agile phrase. A phrase I don’t care that much about. Code works or it doesn’t, it can be ugly or unreadable, but it doesn’t smell. The list of “smells” makes sense, however some of the names are downright confusing. For instance, would you be able to tell me what “Refused Bequest” means?

    4. Building Tests

    This chapter talks about JUnit at length. I am sure you are aware that there are many other unit testing frameworks for programming languages other than Java such as PyUnit. We are told that before you start refactoring, you need to have tests. I think it is more of a chicken/egg dilemma. Sometimes you need to refactor first in order to test. Unit tests and functional tests are mentioned. Integration tests, however are completely ignored. How would you know whether the performance and memory usage of your system remained the same? Clearly, this chapter was written by a software developer, and not by somebody who likes breaking applications, I mean testing applications.

    5. Toward a Catalog of Refactorings

    Chapter 5 describes the catalog of refactorings to follow. It is the catalog metada in a sense.

    6. Composing methods

    This chapter is the beginning of the catalog, which forms the “meat” of the book. I am just going to mention a few of the techniques listed in chapter 6.”Extract Method” is one of those refactorings I use on a daily basis. Sometimes things go wrong so we have to do the opposite refactoring “Inline Method”. The author starts using the term “temp” to mean temporary local variables.

    7. Moving Features Between Objects

    The author admits that he has trouble assigning responsibilities to objects. We are supposed to fix errors with “Move Method”, “Move Field”, “Extract Class” or other refactorings in this chapter.

    8. Organizing Data

    This chapter discusses a lot of different ways to simplify working with data. For instance, with these refactorings:

    Replace Data Value with Object
    Replace Array with Object

    Also the refactoring “Replace Magic Number with Symbolic Constant” is explained a.k.a “Extract Constant”.

    9. Simplifying Conditional Expressions

    In my opinion the refactorings in this chapter need to be renamed. Apart from “Decompose Conditional”, which is clear enough. Although “Breaking up Conditional” might have been better.
    10. Making Method Calls Simpler

    Make method calls simpler by renaming them or replacing long parameter lists by objects. The latter technique could be a problem in concurrent programs. It is common to pass immutable values as parameters. You might not be able to replace them by immutable objects.

    11. Dealing with Generalization

    Generalization or in OO terms inheritance is a powerful mechanism, that tends to be overused a lot. You can push/pull a method or a field. Inheritance can be replaced by delegation and vice versa.

    12. Big Refactorings

    In this chapter starts what we can call the “dessert” part. No more simple refactoring recipes. Instead four refactorings that take a considerable amount of time.

    13. Refactoring, Reuse and Reality

    This chapter is an essay on Refactoring by William Opdyke.

    14. Refactoring Tools

    IDE’s have come a long way since this book was written. Most of the issues in this chapter are no longer valid.

    15. Putting It All Together

    This final chapter by Kent Beck is a bit mystical and vague. Those are his own words by the way. Some of the points make sense, but the chapter is written too much in a master talking to an apprentice style.

    The book has a list of soundbites at the end. Literally. The fun thing is that you probably have heard or are going to hear a lot of these soundbites. “Refactoring” is a very useful book, albeit too focused on Java. Most recipes would work for another Object Oriented language. I give this book 5 stars out of 5.

    Is this helpful?

    Ivan Idris said on Jan 22, 2012 | Add your feedback

  • 1 person finds this helpful

    我推薦這本書,他可以幫忙我們的程式碼內部行為改造變更好

    這本書裡面除了解釋什麼是 Refactoring 意義之外,包含了幾個重要概念以及些程式設計上的技巧與試用時機。而且概念搭配適用時機,再加上程式碼對照看,學習起來變容易。

    Refactoring 是一個很好的設計工具,他可以幫忙協助我們的程式碼將內部行為改造,讓未來可以更好維護與增進。http://edwardinaction.blogspot.com/2011/01/improving-design-of-existing-code.html

    Is this helpful?

    Edward Chiang said on Jan 14, 2011 | Add your feedback

  • 1 person finds this helpful

    Un must read para cualquier diseñador / coder .

    Is this helpful?

    miguelff said on Oct 5, 2010 | Add your feedback

  • 1 person finds this helpful

    Refactoring: Improving the Design of Existing Code (The Addison-Wesley Object Technology Series) by Martin Fowler (1999)

    Is this helpful?

    Reinhard said on Oct 4, 2010 | Add your feedback

  • 1 person finds this helpful

    Capolavoro assoluto

    Una pietra miliare per chiunque sviluppi software.
    Mai letto un libro che sia riuscito a darmi tanto in cosi tanto poco (citazione di una frase di Churchill ;))
    La sua spettacolarità la manifesta proprio nella capacità di concretizzare istantaneamen ...(continue)

    Una pietra miliare per chiunque sviluppi software.
    Mai letto un libro che sia riuscito a darmi tanto in cosi tanto poco (citazione di una frase di Churchill ;))
    La sua spettacolarità la manifesta proprio nella capacità di concretizzare istantaneamente i consigli che vengono riportati.
    Ha stravolto il mio modo di pensare al software...non avevo mai letto niente riguardo al refactoring e prima di questo libro neanche conoscevo il termine. Ha creato un nuovo punto di vista da cui osservare lo sviluppo del software...un nuovo cardine su cui far ruotare la creazione.
    Fantastico...senza mezzi termini...fantastico!

    Is this helpful?

    DAXweb said on Sep 19, 2010 | Add your feedback

Book Details

  • Rating:
    (230)
    • 5 stars
    • 4 stars
    • 3 stars
  • English Books
  • Hardcover 464 Pages
  • ISBN-10: 0201485672
  • ISBN-13: 9780201485677
  • Publisher: Pearson Education (US)
  • Publish date: 1999-06-28
  • Dimensions: 219 mm x 1,231 mm x 1,573 mm
  • Also available as: eBook
  • In other languages: other languages 繁體書 , 简体书
Improve_data of this book