Download presentation
Presentation is loading. Please wait.
Published byDeborah Alaina Knight Modified over 9 years ago
1
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition
2
12 Systems Analysis and Design in a Changing World, 3rd Edition 2 Learning Objectives u Explain the importance of design patterns in object-oriented design u Briefly describe and use the singleton, adapter, and observer design patterns u Explain why enterprise-level systems require special design considerations
3
12 Systems Analysis and Design in a Changing World, 3rd Edition 3 Learning Objectives ( continued ) u Apply UML physical design notation to Web- based systems u Explain how Web services work to obtain information on the Internet u Explain how statecharts can be used to describe system behaviors u Use statecharts to model object and system behaviors
4
12 Systems Analysis and Design in a Changing World, 3rd Edition 4 Overview u This chapter provides OO developers with broader understanding of systems design: l Design principles and design patterns l Designing enterprise-level systems, including Web-based systems l Modeling system and complex object behavior, such as user-interface objects or network objects l Unified Modeling Language (UML) includes statechart diagram to model complex objects
5
12 Systems Analysis and Design in a Changing World, 3rd Edition 5 Design Principles and Design Patterns u Object designer must identify responsibilities for each class u Object is responsible for: l Maintaining its attributes and getting information from other objects, as needed, to fill in values l Creating objects that are dependents of the object l Being an expert on needed information and/or navigation visibility and access to other objects that have the needed information
6
12 Systems Analysis and Design in a Changing World, 3rd Edition 6 Additional Design Principles u Systems based on good design principles: l Easier to develop l Easier to maintain l Enhance flexibility of new system u Protection from variations – segregate system parts unlikely to change from parts that change u Indirection – decouple two classes or system components by inserting intermediate class
7
12 Systems Analysis and Design in a Changing World, 3rd Edition 7 Importance of Design Patterns u Templates and patterns are part of daily life u Patterns are created to solve common problems u Two standard design templates l Use case controller l Three-layer design u Java and.NET use multiple enterprise patterns
8
12 Systems Analysis and Design in a Changing World, 3rd Edition 8 Basic Design Patterns u Gang of Four’s basic classification scheme l Class-level patterns – abstract patterns that apply to static methods or do not instantiate objects l Object-level patterns – specify objects instantiated from classes l Creational, Structural, Behavioral u Singleton – one instance started from one place u Adapter – plugs external class into existing u Observer – callback technique, publish/subscribe
9
12 Systems Analysis and Design in a Changing World, 3rd Edition 9 Pattern Description for Controller Pattern
10
12 Systems Analysis and Design in a Changing World, 3rd Edition 10 Classification of Design Patterns
11
12 Systems Analysis and Design in a Changing World, 3rd Edition 11 Singleton Pattern Template
12
12 Systems Analysis and Design in a Changing World, 3rd Edition 12 Adapter Pattern Template
13
12 Systems Analysis and Design in a Changing World, 3rd Edition 13 Three Classes in the Create New Order Use Case
14
12 Systems Analysis and Design in a Changing World, 3rd Edition 14 Implementation for the Observer Pattern
15
12 Systems Analysis and Design in a Changing World, 3rd Edition 15 Observer Pattern Template
16
12 Systems Analysis and Design in a Changing World, 3rd Edition 16 Designing Enterprise-Level Systems u Shared components among multiple people or groups in organization u Multi-tiered computers l Client-server network based systems l Internet-based systems u Implementation diagram – physical components of system l Deployment diagram – shows physical components across different locations
17
12 Systems Analysis and Design in a Changing World, 3rd Edition 17 Differences Between Client-Server and Internet Systems
18
12 Systems Analysis and Design in a Changing World, 3rd Edition 18 UML Notation for Deployment Diagrams u Component symbol – executable module l All classes complied into single entity l Defined interfaces, or public methods, accessible by other programs or external devices l Application program interface (API) – set of public methods available to the outside world u Node symbol – physical entity at specific location u Frameset – high-level object holds items to be displayed by a browser
19
12 Systems Analysis and Design in a Changing World, 3rd Edition 19 UML Component Notation
20
12 Systems Analysis and Design in a Changing World, 3rd Edition 20 UML Node Notation
21
12 Systems Analysis and Design in a Changing World, 3rd Edition 21 UML Extension for Frameset
22
12 Systems Analysis and Design in a Changing World, 3rd Edition 22 Internet-Based Systems u Implement three-layer design in Web-based architecture u Simple Internet architecture l Static Web pages u Two-layer architecture for user interaction l System responds to user requests (inputs/outputs) u Three-layer architecture for user interaction l Domain layer added for business logic
23
12 Systems Analysis and Design in a Changing World, 3rd Edition 23 Simple Internet Architecture
24
12 Systems Analysis and Design in a Changing World, 3rd Edition 24 Two-Layer Internet Architecture
25
12 Systems Analysis and Design in a Changing World, 3rd Edition 25 Three-Layer Internet Architecture
26
12 Systems Analysis and Design in a Changing World, 3rd Edition 26 Web Services u Program sends out request for information u Universal Discovery, Description, and Integration (UDDI) services directory locates the web service l Internet address of program to provide service u Program obtains desired information over Internet u XML (eXtensible Markup Language) facilitates communication through self-defining tags
27
12 Systems Analysis and Design in a Changing World, 3rd Edition 27 Invoking a Web Service
28
12 Systems Analysis and Design in a Changing World, 3rd Edition 28 Modeling System and Object Behavior u Class diagrams used to understand program structure and database schema u Use case diagrams and interaction diagrams describe basic business and system processes u Statechart diagrams describe complex processes and object behavior (similar to activity diagram) l Used for event-driven, real-time systems l Identify states of business object and describe way that object moves from state to state
29
12 Systems Analysis and Design in a Changing World, 3rd Edition 29 Statecharts for Problem Domain Classes u Useful to design and describe internal activity, or method logic, of system object u Pseudostate – starting point of a statechart u State – condition that occurs during an object’s life when it satisfies some criteria, performs some action, or waits for an event u Transition – movement of object from one state to another state (origin and destination) u Message event – trigger for the transition
30
12 Systems Analysis and Design in a Changing World, 3rd Edition 30 Simple Statechart for a Printer
31
12 Systems Analysis and Design in a Changing World, 3rd Edition 31 Nested States and Concurrency u Concurrency – condition of being in more than one state at a time u Path – sequential set of connected states and transitions u Composite states – state containing multiple levels and transitions l Represents a higher level of abstraction l Can contain nested states and transition paths l Paths are independent
32
12 Systems Analysis and Design in a Changing World, 3rd Edition 32 Simple Composite States for the Printer Object
33
12 Systems Analysis and Design in a Changing World, 3rd Edition 33 Concurrent Path for a Printer in the On State
34
12 Systems Analysis and Design in a Changing World, 3rd Edition 34 Rules for Developing Statecharts u Review class diagram and select classes that require statecharts u For each selected class in group, brainstorm to list all status conditions you can identify u Begin building statechart fragments by identifying transitions that cause object to leave identifying state u Sequence these state-transition combinations in correct order
35
12 Systems Analysis and Design in a Changing World, 3rd Edition 35 Rules for Developing Statecharts ( continued ) u Review paths and look for independent, concurrent paths u Look for additional transitions l Take every pairwise combination of states and look for valid transition between states u Expand each transition with the appropriate message event, guard-condition, and action- expression u Review and test each statechart
36
12 Systems Analysis and Design in a Changing World, 3rd Edition 36 States and Exit Transitions for OrderItem
37
12 Systems Analysis and Design in a Changing World, 3rd Edition 37 Partial Statechart for OrderItem
38
12 Systems Analysis and Design in a Changing World, 3rd Edition 38 Final Statechart for OrderItem
39
12 Systems Analysis and Design in a Changing World, 3rd Edition 39 States and Exit Transitions for Order
40
12 Systems Analysis and Design in a Changing World, 3rd Edition 40 First-Cut Statechart for Order
41
12 Systems Analysis and Design in a Changing World, 3rd Edition 41 Second-Cut Statechart for Order
42
12 Systems Analysis and Design in a Changing World, 3rd Edition 42 Statecharts as Design Models u Describes system behaviors and constraints u System is object, so system statechart can be developed l Menu items, windows modality, tool bars and icons u State variable – record value of current state to inform system which items to enable or disable and which messages to process or ignore u Design class diagrams, sequence diagrams, and statecharts work together to complete design
43
12 Systems Analysis and Design in a Changing World, 3rd Edition 43 Logon Statechart for a Computer System
44
12 Systems Analysis and Design in a Changing World, 3rd Edition 44 Sequence Diagram for Create New Order
45
12 Systems Analysis and Design in a Changing World, 3rd Edition 45 Design Class for Order
46
12 Systems Analysis and Design in a Changing World, 3rd Edition 46 Statechart for Order
47
12 Systems Analysis and Design in a Changing World, 3rd Edition 47 Summary u Systems based on good design principles are easier to develop and easier to maintain u Protection from variations – separate components or design elements that do not change from those that are likely to change u Indirection to isolate changes – insert intermediate object between two linked objects that do not have a natural interface
48
12 Systems Analysis and Design in a Changing World, 3rd Edition 48 Summary ( continued ) u Good design based on standard design patterns l Template or standard solution to common problem u Singleton pattern – all processing goes through one and only one control point u Adapter pattern – converts one application program interface (API) into another API u Observer pattern – allows two objects to be linked dynamically to keep coupling low and provide temporary communication capacity
49
12 Systems Analysis and Design in a Changing World, 3rd Edition 49 Summary ( continued ) u Statecharts used to describe the behavior, or life cycle, of object or of system u State – condition of the object u Transition – connectors between states and permit an object to move from state to state u Statechart – diagram that identifies all states of an object and actions that cause object to change from state to state
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.