Publicité

Refactoring

Developer na Software News à SNEWS - Automação para Telejornalismo
21 Jun 2016
Publicité

Contenu connexe

Publicité
Publicité

Refactoring

  1. Tópicos ● O que é refatoração? ● TDD ● Ciclo de refatoração ● Principais problemas ● Code Bad Smells ● Técnicas de refatoração ● Princípios ● Hands-on
  2. O que é refatoração? ● “…is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.” Fowler
  3. Principais problemas ● Expressar intenção e finalidade ● Duplicação de código ● Gerenciamento de dependências
  4. Code Bad Smells “Pedaços de código que estão errados em algum sentido e que são feios de ver!” Fowler (2009)
  5. Técnicas de refatoração
  6. OO Design Principles ● TDA: Tell, Don't ask! ● DRY: Don't repeat yourself ● LoD: Law of Demeter ● YAGNI: You aren't gonna need it ● KISS: Keep it simple, stupid ● SOLID ● GRASP: General Responsability Assignment Software Principles
  7. Tell Don't Ask
  8. Don't repeat yourself Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  9. YAGNI (You Aren't Gonna Need It)
  10. KISS (Keep it Simple, Stupid)
  11. “Understanding responsibilities is key to object-oriented design” Martin Fowler
  12. Fontes ● Catalog of Refactorings: http://refactoring.com/catalog/ ● SourceMaking: https://sourcemaking.com/refactoring ● TellDontAsk: http://martinfowler.com/bliki/TellDontAsk.html ● Dont Repeat Yourself: http://c2.com/cgi/wiki?DontRepeatYourself ● Law Of Demeter: http://c2.com/cgi/wiki/LawOfDemeter?LawOfDemeter ● Yagni: http://martinfowler.com/bliki/Yagni.html ● KISS: https://people.apache.org/~fhanik/kiss.html ● SOLID: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod ● GRASP: http://pt.slideshare.net/raheelarif54/grasp-confiz
Publicité