On 03/12/2016 13:15, Martin Grigorov wrote:
Hi Andrea,
A comment from me: is there really a need of two functions ?
SerializableFunction<AttributesWrapper, Object> respondFunction,
SerializableFunction<Object, String> outputTextFunction
IMO one function is enough: SerializableFunction<AttributesWrapper, Void>
respondFunction
There the developer could use the webRequest and WebResponse from the
attributes and read/write whatever is needed.
I partially agree. I think it would be good if we have the best of the
two solutions, that is:
- have a factory with two functions (as is now) if we want to build a
rest resource that writes text as response
- specify just a consumer (or a SerializableFunction<AttributesWrapper,
Void> as you told) and let developers do what they want
Also in the current impl it seems to be possible to write response body for
HEAD requests. I guess the idea is to leave it to the application to decide
what to do in the respondFunction. But maybe you could help a bit by
passing HeaderOnlyWebResponse in the attributes and throw an exception if
#write() methods are used.
That's a good point. I will work in this direction.
Thank you for your review!
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Dec 2, 2016 at 5:50 PM, Andrea Del Bene <an.delb...@gmail.com>
wrote:
Hi,
in the next days I'd like to finalize a new module to add to Wicketstuff
(for Wicket 8) that adds the ability to write REST services using lambdas,
in a way that resembles Spark web framework ( to be confused with
thenamesake big data framework). I'd like to write an article about it
where I will also mention the upcoming lambda support (for this part I will
reference Martijn presentation :-) ). But before proceeding I'd like to
hear your opinion.
The module's repository with the a short introduction is here:
https://github.com/bitstorm/wicketstuff-rest-lambda
Thank you.
Andrea.