SlideShare uma empresa Scribd logo
1 de 18
Defining Refactoring
The word Refactoring has two definitions
depending on context.
Refactoring (noun): a change made to the
internal structure of software to make it easier to
understand and cheaper to modify without
changing its observable behavior.
Refactor (verb): to restructure software by
applying a series of refactorings without
changing its observable behavior.
Defining Refactoring
The purpose of refactoring is to make the software
easier to understand and modify.
It only alters the internal structure.
A good contrast is performance optimization.
Refactoring does not change the observable
behavior of the software.
The Two Hats
Two distinct activities: adding function and
refactoring.
When you add function, you shouldn't be changing
existing code; you are just adding new capabilities.
When you refactor, you make a point of not adding
function; you only restructure the code.
Refactoring Improves the Design of
Software
Without refactoring, the design of the program will
decay.
Poorly designed code usually takes more code to do
the same things.
Refactoring Makes Software Easier to
Understand
Programming is in many ways a conversation with a
computer.
There is another user of your source code.
“I use refactoring to help me understand unfamiliar
code.
I actually change the code to better reflect my
understanding.”
Refactoring Helps You Find Bugs
Help in understanding the code also helps me spot
bugs.
"I'm not a great programmer; I'm just a good
programmer with great habits."
Refactoring Helps You Program Faster
Refactoring helps you develop software more
rapidly, because it stops the design of the system
from decaying.
When Should You Refactor?
Refactor When You Add Function
Refactor When You Need to Fix a Bug
Refactor As You Do a Code Review
What Do I Tell My Manager?
If the manager is technically savvy, introducing
the subject may not be that hard.
If the manager is genuinely quality oriented, then
the thing to stress is the quality aspects.
Of course, many people say they are driven by
quality but are more driven by schedule. In these
cases I give my more controversial advice: Don't
tell!
Databases
Most business applications are tightly coupled to the
database schema that supports them.
The database is difficult to change.
Another reason is data migration.
With nonobject databases, place a separate layer of
software between your object model and your
database model.
Object databases both help and hinder.
Changing Interfaces
There is no problem changing a method name if you
have access to all the code that calls that method.
There is a problem only if the interface is being used
by code that you cannot find and change.
Don't publish interfaces prematurely. Modify your
code ownership policies to smooth refactoring.
Design Changes That Are Difficult to
Refactor
How difficult would it be to refactor from one design
into another?
Pick the simplest design if it seems easy.
Otherwise put more effort into the design.
Refactoring and Design
Refactoring can be an alternative to upfront design.
In refactoring, you still do upfront design, but now
you don't try to find the solution. Instead all you want
is a reasonable solution. You know that as you build
the solution, as you understand more about the
problem
An important result of this change in emphasis is a
greater movement toward simplicity of design.
Refactoring and Performance
A common concern with refactoring is the effect it
has on the performance of a program.
Three general approaches to writing fast software:
time/footprint budget for resources
constant attention approach
performance improvement
Where Did Refactoring Come
From?
Two of the first people to recognize the importance
of refactoring were Ward Cunningham and Kent
Beck, who worked with Smalltalk from the 1980s
onward.

Mais conteúdo relacionado

Destaque

Chc ja-m &e officer-12.12.2014
Chc ja-m &e officer-12.12.2014Chc ja-m &e officer-12.12.2014
Chc ja-m &e officer-12.12.2014Sopheak Sem
 
Job annocement field supervisor v-1
Job annocement field supervisor v-1Job annocement field supervisor v-1
Job annocement field supervisor v-1Sopheak Sem
 
Chc ja pc shp_tmor puk_02022015
Chc ja pc shp_tmor puk_02022015Chc ja pc shp_tmor puk_02022015
Chc ja pc shp_tmor puk_02022015Sopheak Sem
 
Politicas Educativas
Politicas EducativasPoliticas Educativas
Politicas Educativasortenciasc
 
Tema 12 los gobiernos democráticos
Tema 12   los gobiernos democráticosTema 12   los gobiernos democráticos
Tema 12 los gobiernos democráticosangel_elgranado
 
Definiciones de política educativa
Definiciones de política educativaDefiniciones de política educativa
Definiciones de política educativaManu Heredia
 

Destaque (7)

Chc ja-m &e officer-12.12.2014
Chc ja-m &e officer-12.12.2014Chc ja-m &e officer-12.12.2014
Chc ja-m &e officer-12.12.2014
 
Job annocement field supervisor v-1
Job annocement field supervisor v-1Job annocement field supervisor v-1
Job annocement field supervisor v-1
 
Felipe glez
Felipe glezFelipe glez
Felipe glez
 
Chc ja pc shp_tmor puk_02022015
Chc ja pc shp_tmor puk_02022015Chc ja pc shp_tmor puk_02022015
Chc ja pc shp_tmor puk_02022015
 
Politicas Educativas
Politicas EducativasPoliticas Educativas
Politicas Educativas
 
Tema 12 los gobiernos democráticos
Tema 12   los gobiernos democráticosTema 12   los gobiernos democráticos
Tema 12 los gobiernos democráticos
 
Definiciones de política educativa
Definiciones de política educativaDefiniciones de política educativa
Definiciones de política educativa
 

Semelhante a Principlesinrefactoring 090906230021-phpapp01

Principles in Refactoring
Principles in RefactoringPrinciples in Refactoring
Principles in RefactoringChamnap Chhorn
 
Software design.edited (1)
Software design.edited (1)Software design.edited (1)
Software design.edited (1)FarjanaAhmed3
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsJuan Lopez
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
Mit104 software engineering
Mit104  software engineeringMit104  software engineering
Mit104 software engineeringsmumbahelp
 
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...FredReynolds2
 
Advanced Software Engineering.ppt
Advanced Software Engineering.pptAdvanced Software Engineering.ppt
Advanced Software Engineering.pptRvishnupriya2
 
Grokking Simplicity: taking a new approach to programming
Grokking Simplicity: taking a new approach to programmingGrokking Simplicity: taking a new approach to programming
Grokking Simplicity: taking a new approach to programmingManning Publications
 
The dependency inversion principle
The dependency inversion principleThe dependency inversion principle
The dependency inversion principlenavicorevn
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure rupeshchanchal
 
Reengineering including reverse & forward Engineering
Reengineering including reverse & forward EngineeringReengineering including reverse & forward Engineering
Reengineering including reverse & forward EngineeringMuhammad Chaudhry
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Robin O'Brien
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introductionVishal Singh
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHPAdam Culp
 
CSCI-383 Lecture 5-6-7: Object-Oriented Design
CSCI-383 Lecture 5-6-7: Object-Oriented DesignCSCI-383 Lecture 5-6-7: Object-Oriented Design
CSCI-383 Lecture 5-6-7: Object-Oriented DesignJI Ruan
 

Semelhante a Principlesinrefactoring 090906230021-phpapp01 (20)

Principles in Refactoring
Principles in RefactoringPrinciples in Refactoring
Principles in Refactoring
 
Software design.edited (1)
Software design.edited (1)Software design.edited (1)
Software design.edited (1)
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
Mit104 software engineering
Mit104  software engineeringMit104  software engineering
Mit104 software engineering
 
Lecture1422914635
Lecture1422914635Lecture1422914635
Lecture1422914635
 
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...
Mastering Data Engineering: Common Data Engineer Interview Questions You Shou...
 
Software re engineering
Software re engineeringSoftware re engineering
Software re engineering
 
Advanced Software Engineering.ppt
Advanced Software Engineering.pptAdvanced Software Engineering.ppt
Advanced Software Engineering.ppt
 
Grokking Simplicity: taking a new approach to programming
Grokking Simplicity: taking a new approach to programmingGrokking Simplicity: taking a new approach to programming
Grokking Simplicity: taking a new approach to programming
 
The dependency inversion principle
The dependency inversion principleThe dependency inversion principle
The dependency inversion principle
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 
Reengineering including reverse & forward Engineering
Reengineering including reverse & forward EngineeringReengineering including reverse & forward Engineering
Reengineering including reverse & forward Engineering
 
Thoughtful Software Design
Thoughtful Software DesignThoughtful Software Design
Thoughtful Software Design
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introduction
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHP
 
CSCI-383 Lecture 5-6-7: Object-Oriented Design
CSCI-383 Lecture 5-6-7: Object-Oriented DesignCSCI-383 Lecture 5-6-7: Object-Oriented Design
CSCI-383 Lecture 5-6-7: Object-Oriented Design
 
Ch17
Ch17Ch17
Ch17
 

Mais de Sopheak Sem

Chc ja-mdr-tb nurses.12.12.2014
Chc ja-mdr-tb nurses.12.12.2014Chc ja-mdr-tb nurses.12.12.2014
Chc ja-mdr-tb nurses.12.12.2014Sopheak Sem
 
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014Outline of consultative workshop on integrated promotion v.1.1 14_oct2014
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014Sopheak Sem
 
Announcement on advaced tot bcc
Announcement on advaced tot bccAnnouncement on advaced tot bcc
Announcement on advaced tot bccSopheak Sem
 
Application form advanced tot bcc
Application form advanced tot bccApplication form advanced tot bcc
Application form advanced tot bccSopheak Sem
 
Outline of sales promotion workshop v 1 2_12aug14
Outline of sales promotion workshop v 1 2_12aug14Outline of sales promotion workshop v 1 2_12aug14
Outline of sales promotion workshop v 1 2_12aug14Sopheak Sem
 
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...Sopheak Sem
 
Ageing&migrationin cambodia26dec2013 (1)
Ageing&migrationin cambodia26dec2013 (1)Ageing&migrationin cambodia26dec2013 (1)
Ageing&migrationin cambodia26dec2013 (1)Sopheak Sem
 
Cambodia's older people's association guidelines (1)
Cambodia's older people's association guidelines (1)Cambodia's older people's association guidelines (1)
Cambodia's older people's association guidelines (1)Sopheak Sem
 
Support for the elderly in cambodia letter
Support for the elderly in cambodia letterSupport for the elderly in cambodia letter
Support for the elderly in cambodia letterSopheak Sem
 
Isps course announcement 2014 15_giz
Isps course announcement 2014 15_gizIsps course announcement 2014 15_giz
Isps course announcement 2014 15_gizSopheak Sem
 
To r lgcr 14-007
To r lgcr 14-007To r lgcr 14-007
To r lgcr 14-007Sopheak Sem
 
Application form of chpm
Application form of chpmApplication form of chpm
Application form of chpmSopheak Sem
 
Announcement on chpm
Announcement on chpmAnnouncement on chpm
Announcement on chpmSopheak Sem
 
Concept note heifer
Concept note heiferConcept note heifer
Concept note heiferSopheak Sem
 
Case study 1 06 sept 13
Case study 1 06 sept 13Case study 1 06 sept 13
Case study 1 06 sept 13Sopheak Sem
 
Javascriptinobject orientedway-090512225827-phpapp02
Javascriptinobject orientedway-090512225827-phpapp02Javascriptinobject orientedway-090512225827-phpapp02
Javascriptinobject orientedway-090512225827-phpapp02Sopheak Sem
 
Espositoajaxremote 1210732828647866-8
Espositoajaxremote 1210732828647866-8Espositoajaxremote 1210732828647866-8
Espositoajaxremote 1210732828647866-8Sopheak Sem
 
Introductiontorails 120804023905-phpapp02
Introductiontorails 120804023905-phpapp02Introductiontorails 120804023905-phpapp02
Introductiontorails 120804023905-phpapp02Sopheak Sem
 

Mais de Sopheak Sem (20)

Chc ja-mdr-tb nurses.12.12.2014
Chc ja-mdr-tb nurses.12.12.2014Chc ja-mdr-tb nurses.12.12.2014
Chc ja-mdr-tb nurses.12.12.2014
 
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014Outline of consultative workshop on integrated promotion v.1.1 14_oct2014
Outline of consultative workshop on integrated promotion v.1.1 14_oct2014
 
Announcement on advaced tot bcc
Announcement on advaced tot bccAnnouncement on advaced tot bcc
Announcement on advaced tot bcc
 
Application form advanced tot bcc
Application form advanced tot bccApplication form advanced tot bcc
Application form advanced tot bcc
 
Outline of sales promotion workshop v 1 2_12aug14
Outline of sales promotion workshop v 1 2_12aug14Outline of sales promotion workshop v 1 2_12aug14
Outline of sales promotion workshop v 1 2_12aug14
 
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...
Analysis of-gender-and-emerging-issues-with-focus-on-ageing-population-help a...
 
Ageing&migrationin cambodia26dec2013 (1)
Ageing&migrationin cambodia26dec2013 (1)Ageing&migrationin cambodia26dec2013 (1)
Ageing&migrationin cambodia26dec2013 (1)
 
Cambodia's older people's association guidelines (1)
Cambodia's older people's association guidelines (1)Cambodia's older people's association guidelines (1)
Cambodia's older people's association guidelines (1)
 
Support for the elderly in cambodia letter
Support for the elderly in cambodia letterSupport for the elderly in cambodia letter
Support for the elderly in cambodia letter
 
Isps course announcement 2014 15_giz
Isps course announcement 2014 15_gizIsps course announcement 2014 15_giz
Isps course announcement 2014 15_giz
 
To r lgcr 14-007
To r lgcr 14-007To r lgcr 14-007
To r lgcr 14-007
 
Application form of chpm
Application form of chpmApplication form of chpm
Application form of chpm
 
Announcement on chpm
Announcement on chpmAnnouncement on chpm
Announcement on chpm
 
Bfh
BfhBfh
Bfh
 
Afh
AfhAfh
Afh
 
Concept note heifer
Concept note heiferConcept note heifer
Concept note heifer
 
Case study 1 06 sept 13
Case study 1 06 sept 13Case study 1 06 sept 13
Case study 1 06 sept 13
 
Javascriptinobject orientedway-090512225827-phpapp02
Javascriptinobject orientedway-090512225827-phpapp02Javascriptinobject orientedway-090512225827-phpapp02
Javascriptinobject orientedway-090512225827-phpapp02
 
Espositoajaxremote 1210732828647866-8
Espositoajaxremote 1210732828647866-8Espositoajaxremote 1210732828647866-8
Espositoajaxremote 1210732828647866-8
 
Introductiontorails 120804023905-phpapp02
Introductiontorails 120804023905-phpapp02Introductiontorails 120804023905-phpapp02
Introductiontorails 120804023905-phpapp02
 

Último

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Principlesinrefactoring 090906230021-phpapp01

  • 1.
  • 2. Defining Refactoring The word Refactoring has two definitions depending on context. Refactoring (noun): a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior. Refactor (verb): to restructure software by applying a series of refactorings without changing its observable behavior.
  • 3. Defining Refactoring The purpose of refactoring is to make the software easier to understand and modify. It only alters the internal structure. A good contrast is performance optimization. Refactoring does not change the observable behavior of the software.
  • 4. The Two Hats Two distinct activities: adding function and refactoring. When you add function, you shouldn't be changing existing code; you are just adding new capabilities. When you refactor, you make a point of not adding function; you only restructure the code.
  • 5.
  • 6. Refactoring Improves the Design of Software Without refactoring, the design of the program will decay. Poorly designed code usually takes more code to do the same things.
  • 7. Refactoring Makes Software Easier to Understand Programming is in many ways a conversation with a computer. There is another user of your source code. “I use refactoring to help me understand unfamiliar code. I actually change the code to better reflect my understanding.”
  • 8. Refactoring Helps You Find Bugs Help in understanding the code also helps me spot bugs. "I'm not a great programmer; I'm just a good programmer with great habits."
  • 9. Refactoring Helps You Program Faster Refactoring helps you develop software more rapidly, because it stops the design of the system from decaying.
  • 10. When Should You Refactor? Refactor When You Add Function Refactor When You Need to Fix a Bug Refactor As You Do a Code Review
  • 11. What Do I Tell My Manager? If the manager is technically savvy, introducing the subject may not be that hard. If the manager is genuinely quality oriented, then the thing to stress is the quality aspects. Of course, many people say they are driven by quality but are more driven by schedule. In these cases I give my more controversial advice: Don't tell!
  • 12.
  • 13. Databases Most business applications are tightly coupled to the database schema that supports them. The database is difficult to change. Another reason is data migration. With nonobject databases, place a separate layer of software between your object model and your database model. Object databases both help and hinder.
  • 14. Changing Interfaces There is no problem changing a method name if you have access to all the code that calls that method. There is a problem only if the interface is being used by code that you cannot find and change. Don't publish interfaces prematurely. Modify your code ownership policies to smooth refactoring.
  • 15. Design Changes That Are Difficult to Refactor How difficult would it be to refactor from one design into another? Pick the simplest design if it seems easy. Otherwise put more effort into the design.
  • 16. Refactoring and Design Refactoring can be an alternative to upfront design. In refactoring, you still do upfront design, but now you don't try to find the solution. Instead all you want is a reasonable solution. You know that as you build the solution, as you understand more about the problem An important result of this change in emphasis is a greater movement toward simplicity of design.
  • 17. Refactoring and Performance A common concern with refactoring is the effect it has on the performance of a program. Three general approaches to writing fast software: time/footprint budget for resources constant attention approach performance improvement
  • 18. Where Did Refactoring Come From? Two of the first people to recognize the importance of refactoring were Ward Cunningham and Kent Beck, who worked with Smalltalk from the 1980s onward.