Hi Sean,
> I was thinking of a Resource as a data or representation object when, in fact,
> it is a dispatch target.
>From the javadoc:
Another definition adapted from the URI standard (RFC 3986): a resource
is the conceptual mapping to a representation (also known as entity) or set
of representations, not necessarily the representation which corresponds to
that mapping at any particular instance in time. Thus, a resource can remain
constant even when its content (the representations to which it currently
corresponds) changes over time, provided that the conceptual mapping is not
changed in the process. In addition, a resource is always identified by a
URI.
> What still confuses me is why it doesn't extend Restlet. I would expect
> everything that can be in the pipeline to be a Restlet. Can you clarify?
If I understand correctly, the new philosophy is that you have one single
- shared- Finder (which extends Restlet) in the pipeline. When you call
router.attach("/somepath", MyResource.class), you're not adding a resource to
the pipeline, you're just informing the Finder that it has to
instanciate a MyResource object in order to resolve the 'somepath' path.
Of course, you can still do it the old way by defining your own finders and
adding them to the pipeline.
-Vincent.