Chapter 12: Advanced Topics in ObjectOriented Design - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

Chapter 12: Advanced Topics in ObjectOriented Design

Description:

Indirection decouple two classes or system components by inserting intermediate class ... Indirection to isolate changes insert intermediate object between ... – PowerPoint PPT presentation

Number of Views:193
Avg rating:3.0/5.0
Slides: 50
Provided by: jeffh223
Category:

less

Transcript and Presenter's Notes

Title: Chapter 12: Advanced Topics in ObjectOriented Design


1
Chapter 12 Advanced Topics in Object-Oriented
Design
  • Systems Analysis and Design in a Changing World,
    3rd Edition

2
Learning Objectives
  • Explain the importance of design patterns in
    object-oriented design
  • Briefly describe and use the singleton, adapter,
    and observer design patterns
  • Explain why enterprise-level systems require
    special design considerations

3
Learning Objectives (continued)
  • Apply UML physical design notation to Web-based
    systems
  • Explain how Web services work to obtain
    information on the Internet
  • Explain how statecharts can be used to describe
    system behaviors
  • Use statecharts to model object and system
    behaviors

4
Overview
  • This chapter provides OO developers with broader
    understanding of systems design
  • Design principles and design patterns
  • Designing enterprise-level systems, including
    Web-based systems
  • Modeling system and complex object behavior, such
    as user-interface objects or network objects
  • Unified Modeling Language (UML) includes
    statechart diagram to model complex objects

5
Design Principles and Design Patterns
  • Object designer must identify responsibilities
    for each class
  • Object is responsible for
  • Maintaining its attributes and getting
    information from other objects, as needed, to
    fill in values
  • Creating objects that are dependents of the
    object
  • Being an expert on needed information and/or
    navigation visibility and access to other objects
    that have the needed information

6
Additional Design Principles
  • Systems based on good design principles
  • Easier to develop
  • Easier to maintain
  • Enhance flexibility of new system
  • Protection from variations segregate system
    parts unlikely to change from parts that change
  • Indirection decouple two classes or system
    components by inserting intermediate class

7
Importance of Design Patterns
  • Templates and patterns are part of daily life
  • Patterns are created to solve common problems
  • Two standard design templates
  • Use case controller
  • Three-layer design
  • Java and .NET use multiple enterprise patterns

8
Basic Design Patterns
  • Gang of Fours basic classification scheme
  • Class-level patterns abstract patterns that
    apply to static methods or do not instantiate
    objects
  • Object-level patterns specify objects
    instantiated from classes
  • Creational, Structural, Behavioral
  • Singleton one instance started from one place
  • Adapter plugs external class into existing
  • Observer callback technique, publish/subscribe

9
Pattern Description for Controller Pattern
10
Classification of Design Patterns
11
Singleton Pattern Template
12
Adapter Pattern Template
13
Three Classes in the Create New Order Use Case
14
Implementation for the Observer Pattern
15
Observer Pattern Template
16
Designing Enterprise-Level Systems
  • Shared components among multiple people or groups
    in organization
  • Multi-tiered computers
  • Client-server network based systems
  • Internet-based systems
  • Implementation diagram physical components of
    system
  • Deployment diagram shows physical components
    across different locations

17
Differences Between Client-Server and Internet
Systems
18
UML Notation for Deployment Diagrams
  • Component symbol executable module
  • All classes complied into single entity
  • Defined interfaces, or public methods, accessible
    by other programs or external devices
  • Application program interface (API) set of
    public methods available to the outside world
  • Node symbol physical entity at specific
    location
  • Frameset high-level object holds items to be
    displayed by a browser

19
UML Component Notation
20
UML Node Notation
21
UML Extension for Frameset
22
Internet-Based Systems
  • Implement three-layer design in Web-based
    architecture
  • Simple Internet architecture
  • Static Web pages
  • Two-layer architecture for user interaction
  • System responds to user requests (inputs/outputs)
  • Three-layer architecture for user interaction
  • Domain layer added for business logic

23
Simple Internet Architecture
24
Two-Layer Internet Architecture
25
Three-Layer Internet Architecture
26
Web Services
  • Program sends out request for information
  • Universal Discovery, Description, and Integration
    (UDDI) services directory locates the web service
  • Internet address of program to provide service
  • Program obtains desired information over Internet
  • XML (eXtensible Markup Language) facilitates
    communication through self-defining tags

27
Invoking a Web Service
28
Modeling System and Object Behavior
  • Class diagrams used to understand program
    structure and database schema
  • Use case diagrams and interaction diagrams
    describe basic business and system processes
  • Statechart diagrams describe complex processes
    and object behavior (similar to activity diagram)
  • Used for event-driven, real-time systems
  • Identify states of business object and describe
    way that object moves from state to state

29
Statecharts for Problem Domain Classes
  • Useful to design and describe internal activity,
    or method logic, of system object
  • Pseudostate starting point of a statechart
  • State condition that occurs during an objects
    life when it satisfies some criteria, performs
    some action, or waits for an event
  • Transition movement of object from one state to
    another state (origin and destination)
  • Message event trigger for the transition

30
Simple Statechart for a Printer
31
Nested States and Concurrency
  • Concurrency condition of being in more than one
    state at a time
  • Path sequential set of connected states and
    transitions
  • Composite states state containing multiple
    levels and transitions
  • Represents a higher level of abstraction
  • Can contain nested states and transition paths
  • Paths are independent

32
Simple Composite States for the Printer Object
33
Concurrent Path for a Printer in the On State
34
Rules for Developing Statecharts
  • Review class diagram and select classes that
    require statecharts
  • For each selected class in group, brainstorm to
    list all status conditions you can identify
  • Begin building statechart fragments by
    identifying transitions that cause object to
    leave identifying state
  • Sequence these state-transition combinations in
    correct order

35
Rules for Developing Statecharts (continued)
  • Review paths and look for independent, concurrent
    paths
  • Look for additional transitions
  • Take every pairwise combination of states and
    look for valid transition between states
  • Expand each transition with the appropriate
    message event, guard-condition, and
    action-expression
  • Review and test each statechart

36
States and Exit Transitions for OrderItem
37
Partial Statechart for OrderItem
38
Final Statechart for OrderItem
39
States and Exit Transitions for Order
40
First-Cut Statechart for Order
41
Second-Cut Statechart for Order
42
Statecharts as Design Models
  • Describes system behaviors and constraints
  • System is object, so system statechart can be
    developed
  • Menu items, windows modality, tool bars and icons
  • State variable record value of current state to
    inform system which items to enable or disable
    and which messages to process or ignore
  • Design class diagrams, sequence diagrams, and
    statecharts work together to complete design

43
Logon Statechart for a Computer System
44
Sequence Diagram for Create New Order
45
Design Class for Order
46
Statechart for Order
47
Summary
  • Systems based on good design principles are
    easier to develop and easier to maintain
  • Protection from variations separate components
    or design elements that do not change from those
    that are likely to change
  • Indirection to isolate changes insert
    intermediate object between two linked objects
    that do not have a natural interface

48
Summary (continued)
  • Good design based on standard design patterns
  • Template or standard solution to common problem
  • Singleton pattern all processing goes through
    one and only one control point
  • Adapter pattern converts one application
    program interface (API) into another API
  • Observer pattern allows two objects to be
    linked dynamically to keep coupling low and
    provide temporary communication capacity

49
Summary (continued)
  • Statecharts used to describe the behavior, or
    life cycle, of object or of system
  • State condition of the object
  • Transition connectors between states and permit
    an object to move from state to state
  • Statechart diagram that identifies all states
    of an object and actions that cause object to
    change from state to state
Write a Comment
User Comments (0)
About PowerShow.com