Objektorienterad programmering DAT050 DAI2 lp1 2016/2017

Slides:



Advertisements
Liknande presentationer
Föreläsning 7, Kapitel 7 Designa klasser Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David J. Barnes & Michael Kölling.
Advertisements

Programmeringsteknik I: F1 1 Föreläsning 1: Intro till kursen och programmering  Kursens hemsida  Studentportalen.
1.Numerical differentiation and quadrature Discrete differentiation and integration Ordinary.
Föreläsning 1.
Participants: educators, leaders, representatives from Cau Giay DOET - Monday, Mai Dich Kindergarten, 50 pers - Tuesday, Dich Vong primary school, 50.
i olika programmeringsspråk
Föreläsning 8, kapitel 8 Förbättra strukturen med arv Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David J. Barnes & Michael.
Mer om arv - Polymorfism Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David J. Barnes & Michael Kölling Fredric Ragnar
F. Drewes, Inst. f. datavetenskap1 Föreläsning 10: Objektorientering Objektorientering och abstrakta datatyper Dynamisk bindning Singel mot multipelt.
För att uppdatera sidfotstexten, gå till menyfliken: Infoga | Sidhuvud och sidfot Fondbolagsträff 2015.
Föreläsning 5, Kapitel 5 Använda Java-bibliotek för att få avancerad funktionalitet Kursbok: “Objects First with Java - A Practical Introduction using.
Introduktion till klasser, objekt och BlueJ Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David J. Barnes & Michael Kölling.
Föreläsning 1. Innehåll Introduktion till objektorientering –OOP (objektorienterad programmering) –Objekt, instanser, klasser C++ –OO i C++ –Standardbibliotek.
Föreläsning 10, kapitel 10 Abstrahera mera! Abstrakta klasser och interface Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”,
Arkitektrollen. Ansvar och uppgifter Architecture notebook Mycket intensivt elaboration – inception Mål: en stabil arkitektur i slutet på elaboration.
Föreläsning 3, Kapitel 3 Objektinteraktion - Skapa objekt som samarbetar Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David.
Välkommen till kursen objektorienterad programmering med Java Kursbok: “Objects First with Java - A Practical Introduction using BlueJ”, David J. Barnes.
Cross-institutional collaboration… Creating Knowledge IV 2006 Copenhagen Denmark Birgitta Hansson Örebro University Library Sweden.
ABB och Caterpillar 1 Marcus Larsson marla419. Problem CAT-ABB sour relationship: CAT felt ABB Turbo Systems held them hostage. In CAT:s view ABB dictated.
 Who frågar efter en persons (eller personers) identitet (vem dem är).  Who is he?  Who are they?  Who is coming?
To practise speaking English for 3-4 minutes Genom undervisningen i ämnet engelska ska eleverna ges förutsättningar att utveckla sin förmåga att: formulera.
Polygoner och samband mellan dessa
© Gunnar Wettergren1 IV1021 Project models Gunnar Wettergren
1-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1-1 Programmering 7.5 hp Programmering är... creativ, fascinerande, roligt,
Lab Contact 1  Lab Assistants:  Meng Liu, Group B  Sara Abbaspour, Group A
How To Use PowerPoint A Brief Introduction to Commonly Used Features By Ryan McKenzie.
Skolledardagen Platsen var Birger Jarl i Stockholm Jag var där och Eva-Lis Sirén Men även Ann-Marie Begler, GD Skolinspektionen Hennes råd till.
THINGS TO CONSIDER WHILE PLANNING A PARTY Planning an event can take an immense amount of time and planning. Even then, the biggest problem that arises.
STEPS TO FOLLOW FOR BECOMING A SHIP CAPTAIN A career as a ship captain can be a tedious task. Ship captains take care of business, navigation and operation.
SAFETY EQUIPMENT USED IN MARITIMEOPERATIONS One of the most important sections in maritime courses consists of boat and ship operations. Safety is an important.
Swedish for international students Kie FM Sandra Uitto Swedish teacher Language Center, Aalto University U-wing, II floor.
Advice from Bronx Best Real Estate Attorney. Jagiani Law office of New York has been successfully working as divorce attorney & Real estate attorney for.
Digitization and Management Consulting
Why you should consider hiring a real estate attorney!
Law abiding grounds of filing a divorce Jagianilaw.com.
Types of Business Consulting Services Cornerstoneorg.com.
Objektorienterad programmering DAT050 DAI2 lp1 2017/2018
Mathematics 1 /Matematik 1
Bringapillow.com. Online Dating- A great way to find your love! The words ‘Love’ and ‘Relationship’ are close to every heart. Indeed, they are beautiful!
Work of a Family law attorney Jagianilaw.com. A Family Law Attorney basically covers a wide range spectrum of issues that a family may face with difficulty.
The Online Way to Engagement and Wedding Jewelry! Pearlleady.com.
Positioning CM responsibilities in the organisation
Course info.
Objektorienterad programmering d2
MSL, framtida projekt Located 2 km north from here. History dates back to the research institute that was founded in 1937 for the Nobel Laureate Manne.
Meeting singles had never been so easy before. The growing dating sites for singles have given a totally new approach to getting into relationships. ‘Singles.
We are the world There comes a time When we head a certain call When the world must come together as one There are people dying And it's time to lend.
Formal Languages, Automata and Models of Computation
My role model.
Pearlleady.com Attractive Graduation and Wedding Gifts Online.
How to Buy Engagement Rings for Women Online?. Buying engagement rings for women or tiffany celebration rings from the online market could be a bit challenging.
You Must Take Marriage Advice to Stop Divorce! Dontgetdivorced.com.
Föreläsning 8: Exempel och problemlösning
Requirement Modelling with UML Use Case
Publish your presentations online we present SLIDEPLAYER.SI.
Publish your presentations online we present SLIDEPLAYER.RS.
Publish your presentations online we present SLIDEPLAYER.IN.
Publish your presentations online we present SLIDEPLAYER.VN.
Publish your presentations online we present SLIDEPLAYER.RO.
Publish your presentations online we present SLIDEPLAYER.EE.
Publish your presentations online we present SLIDEPLAYER.CO.IL.
Publish your presentations online we present SLIDEPLAYER.AE.
Publish your presentations online we present SLIDEPLAYER.BG.
Publish your presentations online we present SLIDEPLAYER.AFRICA.
Publish your presentations online we present SLIDEPLAYER.MX.
Publish your presentations online we present SLIDEPLAYER.LT.
Publish your presentations online we present SLIDEPLAYER.LV.
Publish your presentations online we present SLIDEPLAYER.SK.
Presentationens avskrift:

Objektorienterad programmering DAT050 DAI2 lp1 2016/2017 Uno Holmer Andreas Wieden Robin Åstedt Replace this with your course title and your name/contact details. DAT050, 16/17, lp 2

Objektorienterad programmering d2 Course Contents Introduction to object-oriented programming… …with a strong software engineering foundation… …aimed at producing and maintaining large, high-quality software systems. Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Buzzwords responsibility-driven design inheritance encapsulation overriding coupling iterators javadoc interface abstraction cohesion refactoring mutator methods collection classes A few buzzwords - I use that among other things to address students who have prior programming experience (and often think they know everything already). This shows them that they can still learn a lot in this course. design patterns regression testing polymorphic method calls Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Goals Sound knowledge of programming principles Sound knowledge of object-orientation Able to critically assess the quality of a (small) software system Able to implement a small software system in Java Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Book David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ 6th edition, Pearson Education, 2016 ISBN 978-1-292-15904-1 Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Course overview (1) Objects and classes Class definitions Object cooperation Collections of objects Class libraries Class documentation methods Well-behaved objects – automatic testing and debugging Well-designed programs - Hur många har programmerat i Java? Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Course overview (2) Handling errors Inheritance Polymorphism Abstract classes and interfaces How to build flexible and extendable class structures using inheritance Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Course overview (3) OOA DAT055 lp III Design process and modelling Graphical user interfaces Design patterns Streams and files Parallel computing with threads Communication Reflection and meta programming Software project Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Activities Lectures Supervised class excercises Laborations (5) Your own work (plenty) Skicka runt lablistorna! Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 V. Föreläsning BK kap. Laboration/Deadline 35 Mån: F1   Ons: F2 Introduktion till kursen och OOP Objekt och klass, instansvariabler, konstruktorer och metoder App. A, B, C, D 1 2 Lab 1 Java och BlueJ Deadline Sön 8/9 36 Mån: F3 Ons: F4 Objektinteraktion, objektsamlingar Objektsamlingar forts. 3, 4.1-4.8 4.9-4.17 Lab 2 Objektinteraktion Sön 15/9 37 Mån: F5 Ons: F6 Associativa objektsamlingar och mängder, likhet och identitet, klassvariabler, konstanter Testning, enhetstestning, regressionstestning, JUnit, testautomatisering, avlusning 5 7, App. G Lab 3 Objektsamlingar Sön 22/9 38 Mån: F7 Ons: F8 Dokumentation av program, JavaDoc, kompilering, modularisering av program Designprinciper, koppling, kohesion, refaktorering App. I, J, K App. E, F. OH 6 Lab 4 Testning Sön 2/10 39 Mån: F9 Ons: F10 Arv, subtypning, substitutionsprincipen Polymorfism, statisk och dynamisk typ, dynamisk bindning 8 9 40 Mån: F11 Ons: F12 Abstrakta klasser och gränssnitt  Kopiering av objekt, grund och djup kopiering 10    OH Lab 5 Arv Sön 16/10 41 Mån: F13 Ons: F14 Strukturerad felhantering Likhets- och jämförelserelationer för objekt, hashfunktioner 12 42 Ons Repetition 43 Tentamen: Tor 27/10 Objektorienterad programmering d2 Inlämningsuppgift 1 in senast v.44 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Demo Here, I start discussing objects and classes. I talk to the students about it for a while, then I do an extensive demo of the shapes example in BlueJ. All important points of this lecture are encountered and pointed out during this demo. All following slides serve only as summary, or reminder. No new material is introduced after the demo. Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Fundamental concepts object class method parameter data type You don’t always need to show all these slides in class. These are intended as summaries. Discuss these topics with a demo, or in a dialog, or in any way you like. Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Objects and classes objects represent ‘things’ from the real world, or from some problem domain (example: “the red car down there in the car park”) classes represent all objects of a kind (example: “car”) Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Methods and parameters Objektorienterad programmering d2 Methods and parameters Objects have operations which can be invoked (Java calls them methods). Methods may have parameters to pass additional information needed to execute. Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Other observations Many instances can be created from a single class. An object has attributes: values stored in fields. The class defines what fields an object has, but each object stores its own set of values (the state of the object). Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 State Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Two circle objects Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Source code Each class has source code (Java code) associated with it that defines its details (fields and methods). Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Return values Methods may return a result via a return value. Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 FunktionsOrientering och ObjektOrientering (OO) ObjektOrienterad programutveckling Analys (OOA) Design (OOD) Programmering (OOP) Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Funktionsorienterat synsätt Sätter systemets funktioner i centrum stanna(hissen); Objektorienterat synsätt Sätter systemets objekt i centrum hissen.stanna(); stanna hissen hissen’ stanna! hissen Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Det FunktionsOrienterade synsättet Analysen fokuserar på systemets funktionalitet: Funktioner verkar på data ”Top-Down design”, stegvis förfining, algoritmisk dekomposition, ... I fokus Underordnade Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Funktionsorienterad bankomatdesign Skriv ledtext Läs siffror Meddela fel Ring upp centraldator Lucka ner upp Stäng lås Öppna Mata ut sedlar Manövrera Begär kort Verifiera belopp PIN-kod Kontantuttag Dataformaten är troligen kända i flera funktioner => svårt att lokalisera och ändra datarepresentation (Y2K…) Bankomatens sekventiella beteende är ”inkodat” i strukturen => svårt att lägga till nya tjänster (t.ex. saldoförfrågan) Olika begrepp hanteras utspritt, t.ex. hanteringen av displayen => svårt att lokalisera vid förändringar Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Det ObjektOrienterade synsättet Systemet analyseras med avseende på ”verkliga ting” Tingen modelleras som objekt VAD hanteras i systemet (vilka objekt)? Vilka relationer finns mellan objekten? Hur kan objekten samarbeta för att ge önskade tjänster? Vilka operationer måste finnas i objekten? interaktion mellan Objekt - Tillstånd - Operationer Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2

Objektorienterad programmering d2 Objektorienterad bankomatdesign Styrenhet Sedel- utmatare Skrivare Central- dator Tangent- bord Display Luck- motor lås Upp Ner TangentHändelse Meddelande KopplaNer KopplaUpp MinskaSaldo SedlarSlut VerifieraKort SkrivKvitto MataUtSedlar LäsTangent KortInmatat MataUtKort Öppna Stäng Kort- enhet Objektorienterad programmering, DAT050, DAI2, 16/17, lp 1 DAT050, 16/17, lp 2