Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Refatorar é preciso. Palestra TDC 2014

727 views

Published on

Resumo:
Uma abordagem prática de como refatorar aplicações legadas utilizando Clean Code e SOLID de forma gradual e documentada.

Descrição:
Essa palestra aborda a necessidade e os desafios na hora de refatorar uma aplicação em PHP, vemos um pouco dos conhecimentos necessários para iniciar esse processo e como devemos arquitetar cada etapa do desenvolvimento.

Cada aplicação possui uma realidade diferente por isso será passado um de forma breve os conceitos de SOLID, Design Petterns e Object Calisthenic para poder aplica-los na arquitetura de cada projeto. Além de exemplos de refatoração em pontos específicos da aplicação.

Published in: Internet
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD TH1S BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK Here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB EBOOK Here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK Here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB EBOOK Here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc EBOOK Here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Refatorar é preciso. Palestra TDC 2014

  1. 1. Globalcode – Open4education Refatorar é Preciso! Daniel Archer
  2. 2. Globalcode – Open4education Quem vos fala Daniel Archer Formado em Análise de Sistemas Programador PHP há 5 anos E eu também escrevo código Ruim...
  3. 3. Globalcode – Open4education Quem aqui escreve um bom código?
  4. 4. Globalcode – Open4education Refactoring Refactoring: a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior. • Martin Fowler
  5. 5. Globalcode – Open4education Refactoring
  6. 6. Globalcode – Open4education Problemas Enfrentados Dificuldade de Entendimento Alto acoplamento Manutenção perigosa Produtividade reduzida
  7. 7. Globalcode – Open4education Ferramentas Clean Code Object Calisthenics Princípios SOLID Design Patterns
  8. 8. Globalcode – Open4education Conceitos Básicos Clean Code Clean code can be read, and enhanced by a developer other than its original author. (Dave A. Thomas, OTI Founder) Clean code is simple and direct (Grady Booch, author of Object Oriented Analysis and Design with Applications)
  9. 9. Globalcode – Open4education
  10. 10. Globalcode – Open4education Conceitos Básicos Object Calisthenic Um nível de indentação por método Não utilize else Encapsule os tipos primitivos Apenas um -> por linha Não Abrevie Mantenha suas classes Pequenas Limite o número de atributos (2~5) Utilize coleções Use Getters e Setters
  11. 11. Globalcode – Open4education Conceitos Básicos Princípios SOLID S ingle Responsability O pen / Closed L iskov Subtitution I nterface Segregation D ependency Injection
  12. 12. Globalcode – Open4education Vamos ver na prática... Como identificar e tomar a melhor decisão.
  13. 13. Globalcode – Open4education Refatoração - Interna Mantenha a mesma interface Sinalize métodos depreciados Teste
  14. 14. Globalcode – Open4education
  15. 15. Globalcode – Open4education
  16. 16. Globalcode – Open4education Refatoração - Estruturada Nem sempre teremos um código minimamente orientado a objetos Mapeie as relações Procure por dependências desta página em outros arquivos Agrupe as Classes em Namespaces ou Pastas (v.5.2-)
  17. 17. Globalcode – Open4education
  18. 18. Globalcode – Open4education
  19. 19. Globalcode – Open4education Refatoração - Diretórios Defina qual o objetivo final Documente o que for alterado Altere apenas o necessário Não tenha pressa Defina Etapas
  20. 20. Globalcode – Open4education
  21. 21. Globalcode – Open4education
  22. 22. Globalcode – Open4education
  23. 23. Globalcode – Open4education Refatoração - Objetos Inicie pelos métodos de menor complexidade Informe a equipe sobre a mudança na interface de alguma classe. Siga os padrões especificados Dica de ouro: converse com a sua equipe antes.
  24. 24. Globalcode – Open4education Ouça as opiniões Mesmo dentro de um grupo de desenvolvedores, dependemos da aceitação da equipe para que as mudanças sejam bem sucedidas.
  25. 25. Globalcode – Open4education
  26. 26. Globalcode – Open4education
  27. 27. Globalcode – Open4education Esqueça o padrão Singleton A maior parte das atuais atribuições do padrão singleton está relacionada a problemas no design
  28. 28. Globalcode – Open4education
  29. 29. Globalcode – Open4education
  30. 30. Globalcode – Open4education Acredite em outras ferramentas. Reuse! Não tente reinventar a roda
  31. 31. Globalcode – Open4education
  32. 32. Globalcode – Open4education

×