22C:22 (CS:2820) Object-Oriented Software Development

Similar documents
22C:22 (CS:2820) Object-Oriented Software Development

OOP? What is OOP? Why? OOP in a nutshell. Stéphane Ducasse 2.1

Quotes from Object-Oriented Software Construction

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Programming Languages

Functional Decomposition Top-Down Development

a. Inheritance b. Abstraction 1. Explain the following OOPS concepts with an example

Glossary of Object Oriented Terms

Object-Oriented Databases

How To Design Software

Semantic Analysis: Types and Type Checking

Object Oriented Design

Algorithms, Flowcharts & Program Design. ComPro

Java (12 Weeks) Introduction to Java Programming Language

Formal Engineering for Industrial Software Development

Object-Oriented Software Specification in Programming Language Design and Implementation

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Semester Review. CSC 301, Fall 2015

CSE 307: Principles of Programming Languages

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

Server-Side Scripting and Web Development. By Susan L. Miertschin

Fourth generation techniques (4GT)

Java Interfaces. Recall: A List Interface. Another Java Interface Example. Interface Notes. Why an interface construct? Interfaces & Java Types

Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example

Software Engineering

KWIC Exercise. 6/18/ , Spencer Rugaber 1

Options. Acquiring an application. Custom development. Off-the-shelf. Trade-off. Outsourcing development

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

11 November

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

McGraw-Hill The McGraw-Hill Companies, Inc.,

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!

opalang - Rapid & Secure Web Development

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

History OOP languages Year Language 1967 Simula Smalltalk

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

1/20/2016 INTRODUCTION

Description of Class Mutation Mutation Operators for Java

Lecture 1: Introduction

Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

CSE 130 Programming Language Principles & Paradigms

Basic Programming and PC Skills: Basic Programming and PC Skills:

Web Development in Java

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

CS 106 Introduction to Computer Science I

Tutorial on Writing Modular Programs in Scala

Structural Design Patterns Used in Data Structures Implementation

Programming and Software Development CTAG Alignments

Aspects for Testing Aspects?

Chapter 24 - Quality Management. Lecture 1. Chapter 24 Quality management

Information and Communications Technology Courses at a Glance

Verifying Semantic of System Composition for an Aspect-Oriented Approach

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Object-Oriented Analysis & Design

The C Programming Language course syllabus associate level

Programming Languages

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Chapter 1 Fundamentals of Java Programming

Object Oriented Databases (OODBs) Relational and OO data models. Advantages and Disadvantages of OO as compared with relational

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111

Programming in C# with Microsoft Visual Studio 2010

Java Application Developer Certificate Program Competencies

Multiple Dispatching. Alex Tritthart WS 12/13

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

On Understanding Types, Data Abstraction, and Polymorphism

CHAPTER 1 ENGINEERING PROBLEM SOLVING. Copyright 2013 Pearson Education, Inc.

CSCI 3136 Principles of Programming Languages

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

TOWARDS A GREEN PROGRAMMING PARADIGM FOR MOBILE SOFTWARE DEVELOPMENT

On Understanding Types, Data Abstraction, and Polymorphism

JAVA - INHERITANCE. extends is the keyword used to inherit the properties of a class. Below given is the syntax of extends keyword.

Chapter 6: Programming Languages

Checking Access to Protected Members in the Java Virtual Machine

Formal Specification and Verification of Avionics Software

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

Unit I Page No. 1 System Development Object Basics Development Life Cycle Methodologies Patterns Frameworks Unified Approach UML

Introduction to Programming Block Tutorial C/C++

Definitions. Software Metrics. Why Measure Software? Example Metrics. Software Engineering. Determine quality of the current product or process

Chapter 1: Key Concepts of Programming and Software Engineering

Applying Object-Oriented Principles to the Analysis and Design of Learning Objects

Exercise 8: SRS - Student Registration System

Implementation Aspects of OO-Languages

Rigorous Software Development CSCI-GA

Cohort: BCA/07B/PT - BCA/06/PT - BCNS/06/FT - BCNS/05/FT - BIS/06/FT - BIS/05/FT - BSE/05/FT - BSE/04/PT-BSE/06/FT

Principles of Software Construction: Objects, Design, and Concurrency. Course Introduction. toad. toad Fall School of Computer Science

Objects and classes. Objects and classes. Jarkko Toivonen (CS Department) Programming in Python 1

Aspect-Oriented Programming

Computer Programming I

Object-Oriented Programming

Fundamentals of Java Programming

Classes and Objects. Agenda. Quiz 7/1/2008. The Background of the Object-Oriented Approach. Class. Object. Package and import

ABET General Outcomes. Student Learning Outcomes for BS in Computing

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

C H A P T E R Regular Expressions regular expression

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Transcription:

The University of Iowa 22C:22 (CS:2820) Object-Oriented Software Development Fall 2012 The Object Model by Cesare Tinelli

The Object Model of Development Built on the best ideas from previous technologies Influenced by major trends in software engineering: 1. increased focus on programming-inthe-large 2. evolution of high-level programming languages

Object in Object-Oriented Programming Languages Entity that combines features of procedures: performs computations data: stores local state is characterized by certain invariants

Essence of OO Programming Programs are organized as cooperative collections of objects Each object is an instance of some class Classes are related via an inheritance relationship

OO Analysis Builds a model of the real-world using an object-oriented view Examines requirements in terms of classes and objects found in the problem domain

OO Design Leads to an object-oriented decomposition Uses various notations to express various views of the system being designed: logical (classes and objects) vs. physical structure (modules and processes) static vs. dynamic aspects

OO Software Development The products of OO Analysis serve as starting points for OO Design The products of OO Design serve as blueprints for an OO implementation

The Object Model of Development Is built on the synergy among: abstraction encapsulation modularity typing concurrency persistence hierarchy

Abstraction The process of identifying similarities between objects, situations or processes and ignoring their differences A description, or specification, of something that emphasizes some details or properties while ignoring others It focuses on the essential characteristics of something relative to a viewer's perspective

Abstraction Main trait: it can be understood and analyzed independently on how it is realized Quality: it is relative to its viewers/users and their current needs Establishing the right set of abstractions for a problem domain is the main challenge of design

Abstraction in OO Design We can characterize the behavior of an object, the server, in terms of the services it provides to other objects, the clients An object's abstraction defines a contract that other objects depend on and that must be honored by the object This contract establishes all assumptions a client may make about the behavior of the server

Design by Contract Each service (operation) provided by an object has a set of preconditions, to be satisfied by the client when invoking the service postconditions, guaranteed by the server upon completion of the service invariants, properties maintained between operations

Abstraction Examples Temperature Sensor Point on a plane

The Object Model of Development Is built on the synergy among: abstraction encapsulation modularity typing concurrency persistence hierarchy

Encapsulation The abstraction of an object should precede any decisions about its implementation Implementation details should not be accessible to clients Encapsulation is the process of hiding such details

Encapsulation Achieved in OO languages by hiding the internals of an object (attributes and method implementations) It greatly facilitates changes that do not impact the abstraction (i.e., the object's contract) Leads to a clear separation of concerns (contract vs way to honor it) Localizes design decisions likely to change

Encapsulation in OO Languages Classes of objects described in two parts: interface captures outside view of the object and its essential behavior implementation provides a representation of the abstraction and the mechanisms to achieve its behavior

Encapsulation Examples Heater Heater Controller Point on plane

The Object Model of Development Is built on the synergy among: abstraction encapsulation modularity typing concurrency persistence hierarchy

Modularity Modularization divides a software systems into components, modules Modules may have connections to other modules but can be compiled separately encapsulate sets of classes and objects have an interface and an implementation

Crucial Point Classes and objects define a system's logical structure Modules define a system's physical structure The two structures are by and large orthogonal

Module Decomposition Decomposing a system into module presents challenging design decisions There is a tension between the desire to encapsulate abstractions vs need to expose some of them to other modules General approach: group together logically related classes and objects and expose only those that are strictly necessary to other modules

Modularity Desiderata of module decomposition: modules designed and implemented independently modules simple enough to be fully understandable can change a module's implementation without knowing that of other modules affecting their behavior reuse

The Object Model of Development Is built on the synergy among: abstraction encapsulation modularity typing concurrency persistence hierarchy

Hierarchy A (partial) ordering of abstractions Most important hierarchies "is a" relation (class structure) "part of" relation (object structure)

Class Structure The "is a" relation we consider is one that relates classes Examples A dog is a mammal A dog is a pet Fido is a dog (Fido is not a class)

Class Structure When B is A we also say that B is a subclass of A: every instance of B is an instance of A B extends (or specializes) A: B has all features and behaviors of A, and possibly more B inherits from A: B inherits A's features and behaviors

Class Structure When B is A we also say, symmetrically, that A is a superclass of B: every instance of B is an instance of A A is extended by (or generalizes) B: B has all features and behaviors of A, and possibly more

Inheritance Hierarchies Single inheritance: each class extends (inherits from) at most one class the hierarchy is a tree, or a forest Multiple inheritance: each class extends one or more classes the hierarchy is graph

Inheritance is a A Q B C P R S D E F T U V Single inheritance Multiple inheritance

The Object Model of Development Is built on the synergy among: abstraction encapsulation modularity typing concurrency persistence hierarchy

Typing in Programming Languages A type is a collection of values with same structural or behavioral properties Ex: integer, string, integer list, integer array, integer and string pair,... The type system of a language imposes a division of values into types defines typing restrictions for each operation (allowed input types, resulting output type)

Types in Programming Languages A language is typed if it enforces a type system It is untyped otherwise, that is, if it allows operations to be applicable to any values Note: Most highly-level languages are typed to some degree (strongly/weakly typed) All assembly languages are untyped

Types in OO Programming Languages Every class defines a type, consisting of all objects that are instances of that class However, not all types are classes. E.g.: Java's basic types (int, bool,...) Java's interfaces function types in Scala

Static vs Dynamic Typing Statically typed languages enforce typing restrictions at compile time: the type of each expression denoting a value is determined and checked before running the program Dynamically typed languages enforce typing restrictions at run time: types are determined and checked as expressions are evaluated

Static vs Dynamic Typing In statically typed languages types are associated to expressions in the source code C++, Java, Scala, ML, Haskell,... In dynamically typed languages types are associated to values in memory Python, Ruby, Perl, Javascript,...

Enhanced Type Systems Overloading: same name for different operations E.g.: + for integer addition, string concatenation, list append in Scala Subtypes: types extending others E.g.: subclassing in OO languages Subtype polymorphism: same name for inherited operations E.g.: inherited methods in OO languages

Enhanced Type Systems Parametric types: structured types with components of arbitrary type E.g.: List[X], Array[X], List[(X,Y)] for any types X, Y in Scala Parametric polymorphism: generic operations for parametric types E.g.: reverse: (l:list[x]) List[X], head:(l:list[x]) X in Scala