It looks pretty good. But one thing that 'bothers' me is the static
class methods for Inputs and Outputs. They are not very extensible
without having access to the library itself. I assume that we don't
want that in Qi4j at all and instead have some type of
injection/lookup/resolution...

Use-case to consider;
Qi4j don't ship PS/PDF support. I want to extend Inputs to handle some
Postscript format and Outputs to handle some PDF format and a mapper
in between.

Another thing I raised my eye brows for;

Input<String,IOException> input = ...;
Output<JSONObject,RuntimeException> output = ...;
input.transferTo(Transforms.map(new String2JSON(), output);

shouldn't it be

input.transformWith( new String2JSON() ).transferTo( output ):

?? (Don't know if it is implementable...)


And it also feels just a stone throw away from stuff like Camel!!

One things that comes to mind; How about async transfer? Maybe there
is no need to block the thread for the transfer, and if the slow
endpoints are NIO based, then no need to use up a lot of threads for
this.

All in all, the simple APIs looks good (perhaps with some async
semantics as well). If we can come up with a way for the
implementations to reside outside Qi4j Core, then we have something
very powerful.



On Sat, Nov 6, 2010 at 12:52 PM, Rickard Öberg <[email protected]> wrote:
> Hi,
>
> The past week I have battled with shuffling of data between sources, such as
> doing restores of backups and similar. I came to realize that there was a
> pattern behind how these things work, and created a simple API that allows
> inputs and outputs to be encapsulated and easily used in different
> scenarios. I've written a longish blogpost that outlines the thinking, and
> potential usage:
> http://www.jroller.com/rickard/entry/a_generic_input_output_api
>
> If you this solution looks ok, I'd like to introduce it wherever it makes
> sense in our API/SPI, to get a streamlined approach to data and object
> shuffling.
>
> To check it out, update qi4j-core 1.3-SNAPSHOT. It's in the org.qi4j.api.io
> package, with tests.
>
> Comments are more than welcome!
>
> regards, Rickard
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>



-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to