下载此文档

契约式设计-课件(PPT演示稿).ppt


文档分类:办公文档 | 页数:约85页 举报非法文档有奖
1/85
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/85 下载此文档
文档列表 文档介绍
契约式设计
Design by Contract
2018/1/1
Institute puter Software
Nanjing University
摘要
引言
Eiffel 的 DbC 机制
DbC与继承
如何应用DbC
2018/1/1
Institute puter Software
Nanjing University
2
引言
Design by Contract (DbC) 契约式设计
方法学层面的思想
以尽可能小的代价开发出可靠性出众的软件系统
Eiffel语言的直接支持
Bertrand Meyer:DbC是构建面向对象软件系统方法的核心!
James McKim:“只要你会写程序,你就会写契约”
2018/1/1
Institute puter Software
Nanjing University
3
引言
A discipline of analysis, design, implementation, management
(可以贯穿于软件创建的全过程,从分析到设计,从文档到调试,甚至可以渗透到项目管理中)
Viewing the relationship between a class and its clients as a formal agreement, expressing each party’s rights and obligations.
(把类和它的客户程序之间的关系看做正式的协议,描述双方的权利和义务)
2018/1/1
Institute puter Software
Nanjing University
4
引言
Every software element is intended to satisfy a certain goal, for the benefit of other software elements (and ultimately of human users).
This goal is the element’s contract.
The contract of any software element should be
Explicit.
Part of the software element itself.
2018/1/1
Institute puter Software
Nanjing University
5
A human contract
2018/1/1
Institute puter Software
Nanjing University
6
Client
Supplier
(Satisfy precondition:)
Bring package before 4 .; pay fee.
(Satisfy postcondition:)
Deliver package by 10 . next day.
OBLIGATIONS(义务)
(From postcondition:)
Get package delivered by 10 . next day.
(From precondition:)
Not required to do anything if package delivered after 4 ., or fee not paid.
BENEFITS(权益/权利)
deliver
A view of software construction
Constructing systems as structured collections of cooperating software elements — suppliers and clients — cooperating on the basis of clear definitions of obligations and benefits.
These definitions are the contracts.
2018/1/1
Institute puter Software
Nanjing University
7
Properties of contracts
A contract:
Binds two parties (or more): supplier, client.
Is explicit (written).
Specifies mutual obligations and benefits.
Usually maps obligation for one of the parties into bene

契约式设计-课件(PPT演示稿) 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数85
  • 收藏数0 收藏
  • 顶次数0
  • 上传人huiwei2002
  • 文件大小1.42 MB
  • 时间2018-01-01
最近更新