Accessibility. EEC 521: Software Engineering. Classes and Objects. Inheritance. Classes and Objects (OO Analysis)

Similar documents
Introduction to UML. Danang Wahyu utomo

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Object-Oriented Design

Unified Modeling Language (UML) and Modeling

Notation Part 1. Object Orientated Analysis and Design. Benjamin Kenwright

Object-Oriented Systems Analysis and Design Using UML

Object Orientated Analysis and Design. Benjamin Kenwright

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

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

OO System Models Static Views

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

Chapter 5 Object-Oriented Programming

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

Object-Oriented Design

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Relationships. Association Aggregation/Composition Multiplicity Dependencies

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

06. Analysis Modeling

Unified Modeling Language (UML) Class Diagram

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

Basic Structural Modeling. Copyright Joey Paquet,

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

UML Class Diagrams Revisited

Architecture and the UML

VEL TECH HIGH TECH Dr. RANGARAJAN Dr. SAKUNTHALA ENGINEERING COLLEGE UNIT 1 UML DIAGRAMS

Object-Oriented Analysis and Design Using UML (OO-226)

Object-Oriented Development and UML. Announcement. Agenda 7/3/2008. Class will resume on July 22. Try to complete the lab assignments by July.

Static Modeling. SWE 321 Fall2014

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Course 3 7 March

Software Architectures. Lecture 6 (part 1)

Object-Oriented Analysis and Design Using UML

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

UML Primer. -Elango Sundaram

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far

Software Service Engineering

Programming II (CS300)

What are the characteristics of Object Oriented programming language?

Chapter 2: The Object-Oriented Design Process

Object Oriented Modeling

Object-Oriented Modeling Using UML. CS151 Chris Pollett Aug. 29, 2005.

COURSE 2 DESIGN PATTERNS

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

Unified Modeling Language (UML)

Chapter 10 Object-Oriented Design Principles

ITEC420: Software Engineering Lecture 3: Recap OO/UML Requirement Workflow

Inheritance and Polymorphism

Object-oriented development. Object-oriented Design. Objectives. Characteristics of OOD. Interacting objects. Topics covered

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Unified Modeling Language (UML)

Object-Oriented Design

CHAPTER 9 DESIGN ENGINEERING. Overview

An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Architectural Blueprint

Final Exam. Final Exam Review. Ch 1: Introduction: Object-oriented analysis, design, implementation. Exam Format

Exam in TDDB84: Design Patterns,

Introduction to Unified Modelling Language (UML)

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

LABORATORY 1 REVISION

Interactions A link message

Chapter 5: Procedural abstraction. Function procedures. Function procedures. Proper procedures and function procedures

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC

Requirements & Domain Models. Lecture 13: Object Oriented Modelling. Nearly anything can be an object. Object Oriented Analysis

UNIT-4 Behavioral Diagrams

SOFTWARE MODELING AND DESIGN. UML, Use Cases, Patterns, and. Software Architectures. Ki Cambridge UNIVERSITY PRESS. Hassan Gomaa

Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP)

CASE TOOLS LAB VIVA QUESTION

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

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

SDC Design patterns GoF

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Design Patterns. Design Patterns 1. Outline. Design Patterns. Bicycles Simulator 10/26/2011. Commonly recurring patterns of OO design

SEEM4570 System Design and Implementation Lecture 11 UML

Chapter 1: Principles of Programming and Software Engineering

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships.

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Object-Oriented and Classical Software Engineering

Allenhouse Institute of Technology (UPTU Code : 505) OOT Notes By Hammad Lari for B.Tech CSE V th Sem

Object-Oriented Analysis Phase

Object-Oriented Analysis Phase

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

CS 520 Theory and Practice of Software Engineering Fall 2018

SE 1: Software Requirements Specification and Analysis

1. Introduction to Object Oriented Software Development

SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY

Compositional Model Based Software Development

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

(C) 2010 Pearson Education, Inc. All rights reserved. Dr. Marenglen Biba

10조 이호진 이지 호

Chapter 1: Programming Principles

Transcription:

Accessibility EEC 521: Software Engineering Classes and Objects (OO Analysis) Attributes and Methods can be declared at three levels of accessibility Public (+) Visible everywhere Private (-) Visible only from inside the declaring class Protected (#) Visible only from within the declaring class and any of its subclasses We will all now swear never to declare public attributes 9/22/09 EEC 521: Software Engineering 1 9/22/09 EEC 521: Software Engineering 3 Classes and Objects A class consists of a set of attributes and methods. A class diagram is used to show the static structure of a class AnsweringMachine -greeting -messages +setgreeting() +getmessages() +recordmessage() Class name Attributes Methods Each class is like a template that defines how instances of the class objects should be created classes objects 9/22/09 EEC 521: Software Engineering 2 Inheritance Inheritance allows a subclass to inherit the attributes and methods of a superclass AnsweringMachine -greeting -messages +setgreeting() +getmessages() +recordmessage() Inherits from or Specializes AnsweringMachineWithTime -time +settime() A subclass begins with everything provided by its superclass (or base class) Can add additional attributes and methods Can override existing public/protected methods 9/22/09 EEC 521: Software Engineering 4

Inheritance Hierarchy Other Relationships An inheritance hierarchy (or class hierarchy) refers to all of the classes in a system, and the inheritance relations among them Depending on the type of system being developed, the class hierarchy can be complex! PartA Whole PartB Collection Items http://java.sun.com/javase/7/docs/api/ http://msdn.microsoft.com/en-us/library/ms229335.aspx 9/22/09 EEC 521: Software Engineering 5 Composition Aggregation Defines a whole/part Defines a containment relationship relationship Multiplicity may be specified in either case 9/22/09 EEC 521: Software Engineering 7 Associations Just like data objects, classes can be related to one another. These relationships are called associations Phone -phonenumber +getphonenumber() +dialphone() +answerphone() direction * 1 Handles calls for AnsweringMachine -greeting -messages +setgreeting() +getmessages() +recordmessage() Identifying Analysis Classes We begin with a grammatical parse Nouns Candidate classes External entities, events, places, structures, things, etc. Candidate attributes Entities that naturally belong to a class Verbs Candidate methods Operations that manipulate data Operations that perform a computation Operations that inquire about state Operations that check for a control event multiplicity 9/22/09 EEC 521: Software Engineering 6 9/22/09 EEC 521: Software Engineering 8

Building the OOA Model Use the initial set of analysis classes as the basis for building the OOA model Identify class responsibilities What are its primary jobs? Identify class relationships and collaborations What other classes does it need to interact with? How will they interact? Identify class commonalities and variabilities Which attributes/methods do they have in common? Which attributes/methods vary? This will be an iterative process! 9/22/09 EEC 521: Software Engineering 9 Distribution, Cohesion, and Encapsulation Some additional model desiderata Responsibility distribution Intelligence should be distributed across classes Avoid monolithic classes Class cohesion Classes should be single minded Avoid classes with unrelated members Encapsulation The class with the data should do the work Avoid passing state to other classes 9/22/09 EEC 521: Software Engineering 11 Some Rules of Thumb Focus on the problem Identify what classes/attributes Ignore how classes/attributes Focus on core classes Eliminate procedural classes Avoid data classes Avoid classes with only a single attribute Use (don t overuse) inheritance intelligently Move commonalities up the hierarchy Move variabilities down the hierarchy Avoid deep hierarchies Categorization Categorization is one of the most important tools in our intellectual toolbox How do we manage (intellectually) a large number of related items? We group the items into categories of items that share common characteristics or satisfy common goals In object-oriented analysis, we categorize classes using analysis packages 9/22/09 EEC 521: Software Engineering 10 9/22/09 EEC 521: Software Engineering 12

Analysis Packages An analysis package is a collection of related analysis classes grouped under a representative name package name classes UML notation Why Model? Capture and precisely state requirements Understand and capture design decisions Organize various design elements Explore multiple solutions economically Master complex systems accessibility modifiers Java, C#, and VB.NET use a similar notion for categorizing implementation classes 9/22/09 EEC 521: Software Engineering 13 9/22/09 EEC 521: Software Engineering 15 Levels of Models EEC 521: Software Engineering Introduction to the UML Guides to thought process - high-level models Abstract spec of essential structure Full spec of final system Exemplars of typical or possible systems Complete or partial descriptions of interactions 9/22/09 EEC 521: Software Engineering 14 9/22/09 EEC 521: Software Engineering 16

What is in a Model? Kinds of UML Models Semantics Semantics capture the meaning of the model Semantic information is the model Presentation Notation Organize model in usable way Context Presents model as a part of other interactions and entities Behavioral Models Use case diagrams Statechart diagrams Activity diagrams Sequence diagrams Collaboration diagrams Structural Models Class diagrams Object diagrams Component diagrams Deployment diagrams 9/22/09 EEC 521: Software Engineering 17 9/22/09 EEC 521: Software Engineering 19 The Unified Modeling Language The UML is a language for Visualizing Specifying Constructing Documenting the artifacts of a software-intensive system Use Case Diagram Serves to show user all possible uses of a system Model context of system Model requirements 9/22/09 EEC 521: Software Engineering 18 9/22/09 EEC 521: Software Engineering 20

Use Cases Class Diagram Relationships may exist among use cases Generalization Include Extend Shows all classes in system Shows relationships between classes Static structure 9/22/09 EEC 521: Software Engineering 21 9/22/09 EEC 521: Software Engineering 23 Activity Diagram Workflow modeling States Action states Activity states Transitions Branching Forking and joining Object Diagram Still static structure Expresses static part of an interaction Freezes a moment in time 9/22/09 EEC 521: Software Engineering 22 9/22/09 EEC 521: Software Engineering 24

Interaction Diagrams Component Diagram A sequence diagram emphasizes the time ordering of messages Table that shows objects arranged along the X axis and messages, ordered in increasing time, along the Y axis A collaboration diagram emphasizes the structural organization of the objects that send and receive messages collection of vertices and arcs Architectural modeling Model executables Model source code Static structure 9/22/09 EEC 521: Software Engineering 25 9/22/09 EEC 521: Software Engineering 27 Statechart Diagram State machine diagram showing flow of control Shows behavior Deployment Diagram Shows the configuration of runtime processing nodes and the components that live on them 9/22/09 EEC 521: Software Engineering 26 9/22/09 EEC 521: Software Engineering 28