camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: WrappedFile
Date Tue, 30 Aug 2011 08:05:45 GMT
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


Mime
View raw message