面向对象建模技术课件 Lect6-SOLID Principle in OO Design.pptxVIP

  • 6
  • 0
  • 约1.25万字
  • 约 79页
  • 2020-11-10 发布于四川
  • 举报

面向对象建模技术课件 Lect6-SOLID Principle in OO Design.pptx

Professor: Yushan Sun Spring Term 2018;本讲内容;;Single Responsibility Principle (单一责任原则);责任的定义 Martin defines a responsibility as a?reason to change, and concludes that a class or module should have one, and only one, reason to change. ;例1:报告生成软件 Consider a module that compiles and prints a report. Such a module can be changed for two reasons. First, the content of the report can change. (内容可以改变) Second, the format of the report can change. (格式可以改变) These two things change for very different causes; one substantive, and one cosmetic. ;Report;By the single responsibility principle, these two asp

文档评论(0)

1亿VIP精品文档

相关文档