The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program Last Time The design process and design methods Design strategies including object-oriented design and functional decomposition Design quality attributes Comparison of Schwan s and RUP Design Processes Session 5: Agenda Introduction to the Principles of Object Technology Object Oriented Design Object Technology and RUP Why Objects? Fundamental Ideas The world is composed of objects A person manipulates the object and the object does things. In object oriented analysis, design and programming we try to create software objects that model real-world objects. Principles of the O-O Paradigm Abstraction Generalizing an object to just its pertinent attributes and behaviors, Encapsulation Bundling the attributes (data) and behaviors (methods) within the object. The methods form a protective barrier around the data. Principles of the O-O Paradigm Polymorphism Allowing the same behavior to be exhibited differently by different classes or subclasses Inheritance Attributes and behaviors may be established in a general class and used to create more specific subclasses that have all the attributes and behaviors of the superclass 1
Encapsulation Inheritance & Polymorphism Employee Salaried Salary Hourly Wage Object A structure containing data, and a set of functions that manipulate that data Method A function for manipulating the data in an object Class A description of the methods and data structures of an object. A template for building and communicating with an object. Instance A specific, concrete member of a class. An instance has actual data assigned to the object Subclass A child class that inherits methods and data from its parents. Superclass A parent class that provides methods and data to child classes derived from it. Object-Oriented Requirements Object-Oriented Design begins in the requirements phase. Requirements identify the objects themselves Scan a description of the problem or system and associate an object with each noun in the description Classify and group those objects that have common attributes and behaviors Identify the relationships between objects 2
Guidelines for Identifying Classes Guidelines for Identifying Behaviors What needs to be processed in some way? What items have multiple attributes? When do you have more than one object in a class? What is based on the requirements themselves, not derived from your understanding of the requirements? What attributes and operations are always applicable to a class or object? Imperative verbs Passive verbs Actions Things or reminded events Roles Operating procedures Services provided by an organization Dynamic View of Requirements The descriptions of the attributes, behaviors of the objects and their relationships give a static view of the system Use Case diagrams can give a dynamic view of the system by describing the communication, control/timing and state changes in the objects The Unified Modeling Language (UML) Mechanism for describing Object- Oriented solutions Developed by Grady Booch, Ivar Jacobson and James Rumbaugh Used in the Rational Unified Process UML in the Development Process Class Box Diagram 3
Inheritance Relationship Other Relationships Aggregation and Composition Royal Service Station System Figure 6.17 p. 279 Royal Service Station System Class Description Template Refuel Class p. 278 4
Class name: refuel Category: service External documents: Export control: Public Cardinality: n Hierarchy: Superclasses: services Associations: fuel in association <name> Operation name: Public member of: refuel Documentation: // Calculates fuel final Preconditions: gallons > 0 Object diagram: (unspecified) Semantics: final_ = gallons * Object diagram: (unspecified) Concurrency: sequential Public interface: Operations: Private interface: Attributes: gallons Implementation: Attributes: gallons State machine: no Concurrency: sequential Persistence: transient State Diagrams Activity Diagrams Questions? 5