Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
Object Interaction and Source Code Week 2. OBJECT ORIENTATION BASICS REVIEW.
Classes & Objects Computer Science I Last updated 9/30/10.
Introduction to Object Oriented Programming Java.
Object-Oriented Analysis and Design
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
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.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
Objects First with Java A Practical Introduction using BlueJ
1 Basic Object Oriented Concepts Overview l What is Object-Orientation about? l What is an Object? l What is a Class? l Constructing Objects from Classes.
Objects Interaction and Source Code Week 2. OBJECT ORIENTATION BASICS REVIEW.
Object Oriented Analysis and Design Chapter 1 Applying UML and Patterns -Craig Larman.
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.
Object Oriented Programming
Object Oriented Software Development
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
1 Programming James King 12 August Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple.
M1G Introduction to Programming 2 1. Designing a program.
Introduction to Object-oriented programming and software development Lecture 1.
BCS 2143 Introduction to Object Oriented and Software Development.
An Object-Oriented Approach to Programming Logic and Design
Programming 1 1. Introduction to object oriented programming and problem-solving.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Object Oriented Design: Identifying Objects
Starting Out With Java 5 (Control Structures to Objects) Chapter 6 By Tony Gaddis Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
Java Classes Using Java Classes Introduction to UML.
OBJECTS AND CLASSES CITS1001. Concepts for this lecture class; object; instance method; parameter; signature data type multiple instances; state method.
1 COS 260 DAY 1 Tony Gauvin. 2 Agenda Class roll call Instructor Introduction Instructor’s Educational Philosophy Contract on Classroom Behavior Syllabus.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Chapter 12 Object Oriented Design.  Complements top-down design  Data-centered view of design  Reliable  Cost-effective.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
Introduction to Object-oriented Programming Java API.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
INM205 Object Oriented Programming in JAVA Dr. Michael Casey Department of Computing.
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.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Introduction to OOP CPS235: Introduction.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Software development For large and complex software use divide and conquer rule. Software design methods: Structured design Object-Oriented design.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter 11 An introduction to object-oriented design.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
WEEK 1 1 What is a Computer Program? An algorithm that can be executed on a computer is a program. A program usually contains several algorithms.
Visit for more Learning Resources
Objects and Classes CITS1001 week 1.
COS 260 DAY 1 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
Objects as a programming concept
The Object-Oriented Thought Process Chapter 1
Object Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
COS 260 DAY 2 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
Extended Learning Module G
Workshop for Programming And Systems Management Teachers
Objects First with Java A Practical Introduction using BlueJ
Handout-2(a) Basic Object Oriented Concepts
Presentation transcript:

Programming

To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the quality of a (small) software system To be able to implement a (small) software system in Java Module Overview GOALS

Module Text Book BARNES & KOLLING David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ Fifth edition Pearson Education, 2012 ISBN

Introduction to Objects and Classes Week 1

Software development In order to design and build something complex, it is necessary to put some thought into how to break down the design into smaller chunks that are more easily dealt with. In software design, the most common methods are called Structured Design and Object- Oriented Design. Object-Oriented Design is the most recent type of development and the Java language is itself designed to support this type of design.

Object Oriented Design (OOD) Objects In OOD, a design is made up of a number of objects that may represent real-life objects and how they interact. These objects are comprised of two parts: attributes and methods. Attributes are data items that are associated with the object and methods are pieces of functionality. In other words attributes describe something about the object and methods are things that it can do, or have done to it. Classes In order to use an object we first define what that object is by means of a class description. A class description defines a type of object in terms of its attributes and methods. A class describes what all objects of a particular type have in common. Classes are the blueprints or templates for objects. Classes are used to create objects.

Specifying a class - Dog class what do dogs have in common? What attributes do dogs have? What behaviours do dogs have?

Dog class diagram Dog name colour size run sit bark bite eat attributes fields behaviours methods The Dog class is a template or blueprint for creating dog objects

Dog objects - instances of the class Dog class scooby snoopy mutley lassie From the Dog class we can create individual dog objects

Object State Each object has its own state. Its state is the values that the attributes are set to, which can be different from other objects of the same type State Methods Dog name scooby colour brown size big run() sit() bark() name snoopy colour white size small run() sit() bark() I am an object

Sending messages to objects - invoking methods We get objects to do things by calling their methods snoopy.run() calls the run() method on the object snoopy

Passing parameters to methods Sometimes when we call a method we need to pass some data to the method, to tell it exactly what to do. snoopy.run(10) scooby.bark(“loud”) scooby.sit(), snoopy.run() actual parameters

Object Orientation Advantages Reuse - Once we have defined a class we can use it over and over again to create many different objects of that type e.g. Dog class, BankAccount class Reuse - Once we have defined a class - someone else can use that class to create objects - so we can create class libraries Encapsulation - we can create objects from a class and use its behaviours without needing to know the internal details of how it works Reuse - when defining new classes we can compose classes from other existing classes to create complex objects

BlueJ Demonstration

Object – Represents an actual thing! Class – ‘Blueprint’ for making an object Method – Things an object can do (behaviour) Parameter – input required by an object method Data type – what type of data is allowed! Object Model Basics FUNDAMENTAL CONCEPTS

Many objects (instances) can be created from a single class. An object has attributes (fields), and those attributes have values assigned to them. the class defines what fields an object has, but each object stores its own set of values (state) Each class has source code (Java) associated with it that defines its fields and methods. Object Model Basics OTHER OBSERVATIONS

Object Model Basics STATE

Object Model Basics OBJECT INSTANCES

Required Reading Objects First With Java – A Practical Introduction using BlueJ Chapter 1 pp 3-11 (Objects and Classes)