Ah .. just realized that if I cast my CamelContext to a
ModelCamelContext I can do all I need to do with RouteDefinitions
(rather than Routes)

On 28 July 2012 17:54, Bob Jolliffe <[email protected]> wrote:
> Thanks Babak
>
> On 28 July 2012 11:42, Babak Vahdat <[email protected]> wrote:
>> Hi
>>
>> the easiest is to check their javadoc:
>>
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Route.html
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/model/RouteDefinition.html
>
> Have done that ...
>
>> Another way around, in the context of the MVC pattern one could claim that
>> the RouteDefinition is 'M' (using JAXB for mapping between Java/XML) whereas
>> the Route abstraction is both the 'V' as well as 'C'.
>
> I almost get what you are saying but it doesn't quite work for me.  If
> the Route is a view (which I know is a bit of a stretch) then it has
> to be a view of something.  I guess I would expect to see a
> getRouteDefinition() method on the Route in that case.
>
> So my question is that starting from the Context you can get a list of
> Routes and a list of RouteDefinitions.  How do these relate to one
> another?  I can see that if the Route/RouteDefinitions have an id.
> then you can find one from the other through that, but the coupling is
> loose and possibly for a good reason.
>
> It seems more that a RouteDefinition is a sort of template for
> creating a Route .. probably there is something historic in this as
> the javadocs refer specifically to the <route /> element, so there is
> clearly a jaxb model type relationship.  Except that the configure()
> method of RouteBuilder also creates a RouteDefinition rather than a
> Route, so RouteDefinition is a bit broader in its semantics than
> that..
>
> Still exploring further .. thanks.
> Bob
>
>>
>> Babak
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/RouteDefinition-vs-Route-tp5716578p5716579.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to