camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uprooter <uproo...@gmail.com>
Subject DSL Strings pitfalls, how to avoid them?
Date Fri, 15 May 2009 12:56:16 GMT

Hello all.
My first camel ride was really fun, keep up the good work.
I'm concerned about DSL strings.
Specifying strings as methods/beans/pojos is something I'd like to avoid
from two reasons:
Let's say I have something like this in my code:
   from("jms").unmarshal(jaxb).choice().when().method("MyBean","isCommand")

1. Usually, when I rename "MyBean" in standard java code, my  IDE takes care
to scan all my project, sometimes even dependency projects. and do the
refactor. 
In java DSL it does not happen, since it's just a string.

2. Moreover, When I accidentally specify a wrong string instead of "MyBean"
or "isCommand" everything compiles just fine but at runtime errors will
occur  at unpredictable manner, This kind of error can easily get into
production environment in projects that lacks organized testing habits.

The first doubt is something I can live with, but the second is a
problematic issue.
Fix me if I'm wrong. Or if there is any solution to this.
Thanks

-- 
View this message in context: http://www.nabble.com/DSL-Strings-pitfalls%2C-how-to-avoid-them--tp23559311p23559311.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message