当前位置: 首页 > 图文教程 > 网络编程 > JSP > Form Your Own Design Pattern Study Group

JSP
缓冲技术提高JSP程序的性能和稳定性
win2k下搭建jsp环境
JSP与XML的结合
JSP中实现全文检索
详细为您解析JSP的环境引擎--Websphere
JSP中图片验证的实现
缓冲技术提高JSP程序性能和稳定性
利用RamdonAccessFile来实现文件的追加
JSP设计模式
JSP如何连接DB2数据库
JSP调用JavaBean在网页上动态生成柱状图
JSP技巧:发送动态图像
JSP实现论坛树型结构的具体算法
一个用JSP实现的分页的类及调用方法
在JSP中使用JavaMail
JSP的九种基本内置组件简介
Applet数字签名,授予访问本地资源
如何入侵基于JSP的网站
JSP/Servlet构建三层管理信息系统
J2ME中实现可伸展目录树TreeList

JSP 中的 Form Your Own Design Pattern Study Group


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-03   浏览: 51 ::
收藏到网摘: n/a

Chapter 7: Adapter and Facade Patterns

  • Discuss the Brain Power on page 244.
  • Stage a fireside chat between Adapter and Proxy. Discuss the similarities and differences in Adapter and Proxy. When would you use one vs. another? Under what conditions would Adapter look like Proxy?
  • Think of a complex system you have to use every day that you would like a facade for. How would you simplify the interface in the facade?
  • Discuss the Principle of Least Knowledge on page 265. Take a small chunk of code you've written, and go through each line to see if it violates the Principle of Least Knowledge. Are there any cases in which you think you should change your code? If so, why?

Chapter 8: Template Method Pattern

  • Take a design that has a lot of lower- and higher-level components (see page 298). Now apply the Hollywood principle and clean up the design as a group.
  • Lead a group discussion on the first Brain Power on page 305. Pick apart the implementation of Sun's sort(), which uses static methods instead of inheritance. Did they do the right thing? Split into smaller groups if you like, and then come back together to discuss or debate as a large group.

Chapter 9: Iterator and Composite Patterns

  • Discuss the Brain Power on page 337.
  • How does the Single Responsibility principle relate to the other patterns you know?
  • Make sure the group understands the differences and relationships between components, composites, trees, and so on.

Chapter 10: State Pattern

  • Continue the State versus Strategy discussion on page 411. Both patterns have exactly the same class diagrams, but they differ in their intent. Try picking a representative for each pattern, and have them debate who they are and how they differ. Then open up the discussion to the entire group. Also see page 418.

Chapter 11: Proxy Pattern

  • Discuss the different types of proxy: remote proxy, virtual proxy, and protection proxy. Make sure everyone in the group understands each type of proxy, and come up with examples of each.
  • Discuss the second Brain Power on page 435.
  • Discuss the proxy zoo on page 488. Come up with at least one example habitat for each type of proxy--in other words, examples of when and where you might want to use that type of proxy.

Chapter 12: Compound Patterns

  • Implement a new type of Duck Factory for the Duck Simulator, ducks that eat. Add a new method to the Quackable, eat(), and a new method to Goose, chew(). How would you have to change the Adapter implementation to accommodate Goose? What if the Quackologists wanted to be notified every time a duck ate something--how would you change the Observer implementation to support this?
  • Discuss the graph of the Model View Controller pattern on page 530. Stage a skit representing a graphical user interface: one person is the view (a button and a display); one person is the controller; and one person is the model. When a user comes along and presses the button, what happens? How does the display get updated based on the button press? Review which patterns are involved and how they work in your skit.
  • Now do the same skit for the web: one person is the client (user and web browser); one person is the servlet; one person is the JSP/view, one person is the bean; and one person is the model. Act out in detail what would happen if a user were adding something to a shopping cart.

Chapter 13: Better Living with Patterns

  • Discuss with the group some solutions that you may have used commonly. Do any of these solutions fit an existing pattern that you've studied in the group? If not, could your solution qualify as a potential pattern (page 579)? Why or why not?
  • Find a catalog description of a pattern not covered in the main part of the book (one of the patterns in the index). You can use the GoF's design patterns book, or find one on the Web. Review the pattern with the group and see if you can understand it; then come up with at least one example of when and how to apply this pattern that is not described in the catalog or the Head First Design Patterns index.

Now It's Your Turn

Well, that should be enough to get your started; all it takes is a few people with the interest, our book, some time, and a meeting place. We look forward to hearing how your studies go!