Software Engineering Basics

Slides:



Advertisements
Similar presentations
Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Abstraction Lecture-4. ADT example: London Underground Map.
Classes & Objects Computer Science I Last updated 9/30/10.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
OBJECT ORIENTED PROGRAMMING
Designing Classes OO Software Design and Construction Computer Science Dept Va Tech January 2002 ©2002 McQuain WD & Keller BJ 1 Designing the Classes Once.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
©Fraser Hutchinson & Cliff Green C++ Certificate Program C++ Intermediate Decorator, Strategy, State Patterns.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
C++ Inheritance Data Structures & OO Development I 1 Computer Science Dept Va Tech June 2007 © McQuain Generalization versus Abstraction Abstraction:simplify.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Topic 2 Collections. 2-2 Objectives Define the concepts and terminology related to collections Discuss the abstract design of collections.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
MAITRAYEE MUKERJI Object Oriented Programming in C++
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Design Concepts ch-8
CSC 222: Computer Programming II
Object-Oriented Programming Basics
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Concepts of Object Orientation
11.1 The Concept of Abstraction
Software Quality Engineering
Lecture 2 of Computer Science II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
 DATAABSTRACTION  INSTANCES& SCHEMAS  DATA MODELS.
Advanced Programming Behnam Hatami Fall 2017.
Object-Oriented Programming
Chapter 20 Object-Oriented Analysis and Design
DESIGNING YOUR SYSTEM.
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Object-Oriented Programming
An Introduction to Software Architecture
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Introduction to Data Structure
Object-Oriented Programming
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Design Strategies in OO Development
Object-Oriented PHP (1)
CS 2704 Object Oriented Software Design and Construction
Information Hidding Dr. Veton Kepuska.
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
From Use Cases to Implementation
11.1 The Concept of Abstraction
Abstract Types Defined as Classes of Variables
Presentation transcript:

Software Engineering Basics Progression of Roles Design Strategies in OO Programming Abstraction Practical Abstraction Better Abstractions Mapping Abstraction to Software Separation of Interface from Implementation Interchangeability of Implementations Specificity of Interface Mapping Abstraction to Software in OO General Structure of a Class General Structure of an Object Multiple Instances of a Class Software Engineering Goals Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Progression of Roles Kafura Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Design Strategies in OO Programming Abstraction modeling essential properties Separation treat what and how independently Composition building complex structures from simpler ones Generalization identifying common elements abstraction separation composition generalization Design Strategies objects classes inheritance templates design patterns Software Structures extensibility flexibility reusability Software Engineering Goals Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Abstraction Modeling entities in software Only essential aspects should be captured attributes behavior Hills, buildings and cossacks with lances. The artist only shows the essential, distinguishing characteristics of each entity. Modeling entities (real world or conceptual) in software An abstraction distills something to its essential properties. The properties that make it what it is and distinguish it from others. Simplifies complex problems Only essential aspects should be included: attributes = properties, characteristics, information behavoir = actions When you say “car,” people get a picture of a generic, or “abstract,” thing with certain properties: wheels, speed, direction, number of passengers, number of axles and behavior: accelerate, brake, stop, turn right, turn left, etc. Wassily Kandinski Cossacks, 1910-11 Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Practical Abstraction Practical abstractions. These shapes convey the essential distinguishing characteristics of a male and female (in our society). Critique?? Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Abstraction A named collection of attributes and behavior relevant to modeling a given entity for some particular purpose. Desirable Properties: well named name conveys aspects of the abstraction coherent makes sense accurate contains only attributes modeled entity contains minimal contains only attributes needed for the purpose complete contains all attributes and behavior needed for the purpose But for software, an abstraction is not a philosophical, ethereal concern. In development, abstractions are refined throughout the life of a piece of software. We start with hand-made lists, and progress through various formal methods, sometimes using software tools. The implementation in source code is the ultimate expression of a software abstraction. Name: to distinguish from other abstractions Attributes and behavior: the essential elements of an abstraction. Modeling: what software is all about Purpose: appropriate abstractions are different for different purposes. Book example of a salesperson abstraction from two perspectives. One is the sales system, number of cars sold is important other is medical system, which couldn’t care less about number sold Well named: clearly conveys aspects of the abstraction Whether it is meaningful depends on the audience. Coherent: makes sense Accurate: contains only the attributes the modeled entity contains. Note VR exception Minimal: only the attributes needed for the purpose of the abstraction. For example, hair color is irrelevant for a billing system. Complete: All the attributes and behavior needed for the purpose of the software. These are all subjective. Judgement through experience are needed. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

WOMEN MEN Better Abstractions These abstractions illustrates properties of a “good” abstraction: well named (for English-speakers) coherent accurate (culture sensitive representations – Scotland?, ME?) minimal complete Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Mapping Abstraction to Software real-world abstraction software entity attributes behavior {data, data,…} {method, method,…} Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Separation of Interface from Implementation In programming, the independent specification of an interface and one or more implementations of that interface. Interface Implementation visible hidden What is to be done vs How it is to be done What is to be done versus How it is done what/how, goal/plan, policy/mechanism, product/process, ends/means Simpler to express what versus how. Requirements analysis specifies what, programmers implement the how. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Interchangeability of Implementations Allows the creation of multiple implementations with a common interface. For example: a List ADT could use a dynamic linked list or a dynamic array for the underlying physical data structure. In either case, the same interface would be appropriate (and the user need not be concerned with the underlying structure in many cases). interface implementation2 implementation1 Flexibility. Different implementations can satisfy the same interface. Perhaps the implementations differ in price, reliability, location, etc. Implementations of the same interface are called “plug compatible” Implementations that share a common interface are said to be “plug compatible”. They may differ in algorithmic complexity, reliability, platform dependencies, etc. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Specificity of Interface Also allows a single implementation to support multiple interfaces. This allows the isolation of restricted set used in one situation versus another LList implementation Stack For example, we could have a very general List ADT that supported both standard List operations, and also Stack operations. By “subsetting” the functionality of the ADT into separate interfaces, we could provide both categories of operation, in a natural way, without duplication of shared code. In essence, we view the implementation as a library of related widgets. An implementation can satisfy more than one interface. This allows the isolation of restricted set used in one situation versus another Suppose there is a more efficient implementation of TextInterface that we want to use in a critical part of the system. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Mapping Abstraction to Software in OO real-world abstraction OO software entity attributes behavior {data, data,…} {method, method,…} You can model an abstraction in any software language. Prior to O-O, the notion of encapsulating data and operations together was called an Abstract Data Type. But O-O facilitates modeling these kinds of abstractions by using Classes and Objects Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

General Structure of a Class class: a named software representation for an abstraction that separates the implementation of the representation from the interface of the representation A class models an abstraction, which models an entity (possibly “real”). A class represents all members of a group of objects (“instances” of the class). A class provides a public interface and a private implementation. The hiding of the data and “algorithm” from the user is important. Access restrictions prevent idle or malicious alterations. The software model of an abstraction. Class is the definition of the attributes and behavior with implementation. “Class” is used to convey that it represents all members of a group Separation: two parts to a class, public interface, private data and implementation. Hiding data is important so that other developers using the class do not erroneously change it. Hide it and they cannot get to it. Private implementation also hides the algorithm. This is sometimes called “encapsulation.” Class: a named software representation for an abstraction that separates the implementation of the representation from the interface of the representation. Some OO languages do not use classes. E.g., “Self” uses prototypes private public className {data, data, ….} {method,method, …} typical organization Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

General Structure of an Object object: a distinct instance of a given class that encapsulates its implementation details and is structurally identical to all other instances of that class An object “encapsulates” its data and the operations that may be performed on that data. An object’s private data may ONLY be accessed via the member functions defined within the object’s class. An object hides details of representation and implementation from the user. code . data method implementation interface A specific member of a class. Interface and Implementation are separate The object “encapsulates” its data Encapsulation: in o-o programming, the restriction of access to data within an object to only those members defined by the object’s class. Multiple objects are created from a single class definition. Object: A distinct instance of a given class that encapsulates its implementation details and is structurally identical to all other instances of that class. C++ note: Privacy restrictions are enforced at the class level, NOT the object level. That is, if A and B are of the same type, and A knows B’s name, then A can access the private members of B directly. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Multiple Instances of a Class SalesPerson private public Name commissionRate totalSales sellCar reportSales Joe Hokie 16% $250.000 Jill Hokie $275.000 Each instance, or object, usually has different values for the class-defined properties. Class = Factory Objects = Products Each instance, or object, usually has different values for the class-defined properties. Class=Factory Objects=products Side point (if there’s time) When developing abstractions, or classes, it may help to think of them as people-like entities with responsibilities and collaborators . Responsibilities of knowing (respond with information to a query) Responsibilities of doing (act on something, transform, move, sort, etc.) Collaborators: associated objects in the system with their own responsibilities (association is next week) When developing abstractions, or classes, it may help to think of them as people-like entities with responsibilities and collaborators. Responsibilities of knowing (respond with information to a query) Responsibilities of doing (act on something, transform, move, sort, etc.) Collaborators: associated objects in the system with their own responsibilities Computer Science Dept Va Tech January 2000 ©2000 McQuain WD

Software Engineering Goals Objects and classes help programmers achieve a primary software-engineering goal: reusability A single class is used repeatedly to create multiple object instances. More importantly, encapsulation prevents other developers from inadvertently modifying an object’s data. Separation allows different implementations to be used for an interface. objects classes inheritance templates design patterns Software Structures extensibility flexibility reusability Software Engineering Goals Objects and classes help programmers achieve a primary software-engineering goal: reusability A single class is used repeatedly to create multiple object instances. More importantly, encapsulation prevents other developers from inadvertently modifying an object’s data. Separation allows different implementations to be used for an interface. Computer Science Dept Va Tech January 2000 ©2000 McQuain WD