上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)15 Class Design

Shanghai Jiao Tong University 上海交通大学 Object Oriented Analysis and Design Class Design 上海交通大学软件工程中心
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Class Design

Class Design in Context [Early Elaboration [Inception Iteration] Iteration (Optional)] Define a Candidate Perform Architecture Architectural L Synthesis Analyze Behavior (Optional) Refine the Architecture Class Design Designer Define Design the Components Database Object Oriented Analysis and Design 2
Object Oriented Analysis and Design 2 Class Design in Context [Early Elaboration Iteration] [Inception Iteration (Optional)] Define a Candidate Architecture Perform Architectural Synthesis Analyze Behavior Refine the Architecture Define Components Design the Database (Optional) Class Design Designer

Class Design Overview Project Specific Guidelines Class Design Design Classes Supplementary Specifications Object Oriented Analysis and Design 3
Object Oriented Analysis and Design 3 Class Design Overview Supplementary Specifications Class Design Project Specific Guidelines Design Classes

Outline Create Initial Design Classes ◆Define Operations ◆Define Methods ◆Define States ◆Define Attributes ◆Define Dependencies ◆Define Associations ◆ Define Generalizations Object Oriented Analysis and Design 4
Object Oriented Analysis and Design 4 Outline Create Initial Design Classes Define Operations Define Methods Define States Define Attributes Define Dependencies Define Associations Define Generalizations

Outline Create Initial Design Classes ◆Define Operations ◆Define Methods ◆Define States ◆Define Attributes ◆Define Dependencies ◆Define Associations Define Generalizations ◆ Object Oriented Analysis and Design 5
Object Oriented Analysis and Design 5 Outline Create Initial Design Classes Define Operations Define Methods Define States Define Attributes Define Dependencies Define Associations Define Generalizations

Class Design Considerations Class stereotype Boundary Entity Control Applicable design patterns Architectural mechanisms Persistence Distribution etc. Object Oriented Analysis and Design 6
Object Oriented Analysis and Design 6 Class Design Considerations Class stereotype ▪ Boundary ▪ Entity ▪ Control Applicable design patterns Architectural mechanisms ▪ Persistence ▪ Distribution ▪ etc

How Many Classes Are Needed? Many,simple classes means that each class Encapsulates less of the overall system intelligence Is more reusable Is easier to implement A few,complex classes means that each class ■ Encapsulates a large portion of the overall system intelligence Is less likely to be reusable Is more difficult to implement A class should have a single well-focused purpose.A class should do one thing and do it well! Object Oriented Analysis and Design 7
Object Oriented Analysis and Design 7 A class should have a single well-focused purpose. A class should do one thing and do it well! How Many Classes Are Needed? Many, simple classes means that each class ▪ Encapsulates less of the overall system intelligence ▪ Is more reusable ▪ Is easier to implement A few, complex classes means that each class ▪ Encapsulates a large portion of the overall system intelligence ▪ Is less likely to be reusable ▪ Is more difficult to implement

Strategies for Designing Boundary Classes User interface (Ul)boundary classes ■ What user interface development tools will be used? How much of the interface can be created by the development tool? ◆ External system interface boundary classes Usually model as subsystem MainWindow SubWindow MainForm Button DropDownList Object Oriented Analysis and Design 8
Object Oriented Analysis and Design 8 Strategies for Designing Boundary Classes User interface (UI) boundary classes ▪ What user interface development tools will be used? ▪ How much of the interface can be created by the development tool? External system interface boundary classes ▪ Usually model as subsystem MainForm SubWindow Button DropDownList MainWindow

Strategies for Designing Entity Classes ◆ Entity objects are often passive and persistent Performance requirements may force some re-factoring ◆ See the Identify Persistent Classes step Analysis Design FatClass FatClass -privateAttr privateAttr -commonlyUsedAttr1 getCommonlyUsedAttr1() commonlyUsedAttr2 getCommonlyUsedAttr2() rarelyUsed1 getRarelyUsedAtt1() -rarelyUsed2 getRarelyUsedAtt2() 0.1 FatClassDataHelper FatClassLazy DataHelper commonlyUsedAttr1 -rarelyUsedAttr1 commonlyUsedAttr2 rarelyUsedAttr2 Object Oriented Analysis and Design 9
Object Oriented Analysis and Design 9 Strategies for Designing Entity Classes Entity objects are often passive and persistent Performance requirements may force some re-factoring See the Identify Persistent Classes step Analysis FatClassLazyDataHelper - rarelyUsedAttr1 - rarelyUsedAttr2 Design FatClass - privateAttr + getCommonlyUsedAttr1() + getCommonlyUsedAttr2() + getRarelyUsedAtt1() + getRarelyUsedAtt2() FatClassDataHelper - commonlyUsedAttr1 - commonlyUsedAttr2 1 0..1 FatClass - privateAttr - commonlyUsedAttr1 - commonlyUsedAttr2 - rarelyUsed1 - rarelyUsed2 >

Strategies for Designing Control Classes What happens to Control Classes? Are they really needed? Should they be split? ◆How do you decide? Complexity Change probability ■ Distribution and performance Transaction management Object Oriented Analysis and Design 10
Object Oriented Analysis and Design 10 Strategies for Designing Control Classes What happens to Control Classes? ▪ Are they really needed? ▪ Should they be split? How do you decide? ▪ Complexity ▪ Change probability ▪ Distribution and performance ▪ Transaction management
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《计算机通讯与网络》教学资源_课程教学大纲.doc
- 上海交通大学:《计算机通讯与网络》教学资源(PPT课件)Chapter 3 Transport Layer.ppt
- 上海交通大学:《计算机通讯与网络》教学资源(PPT课件)Chapter 2 Application Layer.ppt
- 上海交通大学:《计算机通讯与网络》教学资源(PPT课件)Chapter 1 roadmap.ppt
- 《计算机组成与系统结构》课程参考教材:机械工业出版社《计算机组成与设计:硬件、软件接口》PDF电子书(中文第4版).pdf
- 《计算机组成与系统结构》课程参考教材:Computer Systems_A Programmer's Perspective-Pearson(THIRD EDITION,2015).pdf
- 《计算机组成与系统结构》课程参考教材:Computer Organization and Design(fourth edition).pdf
- 上海交通大学:《编译原理》教学资源_第四周讲义_Syntax-Directed Translation.pdf
- 上海交通大学:《编译原理》教学资源_第六周讲义_Run-Time Environments.pdf
- 上海交通大学:《编译原理》教学资源_第六周讲义_Heap Management.pdf
- 上海交通大学:《编译原理》教学资源_第六周讲义_Intermediate Code Generation.pdf
- 上海交通大学:《编译原理》教学资源_第八周讲义_Machine-Independent Optimizations Ⅲ.pdf
- 上海交通大学:《编译原理》教学资源_第八周讲义_Machine-Independent Optimizations Ⅱ.pdf
- 上海交通大学:《编译原理》教学资源_第八周讲义_Machine-Independent Optimizations Ⅰ.pdf
- 上海交通大学:《编译原理》教学资源_第二周讲义_lex.pdf
- 上海交通大学:《编译原理》教学资源_第二周讲义_Syntax Analyzer.pdf
- 上海交通大学:《编译原理》教学资源_第二周讲义_Lexical Analyzer.pdf
- 上海交通大学:《编译原理》教学资源_第九周讲义_Machine-Independent Optimizations Ⅳ.pdf
- 上海交通大学:《编译原理》教学资源_第九周讲义_CS308 Compiler Theor.pdf
- 上海交通大学:《编译原理》教学资源_第九周讲义_CS308 Compiler Theor.pdf
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(讲稿)绪论(主讲:李芳).pdf
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(讲稿)软件开发过程.pdf
- 《程序设计思想与方法》课程教学资源(课程教材)How to Think Like a Computer Scientist(Learning with Python).pdf
- 《程序设计思想与方法》课程教学资源(课程教材)Python Programming:An Introduction to Computer Science.pdf
- 上海交通大学:《程序设计思想与方法》课程教学资源(课程教材)简明Python教程(PDF版).pdf
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT01 绪论.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT02 程序构件.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT03 数值计算.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT04 字符串计算.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT05 面向对象与图形编程.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT06 函数.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT07 控制结构——条件语句.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT08 控制结构——循环语句.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT09 模拟设计.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT10 类的定义.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT11 数据集合体.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT12 面向对象设计.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT13 算法设计分析.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT14 Python GUI工具包:Tkinter.ppt
- 上海交通大学:《程序设计思想与方法》课程教学资源(PPT课件讲稿)CT15 并发与多线程.ppt