1: Introduction to Object (1)

Size: px
Start display at page:

Download "1: Introduction to Object (1)"

Transcription

1 1: Introduction to Object (1) 김동원

2 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface Has-a vs. Is-a Relationships Is-a vs. Is-like-a relationships Interchangeable objects with polymorphism Thinking in C++ Page 1

3 Overview (2) Creating and destroying objects Exception handling: Dealing with errors Analysis and design Phase 1: What are we making? Phase 2: How will we build it? Phase 3: Build the core Phase 4: Iterate the use cases Phase 5: Evolution Thinking in C++ Page 2

4 The progress of abstraction All programming languages provide abstractions Fortran, BASIC, and C Abstractions of assembly language Primary abstraction is the structure of the computer rather than the structure of the problem you are trying to solve The programmer must establish the association between the machine model (solution space) and the model of the problem that is actually being solved (problem space) Required to perform this mapping between solution space and problem space The produced program is difficult to write and expensive to maintain Thinking in C++ Page 3

5 The progress of abstraction The object-oriented approach Provides tools for the programmer to represent elements in the problem space Describe the problem in terms of the problem, rather than in terms of the computer where the solution will run More flexible and powerful Thinking in C++ Page 4

6 Smalltalk The first successful object-oriented language One of the languages upon which C++ is based Characteristics Everything is an object A program is a bunch of objects telling each other what to do by sending messages Each object has its own memory made up of other objects Every object has a type All objects of a particular type can receive the same messages Thinking in C++ Page 5

7 Class & Object Class First introduces a new type into a program in the Simula- 67 A data type A set of objects that have identical characteristics (data elements) and behaviors (functionality) By adding new data types specific to your needs Object (Instance) Variable of a type (class) Receive messages or requests Thinking in C++ Page 6

8 Interface The requests of an object are defined by its interface A simple example Light lt; lt.on(); Thinking in C++ Page 7

9 The hidden implementation Access control for member functions of a class Reasons Reduce bug Keep client programmers hands off portions they shouldn t touch To allow the library designer to change the internal workings of the class without worrying about how it will affect the client programmer C++ Three explicit keywords to set the boundaries in a class public, private, and protected Thinking in C++ Page 8

10 Reusing the implementation It takes experience and insight to produce a good design One of the greatest advantages that object-oriented programming languages provide The simplest way to reuse a class To just use an object of that class directly Place an object of that class inside a new class This concept is called composition or aggregation Ex) UML (Unified Modeling Language ) Thinking in C++ Page 9

11 Inheritance: Reusing the interface One of the Important point Package data and functionality together by concept These concepts are expressed as fundamental units in the programming language by using the class keyword If we can take the existing class, clone it, and then make additions and modifications to the clone This is effectively what you get with inheritance If the original (base, super or parent) class is changed, the modified clone (inherited or derived) also reflects those changes Thinking in C++ Page 10

12 Inheritance: Reusing the interface A base type contains all of the characteristics and behaviors that are shared among the types derived from it Thinking in C++ Page 11

13 Inheritance: Reusing the interface (Example) The base type is shape, and each shape has a size, a color, a position, and so on Each shape can be drawn, erased, moved, colored, etc Specific types of shapes are derived (inherited): circle, square, triangle, and so on, each of which may have additional characteristics and behaviors Thinking in C++ Page 12

14 Inheritance: Reusing the interface (Example) Thinking in C++ Page 13

15 Inheritance: Reusing the interface (Example) Overriding Although inheritance may sometimes imply that you are going to add new functions to the interface, that s not necessarily true More important way to differentiate your new class is to change the behavior of an existing base-class function Thinking in C++ Page 14

16 Has-a vs. Is-a Relationships Has-a Is-a Thinking in C++ Page 15

17 Is-a vs. Is-like-a relationships Pure substitution (is-a) The derived type is exactly the same type as the base class since it has exactly the same interface Is-like-a The new type can still be substituted for the base type, but the substitution isn t perfect The new type has the interface of the old type but it also contains other functions Can t really say it s exactly the same Thinking in C++ Page 16

18 Interchangeable objects with polymorphism Dealing with type hierarchies Often want to treat an object not as the specific type that it is but instead as its base type Allows you to write code that doesn t depend on specific types In the shape example Functions manipulate generic shapes without respect to whether they re circles, squares, triangles, and so on Unaffected by the addition of new types Adding new types is the most common way to extend an object-oriented program to handle new situations Thinking in C++ Page 17

19 Interchangeable objects with polymorphism Extending a program is easy by deriving new subtypes Reduce the cost of software maintenance Thinking in C++ Page 18

20 Interchangeable objects with polymorphism (Example) Early-binding The compiler generates a call to a specific function name, and the linker resolves this call to the absolute address of the code to be executed Late-binding The compiler cannot determine the address of the code until runtime To perform late binding, the C++ compiler inserts a special bit of code in lieu of the absolute call Thinking in C++ Page 19

21 Interchangeable objects with polymorphism (Example) Thinking in C++ Page 20

22 Creating and destroying objects For maximum runtime speed The storage and lifetime can be determined while the program is being written, by placing the objects on the stack or in static storage Using the stack or static storage area Relatively fast for dynamic allocation Dynamic allocation Create objects dynamically in a pool of memory called the heap If you need a new object, using the new keyword When you re finished with the storage, you must release it using the delete keyword The C++ language does not support a garbage collector Thinking in C++ Page 21

23 Exception handling: Dealing with errors Error handling One of the most difficult issues Hard to design a good error-handling scheme Many languages simply ignore the issue Exception handling Wires error handling directly into the programming language and sometimes even the operating system Exception Object Thrown from the site of the error and can be caught by an appropriate exception handler designed to handle that particular type of error Thinking in C++ Page 22

24 Exception handling: Dealing with errors Exception Provide a way to recover reliably from a bad situation Instead of just exiting the program, you are often able to set things right and restore the execution of a program produces much more robust systems Thinking in C++ Page 23

25 Analysis and design Some sort of process will generally get you on your way in a much better fashion than simply beginning to code It s crucial to move fairly quickly through analysis and design, and to implement a test of the proposed system Analysis paralysis No matter how much analysis you do There are some things about a system that won t reveal themselves until design time More things that won t reveal themselves until you re coding, or not even until a program is up and running Thinking in C++ Page 24

26 Analysis and design Keep in mind what you re trying to discover What are the objects? How do you partition your project into its component parts? What are their interfaces? What messages do you need to be able to send to each object? If you come up with nothing more than the objects and their interfaces, then you can write a program The process can be undertaken in five phases Thinking in C++ Page 25

27 Phase 0: Make a plan Procedure design or requirement analysis Decide what steps you re going to have in your process If your plan is let s jump in and start coding, fine Sometimes that s appropriate when you have a wellunderstood problem It divides the project into more bite-sized pieces and makes it seem less threatening Add the milestones offer more opportunities for celebration Thinking in C++ Page 26

28 Phase 1: What are we making? The requirements analysis in the previous phase Make a list of the guidelines we will use to know when the job is done and the customer is satisfied A contract between you and the customer The system specification Here s a description of what the program will do (not how) to satisfy the requirements Top-level exploration into the problem A discovery of whether it can be done How long it will take To save time To lists and basic diagrams Thinking in C++ Page 27

29 Phase 1: What are we making? Use case Identify key features in the system These are essentially descriptive answers to questions like Who will use this system? What can those actors do with the system? How does this actor do that with this system? How else might this work if someone else were doing this, or if the same actor had a different objective? (to reveal variations) What problems might happen while doing this with the system? (to reveal exceptions) Thinking in C++ Page 28

30 Phase 1: What are we making? (Example) Suppose you are designing an auto-teller The use case for a particular aspect of the functionality of the system The auto-teller does in every possible situation Each of these situations is referred to as a scenario A use case can be considered a collection of scenarios Use case diagrams are intentionally simple To prevent you from getting bogged down in system implementation details prematurely Does not need to be terribly complex, even if the underlying system is complex Thinking in C++ Page 29

31 Phase 1: What are we making? (Example) Each stick person An actor, which is typically a human or some other kind of free agent The box The boundary of your system The ellipses The use cases Descriptions of valuable work that can be performed with the system The lines between the actors and the use cases represent the interactions Thinking in C++ Page 30

32 Phase 2: How will we build it? Determine classes and interactions the Class-Responsibility-Collaboration (CRC) card Start out with a set of blank 3 by 5 cards and write on them Each card represents a single class, and on the card you write The name of the class It s important that this name capture the essence of what the class does, so that it makes sense at a glance The responsibilities of the class This can typically be summarized by just stating the names of the member functions The collaborations of the class what other classes does it interact with? Thinking in C++ Page 31

33 Phase 2: How will we build it? If you can t fit all you need to know about a class on a small card, the class is too complex Either you re getting too detailed, or you should create more than one class The ideal class should be understood at a glance Once you ve come up with a set of CRC cards, you may want to create a more formal description of your design using UML Thinking in C++ Page 32

34 Five stages of object design 1. Object discovery Occurs during the initial analysis of a program 2. Object assembly As you re building an object you ll discover the need for new members 3. System construction The need for communication and interconnection with other objects in the system may change the needs of your classes or require new classes 4. System extension As you add new features to a system you may discover that your previous design doesn t support easy system extension With this new information, you can restructure parts of the system, possibly adding new classes or class hierarchies Thinking in C++ Page 33

35 Five stages of object design 5. Object reuse This is the real stress test for a class If someone tries to reuse it in an entirely new situation, they ll probably discover some shortcomings As you change a class to adapt to more new programs, the general principles of the class will become clearer, until you have a truly reusable type However, don t expect most objects from a system design to be reusable (my person opinion and experience that classes is built in the system construction procedure) Thinking in C++ Page 34

36 Guidelines for object development Thinking about developing your classes 1. Let a specific problem generate a class, then let the class grow and mature during the solution of other problems 2. Remember, discovering the classes you need (and their interfaces) is the majority of the system design If you already had those classes, this would be an easy project 3. Don t force yourself to know everything at the beginning; learn as you go This will happen anyway 4. Start programming; get something working so you can prove or disprove your design Thinking in C++ Page 35

37 Guidelines for object development Always keep it simple Little clean objects with obvious utility are better than big complicated interfaces When decision points come up, use an Occam s Razor approach Consider the choices and select the one that is simplest, because simple classes are almost always best Start small and simple, and you can expand the class interface when you understand it better Thinking in C++ Page 36

38 Phase 3: Build the core Not a one-pass process Iteratively build the system Find the core of your system architecture Needs to be implemented in order to generate a running system You re Creating a framework that you can build upon with further iterations Discover changes and improvements Test verify the requirements and use cases When the core of the system is stable, you re ready to move on and add more functionality Thinking in C++ Page 37

39 Phase 4: Iterate the use cases Add is a small project in itself You add a feature set during an iteration Each use case package of related functionality that you build into the system all at once, during one iteration Give you a better idea of what the scope of a use case Gives more validation to the idea of a use case Stop iterating Achieve target functionality External deadline arrives The customer can be satisfied with the current version Thinking in C++ Page 38

40 Advantages of the iterative process Reveal and resolve critical risks early The customers have ample opportunity to change their minds Programmer satisfaction is higher The project can be steered with more precision Important benefit is the feedback to the stakeholders Reduce or eliminate the need for mind-numbing status meetings Increase the confidence and support from the stakeholders Thinking in C++ Page 39

41 Phase 5: Evolution Traditionally called maintenance Add features that the customer forgot to mention Fix the bugs that show up Add new features as the need arises You need not fear modification Thinking in C++ Page 40

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space.

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. 1 All programming languages provide abstractions. Assembly language is a small abstraction of the underlying machine. Many imperative languages (FORTRAN, BASIC, and C) are abstractions of assembly language.

More information

Chapter 1. Introduction to Objects. C++ Object Oriented Programming Pei-yih Ting NTOUCS

Chapter 1. Introduction to Objects. C++ Object Oriented Programming Pei-yih Ting NTOUCS Chapter 1. Introduction to Objects C++ Object Oriented Programming Pei-yih Ting NTOUCS 1 Contents Differences of OOP from procedural programming Overview of OOP features and some C++ features Some basic

More information

Software Paradigms (Lesson 3) Object-Oriented Paradigm (2)

Software Paradigms (Lesson 3) Object-Oriented Paradigm (2) Software Paradigms (Lesson 3) Object-Oriented Paradigm (2) Table of Contents 1 Reusing Classes... 2 1.1 Composition... 2 1.2 Inheritance... 4 1.2.1 Extending Classes... 5 1.2.2 Method Overriding... 7 1.2.3

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

QUIZ. How could we disable the automatic creation of copyconstructors

QUIZ. How could we disable the automatic creation of copyconstructors QUIZ How could we disable the automatic creation of copyconstructors pre-c++11? What syntax feature did C++11 introduce to make the disabling clearer and more permanent? Give a code example. Ch. 14: Inheritance

More information

Introduction to Objects

Introduction to Objects Introduction to Objects We cut nature up, organize it into concepts, and ascribe significances as we do, largely because we are parties to an agreement that holds throughout our speech community and is

More information

Reliable programming

Reliable programming Reliable programming How to write programs that work Think about reliability during design and implementation Test systematically When things break, fix them correctly Make sure everything stays fixed

More information

QUIZ. How could we disable the automatic creation of copyconstructors

QUIZ. How could we disable the automatic creation of copyconstructors QUIZ How could we disable the automatic creation of copyconstructors pre-c++11? What syntax feature did C++11 introduce to make the disabling clearer and more permanent? Give a code example. QUIZ How

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Object Oriented Programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 23, 2010 G. Lipari (Scuola Superiore

More information

QUIZ. Write the following for the class Bar: Default constructor Constructor Copy-constructor Overloaded assignment oper. Is a destructor needed?

QUIZ. Write the following for the class Bar: Default constructor Constructor Copy-constructor Overloaded assignment oper. Is a destructor needed? QUIZ Write the following for the class Bar: Default constructor Constructor Copy-constructor Overloaded assignment oper. Is a destructor needed? Or Foo(x), depending on how we want the initialization

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

The compiler is spewing error messages.

The compiler is spewing error messages. Appendix B Debugging There are a few different kinds of errors that can occur in a program, and it is useful to distinguish between them in order to track them down more quickly. Compile-time errors are

More information

1. Write two major differences between Object-oriented programming and procedural programming?

1. Write two major differences between Object-oriented programming and procedural programming? 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do:

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

Software Engineering /48

Software Engineering /48 Software Engineering 1 /48 Topics 1. The Compilation Process and You 2. Polymorphism and Composition 3. Small Functions 4. Comments 2 /48 The Compilation Process and You 3 / 48 1. Intro - How do you turn

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized

More information

Lecture Notes on Programming Languages

Lecture Notes on Programming Languages Lecture Notes on Programming Languages 85 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered

More information

Supplemental Handout: Exceptions CS 1070, Spring 2012 Thursday, 23 Feb 2012

Supplemental Handout: Exceptions CS 1070, Spring 2012 Thursday, 23 Feb 2012 Supplemental Handout: Exceptions CS 1070, Spring 2012 Thursday, 23 Feb 2012 1 Objective To understand why exceptions are useful and why Visual Basic has them To gain experience with exceptions and exception

More information

This section provides some reminders and some terminology with which you might not be familiar.

This section provides some reminders and some terminology with which you might not be familiar. Chapter 3: Functions 3.1 Introduction The previous chapter assumed that all of your Bali code would be written inside a sole main function. But, as you have learned from previous programming courses, modularizing

More information

OBJECT ORİENTATİON ENCAPSULATİON

OBJECT ORİENTATİON ENCAPSULATİON OBJECT ORİENTATİON Software development can be seen as a modeling activity. The first step in the software development is the modeling of the problem we are trying to solve and building the conceptual

More information

CS61A Notes Week 6: Scheme1, Data Directed Programming You Are Scheme and don t let anyone tell you otherwise

CS61A Notes Week 6: Scheme1, Data Directed Programming You Are Scheme and don t let anyone tell you otherwise CS61A Notes Week 6: Scheme1, Data Directed Programming You Are Scheme and don t let anyone tell you otherwise If you re not already crazy about Scheme (and I m sure you are), then here s something to get

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

JAVA: A Primer. By: Amrita Rajagopal

JAVA: A Primer. By: Amrita Rajagopal JAVA: A Primer By: Amrita Rajagopal 1 Some facts about JAVA JAVA is an Object Oriented Programming language (OOP) Everything in Java is an object application-- a Java program that executes independently

More information

Chapter 8: Class and Method Design

Chapter 8: Class and Method Design Chapter 8: Class and Method Design Objectives Become familiar with coupling, cohesion, and connascence. Be able to specify, restructure, and optimize object designs. Be able to identify the reuse of predefined

More information

Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded

Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded improvements to Unix. There are actually two fairly different

More information

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized around the notion of procedures Procedural abstraction

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 9 Date:

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

15-498: Distributed Systems Project #1: Design and Implementation of a RMI Facility for Java

15-498: Distributed Systems Project #1: Design and Implementation of a RMI Facility for Java 15-498: Distributed Systems Project #1: Design and Implementation of a RMI Facility for Java Dates of Interest Assigned: During class, Friday, January 26, 2007 Due: 11:59PM, Friday, February 13, 2007 Credits

More information

15: Polymorphism & Virtual Functions

15: Polymorphism & Virtual Functions 15: Polymorphism & Virtual Functions 김동원 2003.02.19 Overview virtual function & constructors Destructors and virtual destructors Operator overloading Downcasting Thinking in C++ Page 1 virtual functions

More information

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9)

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) By: Mr.Prachet Bhuyan Assistant Professor, School of Computer Engineering, KIIT Topics to be Discussed 9.1 INTRODUCTION 9.2 THE O-O DESIGN PROCESS

More information

It s possible to get your inbox to zero and keep it there, even if you get hundreds of s a day.

It s possible to get your  inbox to zero and keep it there, even if you get hundreds of  s a day. It s possible to get your email inbox to zero and keep it there, even if you get hundreds of emails a day. It s not super complicated, though it does take effort and discipline. Many people simply need

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Lecture 22: Garbage Collection 10:00 AM, Mar 16, 2018

Lecture 22: Garbage Collection 10:00 AM, Mar 16, 2018 CS18 Integrated Introduction to Computer Science Fisler, Nelson Lecture 22: Garbage Collection 10:00 AM, Mar 16, 2018 Contents 1 What is Garbage Collection? 1 1.1 A Concrete Example....................................

More information

1 Achieving IND-CPA security

1 Achieving IND-CPA security ISA 562: Information Security, Theory and Practice Lecture 2 1 Achieving IND-CPA security 1.1 Pseudorandom numbers, and stateful encryption As we saw last time, the OTP is perfectly secure, but it forces

More information

08. DESIGN PRINCIPLES. Originality is Overrated PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT

08. DESIGN PRINCIPLES. Originality is Overrated PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 08. DESIGN PRINCIPLES Originality is Overrated it s not about doing it your way this week is all about doing it the smarter, faster way. Design principle

More information

Lecture 10 Notes Linked Lists

Lecture 10 Notes Linked Lists Lecture 10 Notes Linked Lists 15-122: Principles of Imperative Computation (Spring 2016) Frank Pfenning, Rob Simmons, André Platzer 1 Introduction In this lecture we discuss the use of linked lists to

More information

15 Sharing Main Memory Segmentation and Paging

15 Sharing Main Memory Segmentation and Paging Operating Systems 58 15 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

Object Oriented Programming

Object Oriented Programming Binnur Kurt kurt@ce.itu.edu.tr Istanbul Technical University Computer Engineering Department 1 Version 0.1.2 About the Lecturer BSc İTÜ, Computer Engineering Department, 1995 MSc İTÜ, Computer Engineering

More information

Rapid Software Testing Guide to Making Good Bug Reports

Rapid Software Testing Guide to Making Good Bug Reports Rapid Software Testing Guide to Making Good Bug Reports By James Bach, Satisfice, Inc. v.1.0 Bug reporting is a very important part of testing. The bug report, whether oral or written, is the single most

More information

XP: Backup Your Important Files for Safety

XP: Backup Your Important Files for Safety XP: Backup Your Important Files for Safety X 380 / 1 Protect Your Personal Files Against Accidental Loss with XP s Backup Wizard Your computer contains a great many important files, but when it comes to

More information

16 Sharing Main Memory Segmentation and Paging

16 Sharing Main Memory Segmentation and Paging Operating Systems 64 16 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Lecture 10 Notes Linked Lists

Lecture 10 Notes Linked Lists Lecture 10 Notes Linked Lists 15-122: Principles of Imperative Computation (Summer 1 2015) Frank Pfenning, Rob Simmons, André Platzer 1 Introduction In this lecture we discuss the use of linked lists to

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi. Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 18 Tries Today we are going to be talking about another data

More information

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends! Requirements Spec. Design Coding and Unit Testing Characteristics of System to be built must match required characteristics (high level) Architecture consistent views Software Engineering Computer Science

More information

QUIZ. Source:

QUIZ. Source: QUIZ Source: http://stackoverflow.com/questions/17349387/scope-of-macros-in-c Ch. 4: Data Abstraction The only way to get massive increases in productivity is to leverage off other people s code. That

More information

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides 1B1b Inheritance Agenda Introduction to inheritance. How Java supports inheritance. Inheritance is a key feature of object-oriented oriented programming. 1 2 Inheritance Models the kind-of or specialisation-of

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Deallocation Mechanisms. User-controlled Deallocation. Automatic Garbage Collection

Deallocation Mechanisms. User-controlled Deallocation. Automatic Garbage Collection Deallocation Mechanisms User-controlled Deallocation Allocating heap space is fairly easy. But how do we deallocate heap memory no longer in use? Sometimes we may never need to deallocate! If heaps objects

More information

Lecture 13: more class, C++ memory management

Lecture 13: more class, C++ memory management CIS 330: / / / / (_) / / / / _/_/ / / / / / \/ / /_/ / `/ \/ / / / _/_// / / / / /_ / /_/ / / / / /> < / /_/ / / / / /_/ / / / /_/ / / / / / \ /_/ /_/_/_/ _ \,_/_/ /_/\,_/ \ /_/ \ //_/ /_/ Lecture 13:

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 4: OO Principles - Polymorphism http://courses.cs.cornell.edu/cs2110/2018su Lecture 3 Recap 2 Good design principles.

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 43 Dynamic Binding (Polymorphism): Part III Welcome to Module

More information

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1 Design Principles Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques 2-1 Data Structures Data Structure - A systematic way of organizing and accessing

More information

Instantiation of Template class

Instantiation of Template class Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double

More information

The Dynamic Typing Interlude

The Dynamic Typing Interlude CHAPTER 6 The Dynamic Typing Interlude In the prior chapter, we began exploring Python s core object types in depth with a look at Python numbers. We ll resume our object type tour in the next chapter,

More information

Inheritance, Polymorphism, and Interfaces

Inheritance, Polymorphism, and Interfaces Inheritance, Polymorphism, and Interfaces Chapter 8 Inheritance Basics (ch.8 idea) Inheritance allows programmer to define a general superclass with certain properties (methods, fields/member variables)

More information

Back to ObjectLand. Contents at: Chapter 5. Questions of Interest. encapsulation. polymorphism. inheritance overriding inheritance super

Back to ObjectLand. Contents at: Chapter 5. Questions of Interest. encapsulation. polymorphism. inheritance overriding inheritance super korienekch05.qxd 11/12/01 4:06 PM Page 105 5 Back to ObjectLand Contents at: Chapter 5 #( encapsulation polymorphism inheritance overriding inheritance super learning the class hierarchy finding classes

More information

Object-Oriented Programming Paradigm

Object-Oriented Programming Paradigm Object-Oriented Programming Paradigm Sample Courseware Object-Oriented Programming Paradigm Object-oriented programming approach allows programmers to write computer programs by representing elements of

More information

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 00. WELCOME TO OBJECTVILLE. Speaking the Language of OO

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 00. WELCOME TO OBJECTVILLE. Speaking the Language of OO PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 00. WELCOME TO OBJECTVILLE Speaking the Language of OO COURSE INFO Instructor : Alper Bilge TA : Gökhan Çıplak-Ahmet Alkılınç Time : Tuesdays 2-5pm Location

More information

Object-Oriented Programming, Iouliia Skliarova

Object-Oriented Programming, Iouliia Skliarova Object-Oriented Programming, Iouliia Skliarova You reuse code by creating new classes, but instead of creating them from scratch, you use existing classes that someone else has built and debugged. In composition

More information

Math Dr. Miller - Constructing in Sketchpad (tm) - Due via by Friday, Mar. 18, 2016

Math Dr. Miller - Constructing in Sketchpad (tm) - Due via  by Friday, Mar. 18, 2016 Math 304 - Dr. Miller - Constructing in Sketchpad (tm) - Due via email by Friday, Mar. 18, 2016 As with our second GSP activity for this course, you will email the assignment at the end of this tutorial

More information

Software Service Engineering

Software Service Engineering Software Service Engineering Lecture 4: Unified Modeling Language Doctor Guangyu Gao Some contents and notes selected from Fowler, M. UML Distilled, 3rd edition. Addison-Wesley Unified Modeling Language

More information

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist In Handout 28, the Guide to Inductive Proofs, we outlined a number of specifc issues and concepts to be mindful about when

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

1 2 http://www.d.umn.edu/~gshute/softeng/object-oriented.html Polymorphism and overloading can lead to confusion if used excessively. However, the capability of using words or names to mean different things

More information

Reengineering II. Transforming the System

Reengineering II. Transforming the System Reengineering II Transforming the System Recap: Reverse Engineering We have a detailed impression of the current state We identified the important parts We identified reengineering opportunities We have

More information

Excel programmers develop two basic types of spreadsheets: spreadsheets

Excel programmers develop two basic types of spreadsheets: spreadsheets Bonus Chapter 1 Creating Excel Applications for Others In This Chapter Developing spreadsheets for yourself and for other people Knowing what makes a good spreadsheet application Using guidelines for developing

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

Ch. 11: References & the Copy-Constructor. - continued -

Ch. 11: References & the Copy-Constructor. - continued - Ch. 11: References & the Copy-Constructor - continued - const references When a reference is made const, it means that the object it refers cannot be changed through that reference - it may be changed

More information

Outline Key Management CS 239 Computer Security February 9, 2004

Outline Key Management CS 239 Computer Security February 9, 2004 Outline Key Management CS 239 Computer Security February 9, 2004 Properties of keys Key management Key servers Certificates Page 1 Page 2 Introduction Properties of Keys It doesn t matter how strong your

More information

How to Get Your Inbox to Zero Every Day

How to Get Your Inbox to Zero Every Day How to Get Your Inbox to Zero Every Day MATT PERMAN WHATSBESTNEXT.COM It s possible to get your email inbox to zero and keep it there, even if you get hundreds of emails a day. It s not super complicated,

More information

Heap Management. Heap Allocation

Heap Management. Heap Allocation Heap Management Heap Allocation A very flexible storage allocation mechanism is heap allocation. Any number of data objects can be allocated and freed in a memory pool, called a heap. Heap allocation is

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java

Object-Oriented Software Engineering Practical Software Development using UML and Java Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes Lecture 5 5.1 What is UML? The Unified Modelling Language is a standard graphical

More information

The Surface Plane. Sensory Design

The Surface Plane. Sensory Design The Surface Plane Sensory Design The Surface Plane At the top of the five-plane model, we turn our attention to those aspects of the product our users will notice first: the sensory design. Here, content,

More information

Advanced Programming & C++ Language

Advanced Programming & C++ Language Advanced Programming & C++ Language ~6~ Introduction to Memory Management Ariel University 2018 Dr. Miri (Kopel) Ben-Nissan Stack & Heap 2 The memory a program uses is typically divided into four different

More information

QUIZ. What are 3 differences between C and C++ const variables?

QUIZ. What are 3 differences between C and C++ const variables? QUIZ What are 3 differences between C and C++ const variables? Solution QUIZ Source: http://stackoverflow.com/questions/17349387/scope-of-macros-in-c Solution The C/C++ preprocessor substitutes mechanically,

More information

A Comparison of Unified Parallel C, Titanium and Co-Array Fortran. The purpose of this paper is to compare Unified Parallel C, Titanium and Co-

A Comparison of Unified Parallel C, Titanium and Co-Array Fortran. The purpose of this paper is to compare Unified Parallel C, Titanium and Co- Shaun Lindsay CS425 A Comparison of Unified Parallel C, Titanium and Co-Array Fortran The purpose of this paper is to compare Unified Parallel C, Titanium and Co- Array Fortran s methods of parallelism

More information

Lecture 3: Linear Classification

Lecture 3: Linear Classification Lecture 3: Linear Classification Roger Grosse 1 Introduction Last week, we saw an example of a learning task called regression. There, the goal was to predict a scalar-valued target from a set of features.

More information

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed. Preface Here are my online notes for my Algebra course that I teach here at Lamar University, although I have to admit that it s been years since I last taught this course. At this point in my career I

More information

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design Computer Science 4U Unit 1 Programming Concepts and Skills Modular Design Modular Design Reusable Code Object-oriented programming (OOP) is a programming style that represents the concept of "objects"

More information

Polymorphism. Miri Ben-Nissan (Kopel) Miri Kopel, Bar-Ilan University

Polymorphism. Miri Ben-Nissan (Kopel) Miri Kopel, Bar-Ilan University Polymorphism Miri Ben-Nissan (Kopel) 1 Shape Triangle Rectangle Circle int main( ) Shape* p = GetShape( ); p->draw( ); Shape* GetShape( ) choose randomly which shape to send back For example: Shape* p

More information

6.001 Notes: Section 1.1

6.001 Notes: Section 1.1 6.001 Notes: Section 1.1 Slide 1.1.1 This first thing we need to do is discuss the focus of 6.001. What is this course all about? This seems quite obvious -- this is a course about computer science. But

More information

Forth Meets Smalltalk. A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman

Forth Meets Smalltalk. A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman Forth Meets Smalltalk A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman 1 CONTENTS WHY FMS? NEON HERITAGE SMALLTALK HERITAGE TERMINOLOGY EXAMPLE FMS SYNTAX ACCESSING OVERRIDDEN METHODS THE

More information

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern Think of drawing/diagramming editors ECE450 Software Engineering II Drawing/diagramming editors let users build complex diagrams out of simple components The user can group components to form larger components......which

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

ECE 3574: Dynamic Polymorphism using Inheritance

ECE 3574: Dynamic Polymorphism using Inheritance 1 ECE 3574: Dynamic Polymorphism using Inheritance Changwoo Min 2 Administrivia Survey on class will be out tonight or tomorrow night Please, let me share your idea to improve the class! 3 Meeting 10:

More information

Smoother Graphics Taking Control of Painting the Screen

Smoother Graphics Taking Control of Painting the Screen It is very likely that by now you ve tried something that made your game run rather slow. Perhaps you tried to use an image with a transparent background, or had a gazillion objects moving on the window

More information

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read) 1 For the remainder of the class today, I want to introduce you to a topic we will spend one or two more classes discussing and that is source code control or version control. What is version control?

More information

POLYMORPHISM Polymorphism: the type Polymorphism taking many shapes type of object

POLYMORPHISM Polymorphism: the type Polymorphism taking many shapes type of object 1 License: http://creativecommons.org/licenses/by-nc-nd/3.0/ POLYMORPHISM There are three major concepts in object-oriented programming: 1. Encapsulation (Classes), Data abstraction, information hiding

More information

Object Relationships

Object Relationships Object Relationships Objects can work together in three different types of relationships: Uses: An object can use another to do some work (association). Composition: A complex object may be composed of

More information

CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance

CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance Handout written by Julie Zelenski, updated by Jerry. Inheritance is a language property most gracefully supported by the object-oriented

More information

CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES.

CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES. CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES www.asyrani.com TOPICS COVERED C++ Review and Best Practices Data, Code, and Memory in C++ Catching and Handling Errors C++ REVIEW AND BEST PRACTICES

More information

Reminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults

Reminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults CSE 451: Operating Systems Autumn 2012 Module 12 Virtual Memory, Page Faults, Demand Paging, and Page Replacement Reminder: Mechanics of address translation virtual address virtual # offset table frame

More information

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring Java Outline Java Models for variables Types and type checking, type safety Interpretation vs. compilation Reasoning about code CSCI 2600 Spring 2017 2 Java Java is a successor to a number of languages,

More information

A simple problem that has a solution that is far deeper than expected!

A simple problem that has a solution that is far deeper than expected! The Water, Gas, Electricity Problem A simple problem that has a solution that is far deeper than expected! Consider the diagram below of three houses and three utilities: water, gas, and electricity. Each

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information