Ch4: Software Architecture and Design
description
Transcript of Ch4: Software Architecture and Design
![Page 1: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/1.jpg)
Ch4: Software Architecture and Design
![Page 2: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/2.jpg)
2
The role of analysis and design
Software construction may be partitioned into the following phases:
Req. analysis: S/w architecture: High-level/early design: Detailed design: Implementation: Testing:
![Page 3: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/3.jpg)
3
The Role of Analysis and Design
Analysis: OO Analysis: Design: OO design:
![Page 4: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/4.jpg)
4
Guidelines for designing classes
Specifying “Good” Classes Identifying a good class is hard work A well-defined class is:
![Page 5: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/5.jpg)
5
Guidelines for design of classes (contd..)
Understanding the utility of classes Three categories of software in application:
Domain independent (20%):
Domain-specific (65%):
Application-specific (15%):
Organizations must strive for domain and organization specific reuse.
![Page 6: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/6.jpg)
6
Guidelines for designing classes
Containment vs. inheritance Class D “Is-A-Kind-Of” class C:
Class D “Has-A” class C:
Choose
How and when to apply reuse, relationship among classes. Need discussion,communication and cooperation among engineers.
![Page 7: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/7.jpg)
7
History of OO design
Booch: The Booch method Object-Oriented Design with Application,”
Benjamin/Cummings, 1991. Rumbaugh: OMT
“Object-Oriented Modeling and Design,” Prentice-Hall, 1991.
Meyer: Client/Server contract approach “Object-Oriented Software Construction,” Prentice-Hall,
1988. Jacobson: Use-cases and software engineering
“Object-Oriented Software Engineering: A Use Case Driven Approach,” Addison-Wesley, 1992.
![Page 8: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/8.jpg)
8
History of OO design (contd..)
Coleman: The Fusion method “Object-Oriented Development - The Fusion Method,”
Prentice-Hall, 1994. Lieberherr: Adaptive OO software
“Adaptive OO Software: The Demeter Method with Propagation Patterns,” PWS, 1996.
Gamma: Design Patterns “Design Patterns: Elements of Reusable Object-Oriented
Software,” Addison-Wesley, 1995. Booch and Rumbaugh: UML Predecessor
“Unified Method for Object-Oriented Development,” Rational TR, 1995
![Page 9: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/9.jpg)
9
The emergence of UML
The Unified Modeling Language (UML) is the object-oriented analysis and design equivalent of Java
UML is a language for Web address: http://www.rational.com/uml
UML unifies: Object-oriented analysis and design: Grady Booch
approach. Object-oriented modeling and design: Jim Rumbaugh Object-oriented SE, A use case drive approach:
Jacobson
A modeling language provides:
![Page 10: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/10.jpg)
10
Seven goals of UML
Ready-to-use, expressive visual modeling language that promotes development/exchange
Extensibility/specialization of core concepts Independent of programming languages and
development processes Formal basis for understanding language Encourage growth of OO tools market Support higher level design concepts:
Collaborations, frameworks, etc. Collaborations, frameworks, ptterns, etc.
Integrate the best practices of all OOD
![Page 11: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/11.jpg)
11
Characteristics of UML
Generic syntax: Syntax is independent of:
Flexible syntax:
![Page 12: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/12.jpg)
12
UML modeling constructs/diagrams
User interaction diagrams Use-case diagrams
Static structure diagrams Class diagrams Object diagrams
Behavior diagrams Statechart diagrams Activity diagrams
Interaction diagrams Sequence diagram Collaboration diagram
Implementation diagrams Component diagram Deployment diagram
![Page 13: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/13.jpg)
13
Class diagrams
Class in UML:
Representation of classes:
Designer develops classes as sets of compartments that grow over time to incrementally add functionality and features
![Page 14: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/14.jpg)
14
Example class diagram
CustomerAccount
+ Account: Int+ Name: String+ Address: String+ Balance: Float
+ AddCustomer()+ DeleteCustomer()+ GetBalance()
Name
Attributes
Operations
“+” indicates that the attribute/operation is public“-” indicates that the attribute/operation is private“#” indicates that the attribute/operation is protected
![Page 15: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/15.jpg)
15
Relationships among classes
Inheritance Association Aggregation
![Page 16: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/16.jpg)
16
Generalization/Specialization (Inheritance)
BankAccount
CheckAccount SavAccount
Checking Account and Savings Account are special cases of Bank Account
![Page 17: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/17.jpg)
17
Generalization/Specialization (Inheritance)
Employee
Admin_staff Tech_staff
Administrative Staff and Technical Staff are special cases of the class Employee
![Page 18: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/18.jpg)
18
Association
Course1 *Instructor
Multiplicity constraints indicate how many objects participate in the association.May be specified as -- upper_bound….lower_bound1, 1:1 – Only one object*, 1:* - At least one object* -- any number of objects between 0 and infinity
Relationship among instances of objects of one class and instances of objects among other classes. Represent using a line, label each end With how many objects participate in the association.
![Page 19: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/19.jpg)
19
Association (contd..)
Multiplicity 1:3 indicates that each Instructor teaches at least one coursebut no more than three courses.
Course1 1:3Instructor
![Page 20: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/20.jpg)
20
Association (contd..)
* 1TechStaff
Manager
1
Project
1…*
project_member
manages
![Page 21: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/21.jpg)
21
Aggregation
Store Depts. 5
Objects are composed of simpler objects.
Triangle consists of three points.
![Page 22: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/22.jpg)
22
Class Diagram: High Tech SuperMarket System
Consider the process of updating the inventory in the high-tech supermarket system. Central to the process is an inventory order. An inventory assistant in the HTSS is responsible for managing a inventory order. In addition, each inventory assistant may be involved in managing several inventory orders. An inventory order is associated with a list of items. Each item in the list can be of three types, namely, snack item, liquor item, and canned item. Each inventory order is submitted to three wholesale stores. Each wholesale store caters to a specific set of items. For example, the Liquor Store is responsible for delivering liquor items. These three wholesale stores, are, namely, Liquor Store, Produce Store, and Snack Store. Construct a UML class diagram to model the process of inventory update in the HTSS.
![Page 23: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/23.jpg)
23
Class diagram: HTSS
InvenOrderInvenAssist
WholeStore ItemList Item
LiqStore ProdStore SnStore PerishItem NPerishItem
1 *
*1
1
11…3
1
![Page 24: Ch4: Software Architecture and Design](https://reader034.fdocuments.net/reader034/viewer/2022051115/56814747550346895db48467/html5/thumbnails/24.jpg)
24
UML tools
Argo UML http://argouml.tigris.org
Object Domain http://www.objectdomain.com/domain/evaluationIntro.html
Rational Rose: http://www.rational.com
Microsoft Visio