SlideShare a Scribd company logo
1 of 37
Download to read offline
Data- och informationsvetenskap:
Objektorienterad programmering och
modellering för IA
DA361A 7,5hp LP1
Lärare i kursen
Anton Tibblin
anton.tibblin@mau.se
Aleksander Fabijan
aleksander.fabijan@mau.se
Närvaro!
Förväntningar på kursen?
Hur går ni till väga idag?
När ni jobbar med era projekt?
Kursplanen
Kursens syfte
Kursens syfte är att studenten ska utveckla
kunskaper och färdigheter inom objektorienterad
programutveckling och -design. Därigenom ska
studenten även vidareutveckla sina
programmeringsförmågor.
Innehåll
• Från strukturerad till objektorienterad programmering
• Design och analys med principer för objektorientering
• Objektorientering i det aktuella programspråket (Python)
• Unified Modeling Language (UML)
Innehåll
• Objektorienterad systemanalys och design (OOSAD)
• Objektorienterad programmering (OOP)
Objektorienterad systemanalys och design
“Object-oriented analysis and design (OOAD)
is a popular technical approach for analyzing,
designing an application, system, or business
by applying the object-oriented paradigm and
visual modeling throughout the development
life cycles to foster better stakeholder
communication and product quality.”
Objektorienterad programmering
“Object-oriented programming (OOP) is a
programming paradigm based on the concept
of objects, which are data structures that
contain data, in the form of fields, often
known as attributes; and code, in the form of
procedures, often known as methods.”
Kursmaterial
• Canvas- inlämningar, resultat, meddelande
• https://mau.instructure.com/
• Mah Webb - all annan information
• http://da361a.ia-mau.se/
• Kursplan
• http://edu.mah.se/sv/Course/DA361A?v=1#Syllabus
Kurslitteratur
• Think Python (O’Reilly)
• ISBN: 1491939362
• Finns gratis här: http://greenteapress.com/wp/think-python-2e/
• Object-Oriented Systems Analysis and Design Using UML
(2010)
• ISBN: 9780077125363
• Problem Solving with Algorithms and Data Structures Using
Python
• ISBN: 9781590282571
• http://pythonbooks.revolunet.com/
Schema
Vecka Moment
36 Kursintroduktion + Föreläsning + Labb
37 Föreläsning*2 + Labb
38 Föreläsning + Labb
39 Föreläsning + Labb
40 Föreläsning + Labb
41 Workshop + Labb
42 Mer information kommer…
43 Extra föreläsning + labb
44 Extra labb
45 Tenta + extra labb
Bedömningsformer
• 2st Inlämningsuppgifter, 3.5 hp, U-G
• Tentamen, 4 hp, U-VG
Extra poäng till tentamen
• För varje laboration som man aktivt deltar i, kan man
tillgodoräkna sig 0.5p till ordinarie tentamen
• Om man deltar aktivt i alla laborationer får man totalt 3p
som man kan tillgodoräkna sig på ordinarie tentamen
Läshänvisningar
• Think Python
• kap. 2-3 + 10-11 (repetition)
• kap. 15-18 (OOP)
da361a.ia-mau.se
Frågor?
OOP Intro to Course
Aleksander Fabijan
Background
• In previous courses we learned about variables. For example,
if you want to describe this course with a few variables in
Python you could say:
city_of_course = "Malmö"
number_of_teachers = 2
teacher1 = {
"name": "Aleksander",
"age": 28,
"hasPhD": "Yes"
}
teacher2 = {
"name": "Anton",
"age": 28,
"hasPhD": "No"
}
print(teacher1)
print(teacher2)
print(city_of_course)
print(number_of_teachers)
• Now imagine we would want to describe another course
like this…
• Another program…
• Another university…
• …
Exercise 1
• Describe a friend of yours in Python code. Use any
knowledge of python that you have previously obtained!
• Now describe another friend of yours following the same pattern.
• Do you see how much the code is starting to repeat itself?
One Solution
# One way to describe a friend
friend1 = "My first friend is Helena. She is a female and she is 30 years old."
friend2 = "My second friend is Anton. He is a male. He is nearly 29 years old."
Imagine I ask you to extract the age from the two variables. How would you do that?
…
…
…
^s*(w+)s*(s*(d+)D+(d+)D+)s*$...
Another Solution
Imagine I ask you to extract the age from the two variables. How would you do that?
friend1 = {
"name": "Helena",
"age": 30
}
friend2 = {
"name": "Anton",
"age": 28
}
print(friend2['age'])
Challenge to go down this path…
• Code would start to repeat itself a lot,
• We would have to remember the names of so many
variables!
• Understanding our program by others would be hard!
• Giving one extra attribute would require a lot of work!
Better: Object Oriented Programming
• One way to describe objects from real life in
programming is to code them as objects!
FRIEND
first_friend = Friend("Helena", "female", True)
second_friend = Friend("Anton", "male", False)
+
Blueprint = Class Objects = Instances from blueprint
class Friend(object):
'''This is a blueprint for a Friend'''
def __init__(self, friend_name, friend_gender, friend_phd):
'''This method is called when a new friend needs to be created'''
self.name = friend_name
self.gender = friend_gender
self.phd = friend_phd
def __str__(self):
'''This method is called when someone prints the friend'''
return "This is {n} and their gender is {g}.".format(n=self.name, g=self.gender)

More Related Content

Similar to HT18 - DA361A - Kursintroduktion

Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Fariz Darari
 
Unsupervised Deep Learning in NLP
Unsupervised Deep Learning in NLP Unsupervised Deep Learning in NLP
Unsupervised Deep Learning in NLP hadifar
 
Brain Storming techniques in Python
Brain Storming techniques in PythonBrain Storming techniques in Python
Brain Storming techniques in PythonNeeru Mittal
 
DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013DataMind-slides
 
Course Break - C Language
Course Break - C LanguageCourse Break - C Language
Course Break - C Languageanilmanu2001
 
Course Breakup - C Porgramming Language
Course Breakup - C Porgramming LanguageCourse Breakup - C Porgramming Language
Course Breakup - C Porgramming Languageanilmanu2001
 
Student copybca sem1-c
Student copybca sem1-cStudent copybca sem1-c
Student copybca sem1-canilmanu2001
 
Chapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptChapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptnaveenkumarkiot12
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsRuth Marvin
 
Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Michael Scovetta
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourOsama Ghandour Geris
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisHarry Potter
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisLuis Goldster
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisYoung Alista
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisHoang Nguyen
 

Similar to HT18 - DA361A - Kursintroduktion (20)

Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Unsupervised Deep Learning in NLP
Unsupervised Deep Learning in NLP Unsupervised Deep Learning in NLP
Unsupervised Deep Learning in NLP
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
Brain Storming techniques in Python
Brain Storming techniques in PythonBrain Storming techniques in Python
Brain Storming techniques in Python
 
DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013
 
Course Break - C Language
Course Break - C LanguageCourse Break - C Language
Course Break - C Language
 
Course Breakup - C Porgramming Language
Course Breakup - C Porgramming LanguageCourse Breakup - C Porgramming Language
Course Breakup - C Porgramming Language
 
Student copybca sem1-c
Student copybca sem1-cStudent copybca sem1-c
Student copybca sem1-c
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Chapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptChapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.ppt
 
Chapter12.ppt
Chapter12.pptChapter12.ppt
Chapter12.ppt
 
ICME-12 presentation
ICME-12 presentationICME-12 presentation
ICME-12 presentation
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
 
Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandour
 
Python week 1 2020-2021
Python week 1 2020-2021Python week 1 2020-2021
Python week 1 2020-2021
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 

More from Anton Tibblin

2024 - Localstorage & cookies Geolocation Mediahantering.pdf
2024 - Localstorage & cookies Geolocation Mediahantering.pdf2024 - Localstorage & cookies Geolocation Mediahantering.pdf
2024 - Localstorage & cookies Geolocation Mediahantering.pdfAnton Tibblin
 
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbtekniker
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbteknikerVT24 - jQuery & Ajax - Flerplattformsapplikationer med webbtekniker
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbteknikerAnton Tibblin
 
VT24 - Responsiv design & Ramverk inom webbutveckling
VT24 - Responsiv design & Ramverk inom webbutvecklingVT24 - Responsiv design & Ramverk inom webbutveckling
VT24 - Responsiv design & Ramverk inom webbutvecklingAnton Tibblin
 
DA395A - VT24 - JavaScript & Document object model
DA395A - VT24 - JavaScript & Document object modelDA395A - VT24 - JavaScript & Document object model
DA395A - VT24 - JavaScript & Document object modelAnton Tibblin
 
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbtekniker
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbteknikerVT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbtekniker
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbteknikerAnton Tibblin
 
HT23 - DA354A - Webbprogrammering med Python
HT23 - DA354A - Webbprogrammering med PythonHT23 - DA354A - Webbprogrammering med Python
HT23 - DA354A - Webbprogrammering med PythonAnton Tibblin
 
HT23 - DA354A - Fil- och felhantering
HT23 - DA354A - Fil- och felhanteringHT23 - DA354A - Fil- och felhantering
HT23 - DA354A - Fil- och felhanteringAnton Tibblin
 
HT23 - DA354A - Listor och lexikon
HT23 - DA354A - Listor och lexikonHT23 - DA354A - Listor och lexikon
HT23 - DA354A - Listor och lexikonAnton Tibblin
 
HT23 - DA354A - Kursintroduktion
HT23 - DA354A - KursintroduktionHT23 - DA354A - Kursintroduktion
HT23 - DA354A - KursintroduktionAnton Tibblin
 
HT23 - DA106A - Användbarhet (2)
HT23 - DA106A - Användbarhet (2)HT23 - DA106A - Användbarhet (2)
HT23 - DA106A - Användbarhet (2)Anton Tibblin
 
HT23 - DA106A - Användbarhet 1
HT23 - DA106A - Användbarhet 1HT23 - DA106A - Användbarhet 1
HT23 - DA106A - Användbarhet 1Anton Tibblin
 
HT23 - DA106A - Ramverk & Bibliotek
HT23 - DA106A - Ramverk & BibliotekHT23 - DA106A - Ramverk & Bibliotek
HT23 - DA106A - Ramverk & BibliotekAnton Tibblin
 
HT23 - DA106A - Introduktion till JavaScript
HT23 - DA106A - Introduktion till JavaScriptHT23 - DA106A - Introduktion till JavaScript
HT23 - DA106A - Introduktion till JavaScriptAnton Tibblin
 
HT23 - DA106A - Responsiv webbutveckling
HT23 - DA106A - Responsiv webbutvecklingHT23 - DA106A - Responsiv webbutveckling
HT23 - DA106A - Responsiv webbutvecklingAnton Tibblin
 
HT23 - DA106A - Layout (2)
HT23 - DA106A - Layout (2)HT23 - DA106A - Layout (2)
HT23 - DA106A - Layout (2)Anton Tibblin
 
HT23 - DA106A - Layout med CSS (1)
HT23 - DA106A - Layout med CSS (1)HT23 - DA106A - Layout med CSS (1)
HT23 - DA106A - Layout med CSS (1)Anton Tibblin
 
Introduktion till CSS
Introduktion till CSSIntroduktion till CSS
Introduktion till CSSAnton Tibblin
 
HTML - Tabeller och formulär
HTML - Tabeller och formulärHTML - Tabeller och formulär
HTML - Tabeller och formulärAnton Tibblin
 
Introduktion till HTML
Introduktion till HTMLIntroduktion till HTML
Introduktion till HTMLAnton Tibblin
 

More from Anton Tibblin (20)

2024 - Localstorage & cookies Geolocation Mediahantering.pdf
2024 - Localstorage & cookies Geolocation Mediahantering.pdf2024 - Localstorage & cookies Geolocation Mediahantering.pdf
2024 - Localstorage & cookies Geolocation Mediahantering.pdf
 
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbtekniker
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbteknikerVT24 - jQuery & Ajax - Flerplattformsapplikationer med webbtekniker
VT24 - jQuery & Ajax - Flerplattformsapplikationer med webbtekniker
 
VT24 - Responsiv design & Ramverk inom webbutveckling
VT24 - Responsiv design & Ramverk inom webbutvecklingVT24 - Responsiv design & Ramverk inom webbutveckling
VT24 - Responsiv design & Ramverk inom webbutveckling
 
DA395A - VT24 - JavaScript & Document object model
DA395A - VT24 - JavaScript & Document object modelDA395A - VT24 - JavaScript & Document object model
DA395A - VT24 - JavaScript & Document object model
 
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbtekniker
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbteknikerVT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbtekniker
VT24 - DA395A - Kursintroduktion: Flerplattformsapplikationer med webbtekniker
 
HT23 - DA354A - Webbprogrammering med Python
HT23 - DA354A - Webbprogrammering med PythonHT23 - DA354A - Webbprogrammering med Python
HT23 - DA354A - Webbprogrammering med Python
 
HT23 - DA354A - Fil- och felhantering
HT23 - DA354A - Fil- och felhanteringHT23 - DA354A - Fil- och felhantering
HT23 - DA354A - Fil- och felhantering
 
HT23 - DA354A - Listor och lexikon
HT23 - DA354A - Listor och lexikonHT23 - DA354A - Listor och lexikon
HT23 - DA354A - Listor och lexikon
 
HT23 - DA354A - Kursintroduktion
HT23 - DA354A - KursintroduktionHT23 - DA354A - Kursintroduktion
HT23 - DA354A - Kursintroduktion
 
HT23 - DA106A - Användbarhet (2)
HT23 - DA106A - Användbarhet (2)HT23 - DA106A - Användbarhet (2)
HT23 - DA106A - Användbarhet (2)
 
HT23 - DA106A - Användbarhet 1
HT23 - DA106A - Användbarhet 1HT23 - DA106A - Användbarhet 1
HT23 - DA106A - Användbarhet 1
 
HT23 - DA106A - Ramverk & Bibliotek
HT23 - DA106A - Ramverk & BibliotekHT23 - DA106A - Ramverk & Bibliotek
HT23 - DA106A - Ramverk & Bibliotek
 
HT23 - DA106A - Introduktion till JavaScript
HT23 - DA106A - Introduktion till JavaScriptHT23 - DA106A - Introduktion till JavaScript
HT23 - DA106A - Introduktion till JavaScript
 
HT23 - DA106A - Responsiv webbutveckling
HT23 - DA106A - Responsiv webbutvecklingHT23 - DA106A - Responsiv webbutveckling
HT23 - DA106A - Responsiv webbutveckling
 
HT23 - DA106A - Layout (2)
HT23 - DA106A - Layout (2)HT23 - DA106A - Layout (2)
HT23 - DA106A - Layout (2)
 
HT23 - DA106A - Layout med CSS (1)
HT23 - DA106A - Layout med CSS (1)HT23 - DA106A - Layout med CSS (1)
HT23 - DA106A - Layout med CSS (1)
 
Introduktion till CSS
Introduktion till CSSIntroduktion till CSS
Introduktion till CSS
 
HTML - Tabeller och formulär
HTML - Tabeller och formulärHTML - Tabeller och formulär
HTML - Tabeller och formulär
 
Introduktion till HTML
Introduktion till HTMLIntroduktion till HTML
Introduktion till HTML
 
Kursintroduktion
KursintroduktionKursintroduktion
Kursintroduktion
 

Recently uploaded

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 

Recently uploaded (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

HT18 - DA361A - Kursintroduktion

  • 1. Data- och informationsvetenskap: Objektorienterad programmering och modellering för IA DA361A 7,5hp LP1
  • 2. Lärare i kursen Anton Tibblin anton.tibblin@mau.se Aleksander Fabijan aleksander.fabijan@mau.se
  • 4.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Hur går ni till väga idag? När ni jobbar med era projekt?
  • 11.
  • 12.
  • 13.
  • 14.
  • 16. Kursens syfte Kursens syfte är att studenten ska utveckla kunskaper och färdigheter inom objektorienterad programutveckling och -design. Därigenom ska studenten även vidareutveckla sina programmeringsförmågor.
  • 17. Innehåll • Från strukturerad till objektorienterad programmering • Design och analys med principer för objektorientering • Objektorientering i det aktuella programspråket (Python) • Unified Modeling Language (UML)
  • 18. Innehåll • Objektorienterad systemanalys och design (OOSAD) • Objektorienterad programmering (OOP)
  • 19. Objektorienterad systemanalys och design “Object-oriented analysis and design (OOAD) is a popular technical approach for analyzing, designing an application, system, or business by applying the object-oriented paradigm and visual modeling throughout the development life cycles to foster better stakeholder communication and product quality.”
  • 20. Objektorienterad programmering “Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.”
  • 21. Kursmaterial • Canvas- inlämningar, resultat, meddelande • https://mau.instructure.com/ • Mah Webb - all annan information • http://da361a.ia-mau.se/ • Kursplan • http://edu.mah.se/sv/Course/DA361A?v=1#Syllabus
  • 22. Kurslitteratur • Think Python (O’Reilly) • ISBN: 1491939362 • Finns gratis här: http://greenteapress.com/wp/think-python-2e/ • Object-Oriented Systems Analysis and Design Using UML (2010) • ISBN: 9780077125363 • Problem Solving with Algorithms and Data Structures Using Python • ISBN: 9781590282571 • http://pythonbooks.revolunet.com/
  • 23. Schema Vecka Moment 36 Kursintroduktion + Föreläsning + Labb 37 Föreläsning*2 + Labb 38 Föreläsning + Labb 39 Föreläsning + Labb 40 Föreläsning + Labb 41 Workshop + Labb 42 Mer information kommer… 43 Extra föreläsning + labb 44 Extra labb 45 Tenta + extra labb
  • 24. Bedömningsformer • 2st Inlämningsuppgifter, 3.5 hp, U-G • Tentamen, 4 hp, U-VG
  • 25. Extra poäng till tentamen • För varje laboration som man aktivt deltar i, kan man tillgodoräkna sig 0.5p till ordinarie tentamen • Om man deltar aktivt i alla laborationer får man totalt 3p som man kan tillgodoräkna sig på ordinarie tentamen
  • 26. Läshänvisningar • Think Python • kap. 2-3 + 10-11 (repetition) • kap. 15-18 (OOP)
  • 29. OOP Intro to Course Aleksander Fabijan
  • 30. Background • In previous courses we learned about variables. For example, if you want to describe this course with a few variables in Python you could say: city_of_course = "Malmö" number_of_teachers = 2 teacher1 = { "name": "Aleksander", "age": 28, "hasPhD": "Yes" } teacher2 = { "name": "Anton", "age": 28, "hasPhD": "No" } print(teacher1) print(teacher2) print(city_of_course) print(number_of_teachers)
  • 31. • Now imagine we would want to describe another course like this… • Another program… • Another university… • …
  • 32. Exercise 1 • Describe a friend of yours in Python code. Use any knowledge of python that you have previously obtained! • Now describe another friend of yours following the same pattern. • Do you see how much the code is starting to repeat itself?
  • 33. One Solution # One way to describe a friend friend1 = "My first friend is Helena. She is a female and she is 30 years old." friend2 = "My second friend is Anton. He is a male. He is nearly 29 years old." Imagine I ask you to extract the age from the two variables. How would you do that? … … … ^s*(w+)s*(s*(d+)D+(d+)D+)s*$...
  • 34. Another Solution Imagine I ask you to extract the age from the two variables. How would you do that? friend1 = { "name": "Helena", "age": 30 } friend2 = { "name": "Anton", "age": 28 } print(friend2['age'])
  • 35. Challenge to go down this path… • Code would start to repeat itself a lot, • We would have to remember the names of so many variables! • Understanding our program by others would be hard! • Giving one extra attribute would require a lot of work!
  • 36. Better: Object Oriented Programming • One way to describe objects from real life in programming is to code them as objects! FRIEND first_friend = Friend("Helena", "female", True) second_friend = Friend("Anton", "male", False) + Blueprint = Class Objects = Instances from blueprint
  • 37. class Friend(object): '''This is a blueprint for a Friend''' def __init__(self, friend_name, friend_gender, friend_phd): '''This method is called when a new friend needs to be created''' self.name = friend_name self.gender = friend_gender self.phd = friend_phd def __str__(self): '''This method is called when someone prints the friend''' return "This is {n} and their gender is {g}.".format(n=self.name, g=self.gender)