On Sun, Jan 18, 2009 at 12:43 PM, Ramon Buckland <ra...@thebuckland.com> wrote:
> Hi Dev'sm,
>
> Recently I remember reading about removing dotted notation header names from
> code. (a slow wide reaching change).
>
> I am currently working on CAMEL-1241 and have come across the following.
>
> {{{
>            getIn().setHeader("file.remote.host", remoteFile.getHostname());
>            getIn().setHeader("file.remote.absoluteName",
> remoteFile.getAbsolutelFileName());
>            getIn().setHeader("file.remote.relativeName",
> remoteFile.getRelativeFileName());
>            getIn().setHeader("file.remote.name", remoteFile.getFileName());
> }}}
>
>
> With my refactoring, the properties logically change to
>
> remote impl
>            getIn().setHeader("file.remote.host", remoteFile.getHostname());
>            ...
> generic impl
>            getIn().setHeader("file.absoluteName",
> remoteFile.getAbsolutelFileName());
>            getIn().setHeader("file.relativeName",
> remoteFile.getRelativeFileName());
>            getIn().setHeader("file.name", remoteFile.getFileName());
>
> Should I leave the dotted notation properties as is ?
> Or is there a standard to use for this ?
>
Yeah the problem with the dots is really the JMS where some brokers
don't allow dots in keys for JMS properties. So to work seamless with
Camel exchanges over JMS we should avoid the dots. But its such a
common practice in Java to use package prefixes for keys. So they are
hard to get rid of.

James suggested to use CamelComponentNameKeyName as convention, eg.
CamelFileFileName, CamelFileFileAbsoluteName etc.

Keeping the old syntax names in FTP/File component in Camel 2.0 was to
be kinda of backwards compatible and that fact we havent made the big
decision if we should refactor all the kets using the new style.

We have the chance with Camel 2.0 where its not backwards compatible
out-of-the-box in all cases. So its better to fix it now, or we have
to wait until Camel 3.0

Any thoughts?


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Reply via email to