6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.

Slides:



Advertisements
Similar presentations
Looking inside classes Fields, Constructors & Methods Week 3.
Advertisements

Introduction to Object Oriented Programming Java.
Introduction to Information and Computer Science Computer Programming Lecture e This material (Comp4_Unit5e) was developed by Oregon Health and Science.
Object-Oriented Analysis and Design
CM10134-CM50147 Programming I Basic Programming in Java Marina De Vos.
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Object Oriented System Development with VB .NET
Objects First with Java A Practical Introduction using BlueJ
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Basic OOP Concepts and Terms
Understanding class definitions Looking inside classes 3.0.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 9 Thinking in Objects.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction to Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Object Oriented Programming
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Introduction to Object-oriented programming and software development Lecture 1.
An Object-Oriented Approach to Programming Logic and Design
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Object Oriented Design: Identifying Objects
Introduction To System Analysis and Design
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Introduction to Java. 2 Textbook David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ Fourth edition, Pearson.
OBJECTS AND CLASSES CITS1001. Concepts for this lecture class; object; instance method; parameter; signature data type multiple instances; state method.
1 COS 260 DAY 2 Tony Gauvin. 2 Agenda Questions? Class roll call Blackboard Web Resources Objects and classes 1 st Mini quiz on chap1 terms and concepts.
1 COS 260 DAY 1 Tony Gauvin. 2 Agenda Class roll call Instructor Introduction Instructor’s Educational Philosophy Contract on Classroom Behavior Syllabus.
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
1 OO Analysis & Design - Introduction to main ideas in OO Analysis & design - Practical experience in applying ideas.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 6 Objects and Classes.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the.
Functional Processing of Collections (Advanced) 6.0.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability © 2017 Pearson Education, Inc. Hoboken,
Copyright © 2012 Pearson Education, Inc. Chapter 4 Writing Classes : Review Java Software Solutions Foundations of Program Design Seventh Edition John.
Object-Oriented Programming Concepts
Objects and Classes CITS1001 week 1.
COS 260 DAY 1 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
About the Presentations
Functional Processing of Collections (Advanced)
Section 11.1 Class Variables and Methods
COS 260 DAY 17 Tony Gauvin.
Understanding class definitions
Objects First with Java A Practical Introduction using BlueJ
Understanding class definitions
Objects First with Java
COS 260 DAY 10 Tony Gauvin.
COS 260 DAY 2 Tony Gauvin.
COS 260 DAY 18 Tony Gauvin.
COS 260 DAY 3 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
COS 260 DAY 23 Tony Gauvin.
COS 260 DAY 4 Tony Gauvin.
Basic OOP Concepts and Terms
COS 260 DAY 23 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
Further abstraction techniques
Presentation transcript:

6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling

2 Course Contents Introduction to object-oriented programming… …with a strong software engineering foundation… …aimed at producing and maintaining large, high-quality software systems. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

3 Buzzwords interface © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. javadoc encapsulation coupling cohesion polymorphic method calls inheritance mutator methods collection classes overridingiterators responsibility-driven design

4 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 © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

5 Book © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ 6th edition, Pearson Education, 2017

6 Course overview (1) Objects and classes Understanding class definitions Object interaction Grouping objects More sophisticated behavior - libraries Designing classes Well-behaved objects - testing, maintaining, debugging © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

7 Course overview (2) Inheritance Polymorphism Extendable, flexible class structures Building graphical user interfaces Handling errors Designing applications © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

8 Advanced material There is advanced material on: –Streams; –Lambdas; –2D arrays. This may be skipped on first reading …... or read, according to preference! © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

9 Classes and objects Fundamental to much of the early parts of this course. Class: category or type of ‘thing’. Like a template or blueprint. Object: belongs to a particular class and has individual characteristics. Explore through BlueJ … © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

10 Demo of figures project © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

11 Fundamental concepts object class method parameter data type © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. It is vital to understand these concepts as soon as possible.

12 Classes and Objects A class –represents all similar objects of a kind (example: “car”) objects –represent ‘things’ from the real world, or from some problem domain; –example: “that red car in the parking lot”. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

13 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. –Parameters introduce variation into the effect of method calls. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

14 Other observations Many distinct 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). © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

15 State © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

16 Two circle objects © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

17 Source code Each class has source code associated with it that defines its details (attributes and methods). The source code is written to obey the rules of a particular programming language. We will explore this in detail in the next chapter. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

18 Return values All the methods in the figures project have void return types; but … … methods may return a result via a return value. Such methods have a non- void return type. More on this in the next chapter. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

19 Review Classes model concepts. Source code realises those concepts. Source code defines: –What objects can do (methods). –What data they store (attributes). Objects come into existence with pre-defined attribute values. The methods determine what objects do with their data. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

20 Review When a method is called an object: –Alters its state, and/or –Uses its data to decide what to do. Some methods take parameters that affect their actions. Methods without parameters typically use their state to decide what to do. Some methods return a value. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.

21 Review Most programs contain multiple classes. At runtime, objects interact with each other to realize the overall effect of the program. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.