cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <dani...@nada.kth.se>
Subject Re: What is the deal with "blocks"
Date Wed, 03 Jan 2007 15:16:04 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mark Lundquist skrev:<br>
<blockquote cite="mid7a43112048ab0cd841d8610059e196a4@comcast.net"
 type="cite">On Jan 2, 2007, at 2:36 PM, Daniel Fagerstrom wrote:
  <br>
  <br>
  <blockquote>Finding some term that doesn't contain the word block for
"polymorphic servlet services", would be much less of a problem as it
is different from the original block concept and not that many people
have used the blocks-fw yet.Fair enough :-)
    <br>
  </blockquote>
  <blockquote>So if someone have suggestions for a better terminology
for
the "polymorphic servlet services" I at least would be prepared to go
for it.
    <br>
  </blockquote>
  <br>
How about just "services"? E.g.,
  <br>
  <br>
• services-fw
  <br>
</blockquote>
I would prefer servlet-services-fw or just servlet-services.<br>
<blockquote cite="mid7a43112048ab0cd841d8610059e196a4@comcast.net"
 type="cite"> • ServiceServlet (or "CocoonServiceServlet"?)
  <br>
</blockquote>
ServletService would be OK.<br>
<blockquote cite="mid7a43112048ab0cd841d8610059e196a4@comcast.net"
 type="cite"> • ServiceContext (or "CocoonServiceContext"?)
  <br>
</blockquote>
ServiceServletContext maybe.<br>
<blockquote cite="mid7a43112048ab0cd841d8610059e196a4@comcast.net"
 type="cite"> • "service:" protocol
  <br>
</blockquote>
To generic in my taste. I think that "servlet:" protocol would describe
pretty well what it all is about. Also it is implemented using the
named dispatcher mechanism in the ServletContext, so it really is named
servlets that the protocol dispatches to.<br>
<br>
Also we could add some Spring bean factory and XML-schema based
configuration, that put the focus on the embedded servlet instead of
the "blocks fw" so instead of:<br>
<pre><tt>  &lt;bean id="org.apache.cocoon.blocks.sample.block1" class="org.apache.cocoon.blocks.BlockServlet"&gt;
    &lt;property name="mountPath" value="/cocoon-blocks-fw-sample1"/&gt;
    &lt;property name="servletClass" value="org.apache.cocoon.sitemap.SitemapServlet"/&gt;
    &lt;property name="blockContextURL" value="blockcontext:/cocoon-blocks-fw-sample/test1"/&gt;
    &lt;property name="properties"&gt;
      &lt;map&gt;
        &lt;entry key="foo" value="bar"/&gt;
      &lt;/map&gt;
    &lt;/property&gt;
      &lt;property name="connections"&gt;
      &lt;map&gt;
        &lt;entry key="test2" value-ref="org.apache.cocoon.blocks.sample.block2"/&gt;
      &lt;/map&gt;
    &lt;/property&gt;
  &lt;/bean&gt;</tt>
</pre>
<br>
we could have something like:<br>
<pre>  &lt;bean id="org.apache.cocoon.blocks.sample.block1" class="org.apache.cocoon.sitemap.SitemapServlet"&gt;
    &lt;servlet:context mountPath="/cocoon-blocks-fw-sample1"
                     contextPath="blockcontext:/cocoon-blocks-fw-sample/test1"&gt;
      &lt;servlet:context-param name="foo" value="bar"/&gt;
      &lt;servlet:connection name="test2" value-ref="org.apache.cocoon.blocks.sample.block2"/&gt;
    &lt;/servlet:context&gt; 
  &lt;/bean&gt;
</pre>
The point here is that the sitemap servlet is considered as an ordinary
bean and the elements in the servlet name space sets up a bean factory
that embeds the sitemap servlet in a block servlet and make sure that
the somewhat special life cycle of servlets is respected. Using a
servlet in the Spring framework would be as easy as:<br>
<pre>  &lt;bean id="myservlet" class="com.mycompany.MyServlet"&gt;
    &lt;servlet:context mountPath="/my"&gt;
  &lt;/bean&gt;
</pre>
And would be usable outside Cocoon.<br>
<br>
Another advantage of dropping the prefix "block" from the "polymorphic
servlet service" stuff is that I get the impression that many people
believe that anything that is prefixed with block is incredibly
complicated. While the current stuff actually isn't.<br>
<br>
WDYT?<br>
<br>
/Daniel<br>
<br>
</body>
</html>

Mime
View raw message