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

JSP
在Jsp Servlet中页面重新定向总汇
JSP 点击链接后下载文件(相当于右键另存)功能
Java 通过设置Referer反盗链
JSP XMLHttpRequest动态无刷新及其中文乱码处理
java session出现的错误
JSP 自定义标签之一 简单实例
JSP Servelet 数据源连接池的配置
jsp web.xml文件的作用及基本配置
java tapestry5 布局 参数的处理
JSP 传递中文参数的例子
通过Setters方式对日期属性及日期格式进行IOC注入
J2EE基础--为什么jsp不能取代servlet?
解析JSP中标签库
JSP三种页面跳转方式的比较
提升JSP应用程序的几个技巧
JSP进行数据库连接的实例
JSP实例程序:统计当前在线人数
EJB初学者怎样面对经常有的十一个疑惑
高手为你解读J2EE开发过程中的异常处理
JSP环境配置:TOMCAT的内存和连接数配置详解

JSP 中的 Form Your Own Design Pattern Study Group


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