SlideShare a Scribd company logo
Integrative Coding:
Design Patterns;
Interfaces;
Inheritance.
Miscellaneous Issues:
Adopt andAdapt vs. make;
Versioning and version control
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 1
 Design pattern:
 A Lower level framework for structuring an application than architectures (Sometimes,
called micro-architecture).
 Reusable collaborations that solve sub problems within an application.
 Why Design Patterns?
 Design patterns support object-oriented reuse at a high level of abstraction
 Design patterns provide a “framework” that guides and constrains object-oriented
implementation
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 2
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 3
 The Gang of Four (GoF) Design Patterns book describes twenty-three
patterns arranged into three groups.
 The groups help classify how the patterns are used.
1. Creational patterns : used to help make a system independent of how its
objects are created, composed and represented.
2. Structural patterns are concerned with how classes and objects are
organized and composed to build larger structures.
3. Behavioral patterns are used to deal with assignment of responsibilities
to objects and communication between objects.
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 4
Creational Patterns
 Abstract Factory - create instances of other objects
Eg:-creatingGUI components for different GUI toolkits
 Factory Method -common interface for creating subclasses
 Singleton -create only one instance of a class
Structural Patterns
 Decorator - add more responsibilities to an object dynamically
Eg:- adding scrolling to a text view
 Facade- higher level unified interface to a set of objects in a subsystem
 Proxy- interface layer between objects
Behavioral Patterns
 Iterator- a means to access all the elements of objects sequentially
 Momento- capture and save the current state of an object
 Observer- when any numbers of objects (the Observers) need to be
notified automatically
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 5
Application Programming Interfaces
 Are sets of requirements that govern how one application can talk to
another
 applications to share data and take actions on one another's behalf
without requiring developers to share all of their software's code
 define exactly how a program will interact with the rest of the software
world—saving time, resources
 Eg:- System-levelAPIs- cut and paste LibreOffice document into an
Excel spreadsheet
 Eg:-FacebookAPIs- Facebook users sign into many apps andWeb sites
using their Facebook ID
 Eg:-WebAPIs – games let players chat, post high scores and invite
friends to play via Face book, right there in the middle of a game
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 6
Inheritance
 derive a new class based on an existing class, with modifications or
extensions
 A subclass inherits all the variables and methods from its super classes,
including its immediate parent as well as all the ancestors
 avoid duplication and reduce redundancy
Types of Inheritance
 Simple , Multilevel, Multiple, hierarchical and Hybrid
Inheritance and Abstract class
 Abstract Method:- a method with only signature (i.e., the method name,
the list of arguments and the return type) without implementation (i.e.,
the method’s body).
 use the keyword abstract to declare an abstract method
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 7
Abstract Class
 A class containing one or more abstract methods is called an abstract
class.
 must be declared with a class-modifier abstract
 provides a template for further development
Notes:
 An abstract method cannot be declared final, as final method cannot be
overridden.
 An abstract method must be overridden in a descendent before it can
be used.
 An abstract method cannot be private (which generates a compilation
error, because private method is not visible to the subclass and thus
cannot be overridden.
In Java, define a subclass using the keyword "extends", e.g.,
class MyApplet extends java.applet.Applet {.....}
class Cylinder extends Circle {......}
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 8
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 9
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 10
 Shape.java
abstract public class Shape
{
private String color; // Private member variable
public Shape (String color) // Constructor
{ this.color = color;
}
public String toString()
{
return "Shape of color="" + color + """;
}
// All Shape subclasses must implement a method called getArea()
abstract public double getArea();
}
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 11
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 12
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 13
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 14
 Version control enables multiple people to simultaneously work on a
single project.
 Each person edits his or her own copy of the files and chooses when to
share those changes with the rest of the team.
 temporary or partial edits by one person do not interfere with another
person's work.
 enables one person to use multiple computers to work on a project
 integrates work done simultaneously by different team members
 In rare cases, when two people make conflicting edits to the same line of
a file, then the version control system requests human assistance in
deciding what to do
 Version control gives access to historical versions of the project
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 15
 If make a mistake, roll back to a previous version. reproduce and
understand a bug report on a past version of your software.
 undo specific edits without losing all the work that was done in the
meanwhile.
 For any part of a file, determine when, why, and by whom it was ever
edited.
 Version control uses a repository (a database of changes) and a working
copy (checkout) where you do your work
 working copy is your personal copy of all the files in the project.
edits to this copy, without affecting your teammates. commit your
changes to a repository
 repository is database of all the edits to, and/or historical versions
(snapshots) of, your project
update your working copy to incorporate any new edits or versions
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 16
 Two varieties of version control: centralized (one repository) and
distributed (multiple repositories)
 Some popular version control systems are Mercurial (distributed), Git
(distributed), and Subversion (centralized).
 The main difference between centralized and distributed version control
is the number of repositories.
 In centralized version control, there is just one repository, and in
distributed version control, there are multiple repositories.
8/12/2015
Presented by Dr. J.VijiPriya,Assistant Professor,
Hawassa University, Ethiopia 17

More Related Content

Similar to Integrative Programming chapter 5

The quality & richness of E-Education
The quality & richness of E-EducationThe quality & richness of E-Education
The quality & richness of E-Education
Suraj Mehta
 
1. (slide share)glue-integrationofexternaltools
1. (slide share)glue-integrationofexternaltools1. (slide share)glue-integrationofexternaltools
1. (slide share)glue-integrationofexternaltools
CARLOS ALARIO
 
Managing Citations: What's Actually Helpful? 2013-10
Managing Citations: What's Actually Helpful? 2013-10Managing Citations: What's Actually Helpful? 2013-10
Managing Citations: What's Actually Helpful? 2013-10
Institute for Research on Teaching & Learning
 
MK_MSc_Degree_Project_Report ver 5_updated
MK_MSc_Degree_Project_Report ver 5_updatedMK_MSc_Degree_Project_Report ver 5_updated
MK_MSc_Degree_Project_Report ver 5_updated
Mohammed Ali Khan
 
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docxSimulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
edgar6wallace88877
 
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
VijiPriya Jeyamani
 
VIVO at the University of Idaho
VIVO at the University of IdahoVIVO at the University of Idaho
VIVO at the University of Idaho
anniegaines
 
Free and Open Source for Education
Free and Open Source for EducationFree and Open Source for Education
Free and Open Source for Education
Savitri Wilder
 
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
Julie Meloni
 
Bhagat Myexperiment Bosc2008
Bhagat Myexperiment Bosc2008Bhagat Myexperiment Bosc2008
Bhagat Myexperiment Bosc2008
bosc_2008
 
Better Software, Better Research
Better Software, Better ResearchBetter Software, Better Research
Better Software, Better Research
Carole Goble
 
Scalable architectures for phenotype libraries
Scalable architectures for phenotype librariesScalable architectures for phenotype libraries
Scalable architectures for phenotype libraries
Martin Chapman
 
ImageJ and the SciJava software stack
ImageJ and the SciJava software stackImageJ and the SciJava software stack
ImageJ and the SciJava software stack
Curtis Rueden
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
 
Reproducibility: 10 Simple Rules
Reproducibility: 10 Simple RulesReproducibility: 10 Simple Rules
Reproducibility: 10 Simple Rules
Annika Eriksson
 
Jonathan bright - collecting social media data with the python programming la...
Jonathan bright - collecting social media data with the python programming la...Jonathan bright - collecting social media data with the python programming la...
Jonathan bright - collecting social media data with the python programming la...
oiisdp
 
Object Oriented Approach For Software Development
Object Oriented Approach For Software DevelopmentObject Oriented Approach For Software Development
Object Oriented Approach For Software Development
Jessica Tanner
 
Framework for Agile Living Labs - FALL
Framework for Agile Living Labs - FALLFramework for Agile Living Labs - FALL
Framework for Agile Living Labs - FALL
European Network of Living Labs (ENoLL)
 
UCIAD overview
UCIAD overviewUCIAD overview
UCIAD overview
Mathieu d'Aquin
 
SIGAda Hibachi Workshop Presentation
SIGAda Hibachi Workshop PresentationSIGAda Hibachi Workshop Presentation
SIGAda Hibachi Workshop Presentation
Gneuromante canalada.org
 

Similar to Integrative Programming chapter 5 (20)

The quality & richness of E-Education
The quality & richness of E-EducationThe quality & richness of E-Education
The quality & richness of E-Education
 
1. (slide share)glue-integrationofexternaltools
1. (slide share)glue-integrationofexternaltools1. (slide share)glue-integrationofexternaltools
1. (slide share)glue-integrationofexternaltools
 
Managing Citations: What's Actually Helpful? 2013-10
Managing Citations: What's Actually Helpful? 2013-10Managing Citations: What's Actually Helpful? 2013-10
Managing Citations: What's Actually Helpful? 2013-10
 
MK_MSc_Degree_Project_Report ver 5_updated
MK_MSc_Degree_Project_Report ver 5_updatedMK_MSc_Degree_Project_Report ver 5_updated
MK_MSc_Degree_Project_Report ver 5_updated
 
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docxSimulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
Simulation Modelling Practice and Theory 47 (2014) 28–45Cont.docx
 
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
Human Computer Interaction Chapter 4 Implementation Support and Evaluation Te...
 
VIVO at the University of Idaho
VIVO at the University of IdahoVIVO at the University of Idaho
VIVO at the University of Idaho
 
Free and Open Source for Education
Free and Open Source for EducationFree and Open Source for Education
Free and Open Source for Education
 
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
Developing and Deploying Open Source in the Library: Hydra, Blacklight, and B...
 
Bhagat Myexperiment Bosc2008
Bhagat Myexperiment Bosc2008Bhagat Myexperiment Bosc2008
Bhagat Myexperiment Bosc2008
 
Better Software, Better Research
Better Software, Better ResearchBetter Software, Better Research
Better Software, Better Research
 
Scalable architectures for phenotype libraries
Scalable architectures for phenotype librariesScalable architectures for phenotype libraries
Scalable architectures for phenotype libraries
 
ImageJ and the SciJava software stack
ImageJ and the SciJava software stackImageJ and the SciJava software stack
ImageJ and the SciJava software stack
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Reproducibility: 10 Simple Rules
Reproducibility: 10 Simple RulesReproducibility: 10 Simple Rules
Reproducibility: 10 Simple Rules
 
Jonathan bright - collecting social media data with the python programming la...
Jonathan bright - collecting social media data with the python programming la...Jonathan bright - collecting social media data with the python programming la...
Jonathan bright - collecting social media data with the python programming la...
 
Object Oriented Approach For Software Development
Object Oriented Approach For Software DevelopmentObject Oriented Approach For Software Development
Object Oriented Approach For Software Development
 
Framework for Agile Living Labs - FALL
Framework for Agile Living Labs - FALLFramework for Agile Living Labs - FALL
Framework for Agile Living Labs - FALL
 
UCIAD overview
UCIAD overviewUCIAD overview
UCIAD overview
 
SIGAda Hibachi Workshop Presentation
SIGAda Hibachi Workshop PresentationSIGAda Hibachi Workshop Presentation
SIGAda Hibachi Workshop Presentation
 

Recently uploaded

Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 

Recently uploaded (20)

Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 

Integrative Programming chapter 5

  • 1. Integrative Coding: Design Patterns; Interfaces; Inheritance. Miscellaneous Issues: Adopt andAdapt vs. make; Versioning and version control 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 1
  • 2.  Design pattern:  A Lower level framework for structuring an application than architectures (Sometimes, called micro-architecture).  Reusable collaborations that solve sub problems within an application.  Why Design Patterns?  Design patterns support object-oriented reuse at a high level of abstraction  Design patterns provide a “framework” that guides and constrains object-oriented implementation 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 2
  • 3. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 3
  • 4.  The Gang of Four (GoF) Design Patterns book describes twenty-three patterns arranged into three groups.  The groups help classify how the patterns are used. 1. Creational patterns : used to help make a system independent of how its objects are created, composed and represented. 2. Structural patterns are concerned with how classes and objects are organized and composed to build larger structures. 3. Behavioral patterns are used to deal with assignment of responsibilities to objects and communication between objects. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 4
  • 5. Creational Patterns  Abstract Factory - create instances of other objects Eg:-creatingGUI components for different GUI toolkits  Factory Method -common interface for creating subclasses  Singleton -create only one instance of a class Structural Patterns  Decorator - add more responsibilities to an object dynamically Eg:- adding scrolling to a text view  Facade- higher level unified interface to a set of objects in a subsystem  Proxy- interface layer between objects Behavioral Patterns  Iterator- a means to access all the elements of objects sequentially  Momento- capture and save the current state of an object  Observer- when any numbers of objects (the Observers) need to be notified automatically 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 5
  • 6. Application Programming Interfaces  Are sets of requirements that govern how one application can talk to another  applications to share data and take actions on one another's behalf without requiring developers to share all of their software's code  define exactly how a program will interact with the rest of the software world—saving time, resources  Eg:- System-levelAPIs- cut and paste LibreOffice document into an Excel spreadsheet  Eg:-FacebookAPIs- Facebook users sign into many apps andWeb sites using their Facebook ID  Eg:-WebAPIs – games let players chat, post high scores and invite friends to play via Face book, right there in the middle of a game 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 6
  • 7. Inheritance  derive a new class based on an existing class, with modifications or extensions  A subclass inherits all the variables and methods from its super classes, including its immediate parent as well as all the ancestors  avoid duplication and reduce redundancy Types of Inheritance  Simple , Multilevel, Multiple, hierarchical and Hybrid Inheritance and Abstract class  Abstract Method:- a method with only signature (i.e., the method name, the list of arguments and the return type) without implementation (i.e., the method’s body).  use the keyword abstract to declare an abstract method 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 7
  • 8. Abstract Class  A class containing one or more abstract methods is called an abstract class.  must be declared with a class-modifier abstract  provides a template for further development Notes:  An abstract method cannot be declared final, as final method cannot be overridden.  An abstract method must be overridden in a descendent before it can be used.  An abstract method cannot be private (which generates a compilation error, because private method is not visible to the subclass and thus cannot be overridden. In Java, define a subclass using the keyword "extends", e.g., class MyApplet extends java.applet.Applet {.....} class Cylinder extends Circle {......} 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 8
  • 9. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 9
  • 10. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 10
  • 11.  Shape.java abstract public class Shape { private String color; // Private member variable public Shape (String color) // Constructor { this.color = color; } public String toString() { return "Shape of color="" + color + """; } // All Shape subclasses must implement a method called getArea() abstract public double getArea(); } 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 11
  • 12. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 12
  • 13. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 13
  • 14. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 14
  • 15.  Version control enables multiple people to simultaneously work on a single project.  Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team.  temporary or partial edits by one person do not interfere with another person's work.  enables one person to use multiple computers to work on a project  integrates work done simultaneously by different team members  In rare cases, when two people make conflicting edits to the same line of a file, then the version control system requests human assistance in deciding what to do  Version control gives access to historical versions of the project 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 15
  • 16.  If make a mistake, roll back to a previous version. reproduce and understand a bug report on a past version of your software.  undo specific edits without losing all the work that was done in the meanwhile.  For any part of a file, determine when, why, and by whom it was ever edited.  Version control uses a repository (a database of changes) and a working copy (checkout) where you do your work  working copy is your personal copy of all the files in the project. edits to this copy, without affecting your teammates. commit your changes to a repository  repository is database of all the edits to, and/or historical versions (snapshots) of, your project update your working copy to incorporate any new edits or versions 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 16
  • 17.  Two varieties of version control: centralized (one repository) and distributed (multiple repositories)  Some popular version control systems are Mercurial (distributed), Git (distributed), and Subversion (centralized).  The main difference between centralized and distributed version control is the number of repositories.  In centralized version control, there is just one repository, and in distributed version control, there are multiple repositories. 8/12/2015 Presented by Dr. J.VijiPriya,Assistant Professor, Hawassa University, Ethiopia 17