SlideShare a Scribd company logo
Software Design
Anti Patterns
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Anti Pattern
■ A pattern that tells how to go from a problem to a bad solution
■ Defines what seems like an appropriate and effective solution to a problem but has
more bad consequences than good ones
– How not to solve a problem
– Negative solution to a problem
– Bad practice and common mistakes in a solution
■ Provides an identifiabletemplate for the problem and discuss its solutions
– Common vocabulary for identifying a problem and its solution
– Measures that can be taken to improve the solution
– Lessons learned from failures and their remedies
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Blob
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Blob
■ One class does most of the processing, and other classes only encapsulate data
■ Procedural design, where one class contains the majority of the process and other
classes contain the data
■ Majority of the responsibilities are allocated to a single class known as blob class
■ Symptoms:
– Single class in a system that knows too much or does too much
– One class with a large number of attributes, behaviors, or both
– One big class doing all the tasks while other classes only hold data
■ Consequences:
– Modification becomes difficult and expensive, modifying blob class affect others
– Blob class is complex to reuse or test
– Blob class may use excessive resources for simple operations
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Blob
■ Solutions:
– Increase cohesion in all the classes specially in blob class
– Migrate behaviors from blob class to their related data classes
– Identify related attributes and behaviors in blob class and move them to a new class
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Functional Decomposition
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Functional Decomposition
■ A real world action is turned into a class instead of a real world object
■ An approach that turns a subroutine into a class
■ No object oriented principles such as inheritance and polymorphism
■ Symptoms:
– Class with a functional name (named on a function instead of an object)
– Class with only a single behavior
■ Consequences:
– Hard to reuse and modify
– Documentation becomes difficult
– Lack of object oriented design
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Functional Decomposition
■ Solutions:
– Merge the class which contains a single behavior to an existing class in the system
where its related data resides
– If a class does not contain any state information, convert that class into a behavior
and insert that behavior into an appropriate existing class in the system
– Create new classes that satisfies the object oriented design and merge existing
incompatible classes into them
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Poltergeist
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Poltergeist
■ Class with limited and redundant responsibilities and short life cycle
■ Stateless class that creates unnecessary abstraction and complexity
■ Temporary class that adds an extra redundant step in navigation path
■ Symptoms:
– Class with single operations that only invoke other classes
– Class with short duration objects that only begin operations and do nothing else
■ Consequences:
– System becomes redundant and complex
– Wastage of resources
– Clutters the object oriented design
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Poltergeist
■ Solutions:
– Remove the stateless redundant class from the hierarchy and move its functionality
to the related classes
– Simplify the system by removing all the classes with transient associations and
make direct associations among related classes
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Cut & Paste Programming
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Cut & Paste Programming
■ Use existing code which is proven to work in similar situations with modification
■ Duplicate and extend already written code
■ Similar segments of code present throughout the project
■ Symptoms:
– Instead of writing code from scratch, use pre-written or partial code already
availableand extend it further
– Use an existing solution as a basis to define a new solution
■ Consequences:
– Code can be reused with minimum effort
– Same bugs reoccur throughout the software
– Difficult to review and maintain the code
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Cut & Paste Programming
■ Solutions:
– Code Mining: Find the multiple occurrences of the code segment
– Refactoring: Develop a standardized version of the code segment and replace with it
– Configuration Management: Prevent future occurrences of such code segments
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Golden Hammer
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Golden Hammer
■ To address different problems with only one solution every time
■ Forcing the one known or practiced solution to every problem instead of finding an
alternativeand more appropriatesolution
■ Using same architecture to solve diverse problems
■ Symptoms:
– Using same or identical tools to solve conceptually different problems
– Solution is changed depending on the availabletoolset
■ Consequences:
– Requirements are tailored to what the toolset does best
– Quality and performance of the solution is compromised
– Isolation from the industry
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Golden Hammer
■ Solutions:
– Select most suitable and appropriatetoolset with respect to requirements
– Explore new technologies and find best possible solutions to the problem
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
Reference
■ AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis by William J.
Brown, Raphael C. Malveau, Hays W. McCormick, Thomas J. Mowbray, John Wiley &
Sons, 1998
FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY

More Related Content

Viewers also liked

Aire Acondicionado
Aire AcondicionadoAire Acondicionado
Aire Acondicionado
eduardo navarrete
 
6-Animation in Game (Game Development - UMT Spring 2017/2018)
6-Animation in Game (Game Development - UMT Spring 2017/2018)6-Animation in Game (Game Development - UMT Spring 2017/2018)
6-Animation in Game (Game Development - UMT Spring 2017/2018)
Hafiz Ammar Siddiqui
 
Liberty university busi 330 quiz 6 solutions answers slideshare
Liberty university busi 330 quiz 6 solutions answers slideshareLiberty university busi 330 quiz 6 solutions answers slideshare
Liberty university busi 330 quiz 6 solutions answers slideshare
Liberty Liberty
 
Surds and indeces
Surds and indecesSurds and indeces
Surds and indeces
Greta Sabaliauskaite
 
Economia petrolera de venezuela
Economia petrolera de venezuelaEconomia petrolera de venezuela
Economia petrolera de venezuela
Florangel Freitez Carazut
 
Overview of Scientific Workflows - Why Use Them?
Overview of Scientific Workflows - Why Use Them?Overview of Scientific Workflows - Why Use Them?
Overview of Scientific Workflows - Why Use Them?
inside-BigData.com
 
BBFC
BBFC BBFC
Swan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
Swan Huntley -- We could be Beautiful -- Another upcoming Skype InterviewSwan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
Swan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
Marie-Hélène Fasquel
 
Башкирский язык: Появление имени "Борис"
Башкирский язык: Появление имени "Борис"Башкирский язык: Появление имени "Борис"
Башкирский язык: Появление имени "Борис"
_frokot_
 
Exxon Mobil Analysts Meeting 2017 - Presentation
Exxon Mobil Analysts Meeting 2017 - PresentationExxon Mobil Analysts Meeting 2017 - Presentation
Exxon Mobil Analysts Meeting 2017 - Presentation
OILWIRE
 
Apresentação para décimo segundo ano de 2016 7, aula 109-110
Apresentação para décimo segundo ano de 2016 7, aula 109-110Apresentação para décimo segundo ano de 2016 7, aula 109-110
Apresentação para décimo segundo ano de 2016 7, aula 109-110
luisprista
 
Apresentação para décimo segundo ano de 2016 7, aula 108-108 r
Apresentação para décimo segundo ano de 2016 7, aula 108-108 rApresentação para décimo segundo ano de 2016 7, aula 108-108 r
Apresentação para décimo segundo ano de 2016 7, aula 108-108 r
luisprista
 
Ch09lect2 ud
Ch09lect2 udCh09lect2 ud
Ch09lect2 ud
Ahmet Balkan
 

Viewers also liked (20)

Aire Acondicionado
Aire AcondicionadoAire Acondicionado
Aire Acondicionado
 
6-Animation in Game (Game Development - UMT Spring 2017/2018)
6-Animation in Game (Game Development - UMT Spring 2017/2018)6-Animation in Game (Game Development - UMT Spring 2017/2018)
6-Animation in Game (Game Development - UMT Spring 2017/2018)
 
Liberty university busi 330 quiz 6 solutions answers slideshare
Liberty university busi 330 quiz 6 solutions answers slideshareLiberty university busi 330 quiz 6 solutions answers slideshare
Liberty university busi 330 quiz 6 solutions answers slideshare
 
Surds and indeces
Surds and indecesSurds and indeces
Surds and indeces
 
Economia petrolera de venezuela
Economia petrolera de venezuelaEconomia petrolera de venezuela
Economia petrolera de venezuela
 
Overview of Scientific Workflows - Why Use Them?
Overview of Scientific Workflows - Why Use Them?Overview of Scientific Workflows - Why Use Them?
Overview of Scientific Workflows - Why Use Them?
 
BBFC
BBFC BBFC
BBFC
 
Swan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
Swan Huntley -- We could be Beautiful -- Another upcoming Skype InterviewSwan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
Swan Huntley -- We could be Beautiful -- Another upcoming Skype Interview
 
Башкирский язык: Появление имени "Борис"
Башкирский язык: Появление имени "Борис"Башкирский язык: Появление имени "Борис"
Башкирский язык: Появление имени "Борис"
 
Exxon Mobil Analysts Meeting 2017 - Presentation
Exxon Mobil Analysts Meeting 2017 - PresentationExxon Mobil Analysts Meeting 2017 - Presentation
Exxon Mobil Analysts Meeting 2017 - Presentation
 
Apresentação para décimo segundo ano de 2016 7, aula 109-110
Apresentação para décimo segundo ano de 2016 7, aula 109-110Apresentação para décimo segundo ano de 2016 7, aula 109-110
Apresentação para décimo segundo ano de 2016 7, aula 109-110
 
Apresentação para décimo segundo ano de 2016 7, aula 108-108 r
Apresentação para décimo segundo ano de 2016 7, aula 108-108 rApresentação para décimo segundo ano de 2016 7, aula 108-108 r
Apresentação para décimo segundo ano de 2016 7, aula 108-108 r
 
Ch03lect2 ud
Ch03lect2 udCh03lect2 ud
Ch03lect2 ud
 
Ch03lect1 ud
Ch03lect1 udCh03lect1 ud
Ch03lect1 ud
 
Ch05lect1 ud
Ch05lect1 udCh05lect1 ud
Ch05lect1 ud
 
Ch07lect1 ud
Ch07lect1 udCh07lect1 ud
Ch07lect1 ud
 
Ch09lect2 ud
Ch09lect2 udCh09lect2 ud
Ch09lect2 ud
 
Ch08lect2 ud
Ch08lect2 udCh08lect2 ud
Ch08lect2 ud
 
Ch08lect3 ud
Ch08lect3 udCh08lect3 ud
Ch08lect3 ud
 
Ch08lect1 ud
Ch08lect1 udCh08lect1 ud
Ch08lect1 ud
 

Similar to 3-Software Anti Design Patterns (Object Oriented Software Engineering - BNU Spring 2017)

9-Software Verification and Validation (Object Oriented Software Engineering ...
9-Software Verification and Validation (Object Oriented Software Engineering ...9-Software Verification and Validation (Object Oriented Software Engineering ...
9-Software Verification and Validation (Object Oriented Software Engineering ...
Hafiz Ammar Siddiqui
 
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
Hafiz Ammar Siddiqui
 
Computer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectivesComputer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectives
Jawad Khan
 
L03 Software Design
L03 Software DesignL03 Software Design
L03 Software Design
Ólafur Andri Ragnarsson
 
DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006
santa
 
L12 GRASP
L12 GRASPL12 GRASP
The art of architecture
The art of architectureThe art of architecture
The art of architecture
ADDQ
 
1.01.Introduction.pptx
1.01.Introduction.pptx1.01.Introduction.pptx
1.01.Introduction.pptx
Binish Raza
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
Abdalmassih Yakeen
 
Lecture-2: Web development application development process model
Lecture-2: Web development application development process modelLecture-2: Web development application development process model
Lecture-2: Web development application development process model
Mubashir Ali
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
kim.mens
 
UNIT1_Himani Sharma.pptx
UNIT1_Himani Sharma.pptxUNIT1_Himani Sharma.pptx
UNIT1_Himani Sharma.pptx
Aman287268
 
Oose unit 3 ppt
Oose unit 3 pptOose unit 3 ppt
Oose unit 3 ppt
Dr VISU P
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
Rasan Samarasinghe
 
Maintaining and Releasing Open Source Software
Maintaining and Releasing Open Source SoftwareMaintaining and Releasing Open Source Software
Maintaining and Releasing Open Source Software
Joel Nothman
 
BPM Cluster Meeting 2018
BPM Cluster Meeting 2018BPM Cluster Meeting 2018
BPM Cluster Meeting 2018
Jan Claes
 
Software process models
Software process modelsSoftware process models
Software process models
Malik WaQas
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
itadmin33
 
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
Hironori Washizaki
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
AnwarrChaudary
 

Similar to 3-Software Anti Design Patterns (Object Oriented Software Engineering - BNU Spring 2017) (20)

9-Software Verification and Validation (Object Oriented Software Engineering ...
9-Software Verification and Validation (Object Oriented Software Engineering ...9-Software Verification and Validation (Object Oriented Software Engineering ...
9-Software Verification and Validation (Object Oriented Software Engineering ...
 
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
5-Object Oriented Analysis (Object Oriented Software Engineering - BNU Spring...
 
Computer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectivesComputer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectives
 
L03 Software Design
L03 Software DesignL03 Software Design
L03 Software Design
 
DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006
 
L12 GRASP
L12 GRASPL12 GRASP
L12 GRASP
 
The art of architecture
The art of architectureThe art of architecture
The art of architecture
 
1.01.Introduction.pptx
1.01.Introduction.pptx1.01.Introduction.pptx
1.01.Introduction.pptx
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
Lecture-2: Web development application development process model
Lecture-2: Web development application development process modelLecture-2: Web development application development process model
Lecture-2: Web development application development process model
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
UNIT1_Himani Sharma.pptx
UNIT1_Himani Sharma.pptxUNIT1_Himani Sharma.pptx
UNIT1_Himani Sharma.pptx
 
Oose unit 3 ppt
Oose unit 3 pptOose unit 3 ppt
Oose unit 3 ppt
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
 
Maintaining and Releasing Open Source Software
Maintaining and Releasing Open Source SoftwareMaintaining and Releasing Open Source Software
Maintaining and Releasing Open Source Software
 
BPM Cluster Meeting 2018
BPM Cluster Meeting 2018BPM Cluster Meeting 2018
BPM Cluster Meeting 2018
 
Software process models
Software process modelsSoftware process models
Software process models
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
 
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 

More from Hafiz Ammar Siddiqui

4-Game Physics (Game Design and Development)
4-Game Physics (Game Design and Development)4-Game Physics (Game Design and Development)
4-Game Physics (Game Design and Development)
Hafiz Ammar Siddiqui
 
3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)
Hafiz Ammar Siddiqui
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
Hafiz Ammar Siddiqui
 
1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)
Hafiz Ammar Siddiqui
 
9-Game Design (Game Development - UMT Spring 2017/2018)
9-Game Design (Game Development - UMT Spring 2017/2018)9-Game Design (Game Development - UMT Spring 2017/2018)
9-Game Design (Game Development - UMT Spring 2017/2018)
Hafiz Ammar Siddiqui
 
3-Graphics in Game (Game Development - UMT Spring 2017/2018)
3-Graphics in Game (Game Development - UMT Spring 2017/2018)3-Graphics in Game (Game Development - UMT Spring 2017/2018)
3-Graphics in Game (Game Development - UMT Spring 2017/2018)
Hafiz Ammar Siddiqui
 
1-Introduction (Game Development - UMT Spring 2017/2018)
1-Introduction (Game Development - UMT Spring 2017/2018)1-Introduction (Game Development - UMT Spring 2017/2018)
1-Introduction (Game Development - UMT Spring 2017/2018)
Hafiz Ammar Siddiqui
 

More from Hafiz Ammar Siddiqui (7)

4-Game Physics (Game Design and Development)
4-Game Physics (Game Design and Development)4-Game Physics (Game Design and Development)
4-Game Physics (Game Design and Development)
 
3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
 
1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)
 
9-Game Design (Game Development - UMT Spring 2017/2018)
9-Game Design (Game Development - UMT Spring 2017/2018)9-Game Design (Game Development - UMT Spring 2017/2018)
9-Game Design (Game Development - UMT Spring 2017/2018)
 
3-Graphics in Game (Game Development - UMT Spring 2017/2018)
3-Graphics in Game (Game Development - UMT Spring 2017/2018)3-Graphics in Game (Game Development - UMT Spring 2017/2018)
3-Graphics in Game (Game Development - UMT Spring 2017/2018)
 
1-Introduction (Game Development - UMT Spring 2017/2018)
1-Introduction (Game Development - UMT Spring 2017/2018)1-Introduction (Game Development - UMT Spring 2017/2018)
1-Introduction (Game Development - UMT Spring 2017/2018)
 

Recently uploaded

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

3-Software Anti Design Patterns (Object Oriented Software Engineering - BNU Spring 2017)

  • 1. Software Design Anti Patterns FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 2. Anti Pattern ■ A pattern that tells how to go from a problem to a bad solution ■ Defines what seems like an appropriate and effective solution to a problem but has more bad consequences than good ones – How not to solve a problem – Negative solution to a problem – Bad practice and common mistakes in a solution ■ Provides an identifiabletemplate for the problem and discuss its solutions – Common vocabulary for identifying a problem and its solution – Measures that can be taken to improve the solution – Lessons learned from failures and their remedies FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 3. Blob FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 4. Blob ■ One class does most of the processing, and other classes only encapsulate data ■ Procedural design, where one class contains the majority of the process and other classes contain the data ■ Majority of the responsibilities are allocated to a single class known as blob class ■ Symptoms: – Single class in a system that knows too much or does too much – One class with a large number of attributes, behaviors, or both – One big class doing all the tasks while other classes only hold data ■ Consequences: – Modification becomes difficult and expensive, modifying blob class affect others – Blob class is complex to reuse or test – Blob class may use excessive resources for simple operations FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 5. Blob ■ Solutions: – Increase cohesion in all the classes specially in blob class – Migrate behaviors from blob class to their related data classes – Identify related attributes and behaviors in blob class and move them to a new class FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 6. Functional Decomposition FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 7. Functional Decomposition ■ A real world action is turned into a class instead of a real world object ■ An approach that turns a subroutine into a class ■ No object oriented principles such as inheritance and polymorphism ■ Symptoms: – Class with a functional name (named on a function instead of an object) – Class with only a single behavior ■ Consequences: – Hard to reuse and modify – Documentation becomes difficult – Lack of object oriented design FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 8. Functional Decomposition ■ Solutions: – Merge the class which contains a single behavior to an existing class in the system where its related data resides – If a class does not contain any state information, convert that class into a behavior and insert that behavior into an appropriate existing class in the system – Create new classes that satisfies the object oriented design and merge existing incompatible classes into them FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 9. Poltergeist FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 10. Poltergeist ■ Class with limited and redundant responsibilities and short life cycle ■ Stateless class that creates unnecessary abstraction and complexity ■ Temporary class that adds an extra redundant step in navigation path ■ Symptoms: – Class with single operations that only invoke other classes – Class with short duration objects that only begin operations and do nothing else ■ Consequences: – System becomes redundant and complex – Wastage of resources – Clutters the object oriented design FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 11. Poltergeist ■ Solutions: – Remove the stateless redundant class from the hierarchy and move its functionality to the related classes – Simplify the system by removing all the classes with transient associations and make direct associations among related classes FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 12. Cut & Paste Programming FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 13. Cut & Paste Programming ■ Use existing code which is proven to work in similar situations with modification ■ Duplicate and extend already written code ■ Similar segments of code present throughout the project ■ Symptoms: – Instead of writing code from scratch, use pre-written or partial code already availableand extend it further – Use an existing solution as a basis to define a new solution ■ Consequences: – Code can be reused with minimum effort – Same bugs reoccur throughout the software – Difficult to review and maintain the code FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 14. Cut & Paste Programming ■ Solutions: – Code Mining: Find the multiple occurrences of the code segment – Refactoring: Develop a standardized version of the code segment and replace with it – Configuration Management: Prevent future occurrences of such code segments FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 15. Golden Hammer FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 16. Golden Hammer ■ To address different problems with only one solution every time ■ Forcing the one known or practiced solution to every problem instead of finding an alternativeand more appropriatesolution ■ Using same architecture to solve diverse problems ■ Symptoms: – Using same or identical tools to solve conceptually different problems – Solution is changed depending on the availabletoolset ■ Consequences: – Requirements are tailored to what the toolset does best – Quality and performance of the solution is compromised – Isolation from the industry FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 17. Golden Hammer ■ Solutions: – Select most suitable and appropriatetoolset with respect to requirements – Explore new technologies and find best possible solutions to the problem FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY
  • 18. Reference ■ AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis by William J. Brown, Raphael C. Malveau, Hays W. McCormick, Thomas J. Mowbray, John Wiley & Sons, 1998 FROM: HAFIZ AMMAR SIDDIQUI – COURSE: OBJECT ORIENTED SOFTWARE ENGINEERING – INSTITUTE: BEACONHOUSE NATIONAL UNIVERSITY