Introduction to OOP and UML

Slides:



Advertisements
Similar presentations
Chapter 4 - Object-Oriented Analysis and Design in a Nutshell1 Chapter 4 Object-Oriented Analysis and Design in a Nutshell.
Advertisements

CS210 Intermediate Computing with Data Structures (Java)
Object Oriented Design and UML
Basic OOP Concepts and Terms
Principles of Object-Oriented Software Development Unified Modeling Language.
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
Unified Modeling Language(UML) BY
1 Object Oriented Design and UML Software Development Activities Object Oriented Design Unified Modeling Language (UML) Reading for this Lecture: L&L 6.1.
The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program.
1 Mass IT Course Fall 2008 Bob Wilson S
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
Software development process ธนวัฒน์ แซ่ เอียบ. The development process Process –set of rules which define how a development project. Methodology and.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
1 CS210 Intermediate Computing with Data Structures (Java) Saaid Baraty S-3-90.
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 15 The Unified Modeling Language: a Primer.
OOP Review CS 124.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Unified Modeling Language Introduction.
Object-Oriented Systems. Goals Object-Oriented Methodologies – The Rumbaugh et al. OMT – The Booch methodology – Jacobson's methodologies.
Copyright (C), No Magic, Inc Welcome to No Magic!
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Unified Modeling Language (UML)
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
SWE 214 (071) Introduction to UML Slide 1 Introduction to UML.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs.
Use Cases UML. Use Cases What are Use Cases?  A statement of the functionality users expect and need, organized by functional units  Different from.
Modeling with UML – Class Diagrams
Introduction to UML.
TCSS 305 (Stepp) OO Design with UML Class Diagrams
Unified Modeling Language (UML)
UML Diagrams By Daniel Damaris Novarianto S..
UNIT 1.
Evolution of UML.
Unified Modeling Language—UML A Very Brief Introduction
Introduction to the Unified Modeling Language
Object-Oriented Modeling with UML
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Systems Analysis and Design With UML 2
The Object-Oriented Thought Process Chapter 1
Introduction to Unified Modeling Language (UML)
University of Central Florida COP 3330 Object Oriented Programming
Software Design AITI GP John Paul Vergara.
SNSCT_CSE_PROGRAMMING PARADIGM_CS206
Introduction to Object Oriented Analysis, Design and Unified Modeling Language (UML) Shanika Karunasekera.
A tool for presentation of Architecture
A tool for presentation of Architecture
Chapter 10 Thinking in Objects
Unified Modeling Language
UML: Unified Modeling Language
Introduction to the Unified Modeling Language
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Basic OOP Concepts and Terms
Software Design Methodologies and Testing
Chapter 5.
Introduction to UML Sources:
Review of Previous Lesson
ITEC324 Principle of CS III
Presentation transcript:

Introduction to OOP and UML Programming Paradigms Procedural Functional Object Oriented Object-Oriented Design Unified Modeling Language Use Cases Class Diagrams Sequence Diagrams Example from Project 1

Programming Paradigms A paradigm is an ideal or a model to follow in doing something, e.g. programming In CS110, you were introduced to the three predominant programming paradigms: Procedural Functional Object-Oriented In this course, we will further explore the Object-Oriented paradigm using Java

Object-Oriented Design The OOP paradigm was developed by SW engineers to solve most if not all of the problems described in L&C section 1.1. It has become a predominant programming style for use in many applications, e.g. graphical user interfaces (GUIs), etc. Java is considered to be an Object-Oriented Programming (OOP) language because it has specific features to fully support OOP

Object-Oriented Design In the OOP paradigm, the designer focuses on the data rather than the algorithm steps The data is associated with objects that are present in the problem, such as: Monitor Keyboard File Frame for a GUI Icon in a frame for a GUI

Object-Oriented Design Use UML “use case diagrams” to sketch out aspects of the problem you are trying to solve Don’t get too detailed yet Do NOT use flow charts or pseudo-code yet Driver Animals Cat Dog Snake Car Components Engine Trans. Tire Food

Object-Oriented Design “Classify” the objects based on similarities of their attributes and behaviors Examples of objects that could be classified as Animals: Dogs, Cats, Snakes, Fish, etc. Identify objects that have other objects as components or parts of themselves Example: A car is made up of an engine, a transmission, and tires Identify objects that use other objects A Driver drives a Car and an Animal eats Food

Object-Oriented Design Define the names of classes for the objects Usually nouns, e.g. Driver, Car, Animal, Cat, etc. Define the attributes of the classes Attributes: “things that objects of the class are” Usually adjectives, e.g. color, size, furry, etc. Define the behaviors of the classes Behaviors: “things that object of the class can have done to them or services they can perform” Usually verbs, e.g. drive, eat, etc.

Object-Oriented Design Define the relationships between classes Inheritance – More specific classes from general ones, e.g. a Cat is an Animal, a Dog is an Animal Interface – A standard way that these objects can connect to other objects, e.g. power cord, etc. Aggregation/Composition – Classes that are built up from or composed of component classes, e.g. a Car has an Engine, a Transmission, and Tires Dependencies – Need for objects of other classes, e.g. a Driver drives a Car, a Cat eats Food

Object-Oriented Design Define the methods of each class to support the interactions and behavior of its objects Identify any methods that are identical to methods other classes also provide to connect to a standard interface, e.g. implementing a network connector or a power cord on a PC Flow charts or pseudo code may be used for individual method designs (procedural code)

Unified Modeling Language (UML) The Unified Modeling Language (UML) was developed in the 1990’s to support OOP software design The ”three amigos” (Grady Booch, Ivar Jacobson, and Jim Rumbaugh) unified their separate methodologies when they formed Rational Corporation A good reference is UML Distilled, 3rd Ed., Martin Fowler, Addison-Wesley/Pearson

Unified Modeling Language (UML) UML is a graphical tool to visualize and analyze the requirements and do design of an object-oriented solution to a problem Three basic types of diagrams: Use Case Diagram (Shown previously) Class Diagram (The most useful one for us) Interaction Diagram I will use Class Diagrams in presenting the design for our Java programs / projects 11

Unified Modeling Language (UML) Advantage of UML – It is graphical Allows you to visualize the problem / solution Organizes your detailed information Disadvantage of UML – It is graphical Can be done with pencil and paper – tedious! Commercial UML S/W tools are expensive! Example: Rational ROSE IBM acquired Rational and the three amigos got rich There are some free-ware UML Design Tools 12

UML Class Diagrams UML class diagrams show: The external and internal attributes and methods for each class The relationships between the classes They’re a static view of the program structure They do not show: The number of objects of each class instantiated The timing of the interactions between objects 13

UML Class Diagrams Class Name List of Attributes + publicClassAttribute : datatype - privateClassAttribute : datatype + publicInstanceAttribute : datatype - privateInstanceAttribute : datatype List of Methods + publicClassMethod (parameters) : returnDataType - privateClassMethod (parameters) : returnDataType + publicInstanceMethod (parameters) : returnDataType - privateInstanceMethod (parameters) : returnDataType

UML Class Diagrams UML Attribute Descriptions UML Method Descriptions Protection: + public, - private, # protected Attribute name : Attribute data type UML Method Descriptions Method name Method parameter list (name : datatype, etc.) : Method return type Underlined means class attribute or method 15

UML Class Diagrams Class Name Super Class Name Interface Name Required Methods Depends on Inherits from Implements Class Name Class Name Class Name Driver Class depends on Car Class Cat Class inherits from Animal Class Computer Class implements WiFi Interface

Engine Class, Transmission Class, and Tire Class UML Class Diagrams Aggregate Name Is composed of Component1 Component2 Component3 Car Class is composed of Engine Class, Transmission Class, and Tire Class

UML Interaction Diagrams UML interaction diagrams show The objects of each class involved in a scenario The order of interactions between the objects They are a dynamic view of the behavior Often called ladder diagrams due to their resemblance to a ladder or group of ladders

UML Interaction Diagrams A Timeline For Each Class : Object Involved Transmission : itsTransmission Driver : me Car: myCar Engine: itsEngine Time Turn Key Start OK Return OK Return Put in Gear Shift OK Return OK Return

UML Example (Project 1) Polynomial Class implements Comparable<T> so that an array of its objects can be sorted It uses the library ArrayList<T> class to store its polynomial coefficients (private) TestPolynomial Class contains test cases that can be run automatically to test your class Arrays.sort() can sort Comparable<T> arrays PolyApp is your class using Polynomial objects

<<interface>> java.lang.Comparable<T> java.util.Arrays + compareTo (that : T) : int PolyApp + main (String [ ] ) : void Polynomial implements Comparable<Polynomial> - coeffs : ArrayList<Integer> + Polynomial (coeffs : int [ ]) {Constructor} + toString ( ) : String + compareTo (that : Polynomial) : int + equals(that : Polynomial) : boolean + add (that : Polynomial) : Polynomial + sub (that : Polynomial) : Polynomial + mul (that : Polynomial) : Polynomial + div (divisor: Polynomial) : Polynomial [ ] + evaluate (x : double) : double + derivative ( ) : Polynomial + root(guess : double, TOLERANCE : double) : double java.util.ArrayList<T> jUnit.TestCase TestPolynomial