On Jan 3, 2007, at 7:16 AM, Daniel Fagerstrom wrote:
Mark Lundquist skrev:
On Jan 2, 2007, at 2:36 PM, Daniel Fagerstrom wrote:
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 :-)
So if someone have suggestions for a better terminology for the
"polymorphic servlet services" I at least would be prepared to go
for it.
How about just "services"?
To generic in my taste.
I kinda felt that too :-) I actually almost suggested
"servlet-services" but I thought maybe that sounded too unwieldy.
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.
Then "servlet:" makes perfect sense. I like the transparency.
E.g.,
• services-fw
I would prefer servlet-services-fw or just servlet-services.
yeah, bag the "-fw" :-)
• ServiceServlet (or "CocoonServiceServlet"?)
ServletService would be OK.
That class does implement Servlet (extends HttpServlet IIRC) so maybe
"ServiceServlet" emphasizes the right "is-a" relationship there?
• ServiceContext (or "CocoonServiceContext"?)
ServiceServletContext maybe.
yup
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 [...] we could have something like:
<bean id="org.apache.cocoon.blocks.sample.block1"
class="org.apache.cocoon.sitemap.SitemapServlet">
<servlet:context mountPath="/cocoon-blocks-fw-sample1"
contextPath="blockcontext:/cocoon-blocks-fw-sample/test1">
<servlet:context-param name="foo" value="bar"/>
<servlet:connection name="test2"
value-ref="org.apache.cocoon.blocks.sample.block2"/>
</servlet:context>
</bean>
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:
<bean id="myservlet" class="com.mycompany.MyServlet">
<servlet:context mountPath="/my">
</bean>
And would be usable outside Cocoon.
Very nice.
cheers,
—ml—