GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update 装饰设计模式.MD · WhCannon/JavaSE@27da878

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Design-pattern
    • 装饰设计模式.MD
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Design-pattern/装饰设计模式.MD‎

Copy file name to clipboardExpand all lines: Design-pattern/装饰设计模式.MD
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ Writer
66
|--TextWriter: 用于操作文本
77
|--MediaWriter: 用于操作媒体
88
想要对操作的动作进行效率的提高。按照面向对象,可以通过继承对具体的操作进行功能的扩展,而效率提高需要加入缓冲技术。
9+
```java
910
Writer
1011
|--TextWriter:用于操作文本
1112
|--BufferTextWriter:加入了缓冲技术的操作文本的对象(操作+缓冲)
1213
|--MediaWriter:用于操作媒体。
1314
|--BufferMediaWriter:操作+缓冲
15+
```
1416
到这里就哦了,但是这样做好像并不理想。如果这个体系进行功能扩展,又多了一些流对象,那么这个流要提高效率,是不是也要产生子类呢?是。
1517
这时就会发现只为提高功能而进行的继承,会导致继承体系越来越臃肿,不够灵活。
1618
重新思考这个问题?

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.