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

JSP
写一个对搜索引擎友好的文章SEO分页类
ajax+jsp草稿自动保存的实现代码
什么是eclipse,eclipse的意思解析
经常听朋友说什么J2EE,终于知道点什么是J2EE了,汗一个
搭建SSH时的思考和遇到的几个问题的解决方法
RMI使用学习 小结
weblogic 8.1下重新编译java类但不用重启服务器的方法
JSP下动态INCLUDE与静态INCLUDE的区别分析
jsp中文乱码 jsp mysql 乱码的解决方法
Jsp页面实现文件上传下载类代码
下载完成后页面不自动关闭的方法
XStream使用方法总结附实例代码
惊现支撑1亿pv/天的超级数据库解决方案
jsp遍历文件夹下的文件的代码
JSP中include指令和include行为的区别
FCKeditor使用方法(FCKeditor_2.6.3)详细使用说明
AJAX FCKEditor Rich Editor整合篇
Java下使用Oracle存储过程(详解)
java AJAX实现级联下拉框
java去掉html标签 必须首先去掉双引号的正则

JSP 中的 Form Your Own Design Pattern Study Group


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-03   浏览: 76 ::
收藏到网摘: 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!