SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
OBJECT-ORIENTED PROGRAMMING
GIUSEPPE MASETTI
ESCI 872 – APPLIED TOOLS FOR OCEAN MAPPING – INTRODUCTION TO OCEAN DATA SCIENCE
Durham, NH – August 29, 2019
V1
Definition
Instantiation
External
Access
MODULE
GOAL:
Add more
methods
to classes
WHY OBJECT-ORIENTED PROGRAMMING?
• Powerful approach to organize your code
• An object contains both:
• Data → Class variables
• Behavior → Methods (Class functions)
• Helps on creating reusable code → Don’t Repeat Yourself (DRY)
• An object keeps internal a lot of details → Encapsulation
• Many other good reasons
• AbstracƟon → Helps building complex systems by spliƫng their complexity
• Inheritance → A class may inherit data/behavior from other classes + extend them
• Polymorphism → The same method may behave differently on different classes
• …
CLASS VS OBJECT
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
2.+ __init__()
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
2.+ __init__()
3.+ INITIALIZATION PARAMETER
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
2.+ __init__()
3.+ INITIALIZATION PARAMETER
4.+ ERROR CHECK
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
2.+ __init__()
3.+ INITIALIZATION PARAMETER
4.+ ERROR CHECK
5.+ __str__()
MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS
1. MINIMAL DEFINITION
2.+ __init__()
3.+ INITIALIZATION PARAMETER
4.+ ERROR CHECK
5.+ __str__()
6.+ read()
A DIFFERENT CODING APPROACH
PROGRAMMING BASIC
WITH PYTHON
INTRODUCTION TO
OCEAN DATA SCIENCE
Definition
Instantiation
Instantiation
Definition ???
YOU WILL CREATE YOUR OWN PYTHON MODULE!
YOU WILL CREATE YOUR OWN PYTHON MODULE!
mycode
YOU WILL CREATE YOUR OWN PYTHON MODULE!
mycode
YOU WILL CREATE YOUR OWN PYTHON MODULE!
mycode
GO TO “FIRST STEPS OF A CLASS” NOTEBOOK
QUESTIONS?
Contact me at: gmasetti@ccom.unh.edu

Contenu connexe

Similaire à ePOM - Intro to Ocean Data Science - Object-Oriented Programming

Similaire à ePOM - Intro to Ocean Data Science - Object-Oriented Programming (20)

Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
Presentation1
Presentation1Presentation1
Presentation1
 
Coding Objects
Coding ObjectsCoding Objects
Coding Objects
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
 
Object-Oriented Design Heuristics
Object-Oriented Design HeuristicsObject-Oriented Design Heuristics
Object-Oriented Design Heuristics
 
Ruby Object Design
Ruby Object DesignRuby Object Design
Ruby Object Design
 
Ruby Object Design
Ruby Object DesignRuby Object Design
Ruby Object Design
 
Objected-Oriented Programming with Java
Objected-Oriented Programming with JavaObjected-Oriented Programming with Java
Objected-Oriented Programming with Java
 
Java sessionnotes
Java sessionnotesJava sessionnotes
Java sessionnotes
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
 
Guiding Principles for Module Design
Guiding Principles for Module DesignGuiding Principles for Module Design
Guiding Principles for Module Design
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Softwear presentation
Softwear presentationSoftwear presentation
Softwear presentation
 
OOps Interview questions.pdf
OOps Interview questions.pdfOOps Interview questions.pdf
OOps Interview questions.pdf
 
12th ip CBSE chapter 4 oop in java notes complete
12th ip CBSE  chapter 4 oop in java notes complete12th ip CBSE  chapter 4 oop in java notes complete
12th ip CBSE chapter 4 oop in java notes complete
 
C#
C#C#
C#
 
OOPS Characteristics
OOPS CharacteristicsOOPS Characteristics
OOPS Characteristics
 

Plus de Giuseppe Masetti

Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...
Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...
Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...Giuseppe Masetti
 
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...Giuseppe Masetti
 
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...Giuseppe Masetti
 
ePOM - Fundamentals of Research Software Development - Code Version Control
ePOM - Fundamentals of Research Software Development - Code Version ControlePOM - Fundamentals of Research Software Development - Code Version Control
ePOM - Fundamentals of Research Software Development - Code Version ControlGiuseppe Masetti
 
ePOM - Fundamentals of Research Software Development - Integrated Development...
ePOM - Fundamentals of Research Software Development - Integrated Development...ePOM - Fundamentals of Research Software Development - Integrated Development...
ePOM - Fundamentals of Research Software Development - Integrated Development...Giuseppe Masetti
 
ePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - IntroductionePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - IntroductionGiuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data FormatsePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data FormatsGiuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific ComputingePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific ComputingGiuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data VisualizationePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data VisualizationGiuseppe Masetti
 
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3Giuseppe Masetti
 
AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1Giuseppe Masetti
 
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...Giuseppe Masetti
 
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...Giuseppe Masetti
 
Pydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean MappersPydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean MappersGiuseppe Masetti
 
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...Giuseppe Masetti
 
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...
Backscatter Working Group Software Inter-comparison Project Requesting and Co...Giuseppe Masetti
 
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...Giuseppe Masetti
 
Bathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) formatBathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) formatGiuseppe Masetti
 
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...Giuseppe Masetti
 
HydrOffice: past, present, and future.
HydrOffice: past, present, and future.HydrOffice: past, present, and future.
HydrOffice: past, present, and future.Giuseppe Masetti
 

Plus de Giuseppe Masetti (20)

Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...
Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...
Open Backscatter Toolchain (OpenBST) Project - A Community-vetted Workflow fo...
 
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
 
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
 
ePOM - Fundamentals of Research Software Development - Code Version Control
ePOM - Fundamentals of Research Software Development - Code Version ControlePOM - Fundamentals of Research Software Development - Code Version Control
ePOM - Fundamentals of Research Software Development - Code Version Control
 
ePOM - Fundamentals of Research Software Development - Integrated Development...
ePOM - Fundamentals of Research Software Development - Integrated Development...ePOM - Fundamentals of Research Software Development - Integrated Development...
ePOM - Fundamentals of Research Software Development - Integrated Development...
 
ePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - IntroductionePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - Introduction
 
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data FormatsePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
 
ePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific ComputingePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific Computing
 
ePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data VisualizationePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data Visualization
 
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
 
AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1
 
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
 
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
 
Pydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean MappersPydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean Mappers
 
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
 
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
 
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
 
Bathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) formatBathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) format
 
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
 
HydrOffice: past, present, and future.
HydrOffice: past, present, and future.HydrOffice: past, present, and future.
HydrOffice: past, present, and future.
 

Dernier

Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Lokesh Kothari
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)Areesha Ahmad
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...Sérgio Sacani
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.Nitya salvi
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfSumit Kumar yadav
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptxAlMamun560346
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...ssuser79fe74
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLkantirani197
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Green chemistry and Sustainable development.pptx
Green chemistry  and Sustainable development.pptxGreen chemistry  and Sustainable development.pptx
Green chemistry and Sustainable development.pptxRajatChauhan518211
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoSérgio Sacani
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfSumit Kumar yadav
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)Areesha Ahmad
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)Areesha Ahmad
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxRizalinePalanog2
 

Dernier (20)

CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Green chemistry and Sustainable development.pptx
Green chemistry  and Sustainable development.pptxGreen chemistry  and Sustainable development.pptx
Green chemistry and Sustainable development.pptx
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdf
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 

ePOM - Intro to Ocean Data Science - Object-Oriented Programming

  • 1. OBJECT-ORIENTED PROGRAMMING GIUSEPPE MASETTI ESCI 872 – APPLIED TOOLS FOR OCEAN MAPPING – INTRODUCTION TO OCEAN DATA SCIENCE Durham, NH – August 29, 2019 V1
  • 2.
  • 5. WHY OBJECT-ORIENTED PROGRAMMING? • Powerful approach to organize your code • An object contains both: • Data → Class variables • Behavior → Methods (Class functions) • Helps on creating reusable code → Don’t Repeat Yourself (DRY) • An object keeps internal a lot of details → Encapsulation • Many other good reasons • AbstracƟon → Helps building complex systems by spliƫng their complexity • Inheritance → A class may inherit data/behavior from other classes + extend them • Polymorphism → The same method may behave differently on different classes • …
  • 7. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION
  • 8. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION 2.+ __init__()
  • 9. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION 2.+ __init__() 3.+ INITIALIZATION PARAMETER
  • 10. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION 2.+ __init__() 3.+ INITIALIZATION PARAMETER 4.+ ERROR CHECK
  • 11. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION 2.+ __init__() 3.+ INITIALIZATION PARAMETER 4.+ ERROR CHECK 5.+ __str__()
  • 12. MODULE TASK → AN EXAMPLE CLASS IN SIX STEPS 1. MINIMAL DEFINITION 2.+ __init__() 3.+ INITIALIZATION PARAMETER 4.+ ERROR CHECK 5.+ __str__() 6.+ read()
  • 13. A DIFFERENT CODING APPROACH PROGRAMMING BASIC WITH PYTHON INTRODUCTION TO OCEAN DATA SCIENCE Definition Instantiation Instantiation Definition ???
  • 14. YOU WILL CREATE YOUR OWN PYTHON MODULE!
  • 15. YOU WILL CREATE YOUR OWN PYTHON MODULE! mycode
  • 16. YOU WILL CREATE YOUR OWN PYTHON MODULE! mycode
  • 17. YOU WILL CREATE YOUR OWN PYTHON MODULE! mycode
  • 18. GO TO “FIRST STEPS OF A CLASS” NOTEBOOK
  • 19. QUESTIONS? Contact me at: gmasetti@ccom.unh.edu