You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2011/08/30 08:46:25 UTC

WrappedFile

Hi

The WrappedFile seems like when people create a facade for another facade.

public interface WrappedFile<T> {
    T getFile();
}

That WrappedFile is not specific for a File, it could in fact be anything.
So I suggest to come up with a more generic name and API. I bet it
could come handy in another place in the jigsaw.

Could be

public interface WrappedObject<T> {
    T getObject();
}

Or

public interface WrappedEntity<T> {
    T getEntity();
}

Or

public interface Facade<T> {
    T getTarget();
}

Or something else.

Also any API in the root package should have javadoc, stating its
purpose and what it does.


-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: WrappedFile

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Claus,

technically you are correct. WrappedFile is rather a WrappedObject. But 
this is not the intent.

The intent is to have an interface for the minimum part of GenericFile 
that is needed outside of the file component. This is necessary to avoid 
having other parts of camel know about the inner details of the file 
component.

My solution is not ideal but it works for the moment. In the future I 
would like to change the file component to not use generics and a 
special message at all. I think the best way to send files is to create 
a DefaultMessage and add the File as body. For all other details needed 
I would use headers. I would like to do this for camel 3.0.

Christian


Am 30.08.2011 08:46, schrieb Claus Ibsen:
> Hi
>
> The WrappedFile seems like when people create a facade for another facade.
>
> public interface WrappedFile<T>  {
>      T getFile();
> }
>
> That WrappedFile is not specific for a File, it could in fact be anything.
> So I suggest to come up with a more generic name and API. I bet it
> could come handy in another place in the jigsaw.
>
> Could be
>
> public interface WrappedObject<T>  {
>      T getObject();
> }
>
> Or
>
> public interface WrappedEntity<T>  {
>      T getEntity();
> }
>
> Or
>
> public interface Facade<T>  {
>      T getTarget();
> }
>
> Or something else.
>
> Also any API in the root package should have javadoc, stating its
> purpose and what it does.
>
>


-- 
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com