Download pdf Format

Transcript
Ahmed02.ps
144
10/4/01
|
1:03 PM
Page 144
Chapter 10 Servlets
GenericServlet
(from servlet)
6
7
8
9
0
6
7
8
9
0
6
7
8
9
0
<<Generic_Servlet>>
RateCalculator
+ RateCalculator()
+ init()
+ service()
+ destroy()
+ getServletInfo()
+ calculator()
Figure 10-5
Amortizer
+ Amortizer()
+ service()
+ init()
+ destroy()
+ getServletInfo()
+ update()
+ createTable()
Compact and full representation of a generic servlet
to highlight this aspect. Optionally, the servlet can be tagged with {Single
ThreadServlet=True} instead to clearly identify this on the diagram in a somewhat more compact format.
An example of a servlet that implements the SingleThreadModel is shown in
Figure 10-6.
The HttpServlet class is modeled similarly to GenericServlet, but with the
<<Http_Servlet>> stereotype applied. It can also include the life cycle methods,the
convenience method,and any of the HTTP request handlers previously discussed.
<<Generic_Servlet>>
RateCalculator
6
7
8
9
0
SingleThreadModel
(from servlet)
Figure 10-6
+ RateCalculator()
+ init()
+ service()
+ destroy()
+ getServletInfo()
+ calculator()
Servlet supporting the SingleThreadModel