transformer vs. component

View: New views
4 Messages — Rating Filter:   Alert me  

transformer vs. component

by rotten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This should probably be an FAQ sort of thing.  From a design perspective when do you use a transformer, and when do you use a component?

My impression is that a transformer is primarily to convert data from one type to another type and a component is used when you need to change the data, do computations, or take some other action (besides the actions specified in the outbound router).

There seems to be a gray area there that I'd love to hear other Mule users elaborate on...


Re: transformer vs. component

by Dimitar Dimitrov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I've shared an opinion here: http://foobarbazqux.blogspot.com/2008/07/transformers-vs-components.html

In general, transformers have conceptually simpler interface - they are supposed to get a payload and return a payload, possibly of different type.  Components allow you to take advantage of te full Mule processing model.

Re: transformer vs. component

by Nirav :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is very good article Dimitrov,

I think the main difference is you can perform business logic in component, however it is not advisable in transformer.

Let's take an example in which you have to populate database from some type of inbound say email.

Now specific requirement is like if mail is part of existing conversation then you have to update a row instead of insert a new row.

Here I think you can't use JDBC outbound so you can write JDBC code in component to achieve your goal.

Dimitrov, Rotten, Please correct me if I am wrong.


Dimitar Dimitrov wrote:
Hi, I've shared an opinion here: http://foobarbazqux.blogspot.com/2008/07/transformers-vs-components.html

In general, transformers have conceptually simpler interface - they are supposed to get a payload and return a payload, possibly of different type.  Components allow you to take advantage of te full Mule processing model.
Thanks & Regards,
Nirav Bharat Naik | Software Developer@i-Logicon IS | Bangalore.

Re: transformer vs. component

by Ross Mason-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's a great article Dimitrov. I'll let Jackie know about it to make  
sure we cover the points in our documentation.

In a nutshell, a transformer is for doing simple "one in, one out"  
data transformations that do not require other services for performing  
the transformation.

A component becomes a service that can perform much more complex logic  
and orchestration of data.  Essentially a component encompasses  
Business logic or business processes.

Cheers,

Ross Mason
CTO, Co-Founder
MuleSource Inc.

http://mulesource.com | http://blog.rossmason.com





On 24 Jul 2008, at 07:18, Nirav wrote:

>
> It is very good article Dimitrov,
>
> I think the main difference is you can perform business logic in  
> component,
> however it is not advisable in transformer.
>
> Let's take an example in which you have to populate database from  
> some type
> of inbound say email.
>
> Now specific requirement is like if mail is part of existing  
> conversation
> then you have to update a row instead of insert a new row.
>
> Here I think you can't use JDBC outbound so you can write JDBC code in
> component to achieve your goal.
>
> Dimitrov, Rotten, Please correct me if I am wrong.
>
>
>
> Dimitar Dimitrov wrote:
>>
>> Hi, I've shared an opinion here:
>> http://foobarbazqux.blogspot.com/2008/07/transformers-vs-components.html
>>
>> In general, transformers have conceptually simpler interface - they  
>> are
>> supposed to get a payload and return a payload, possibly of different
>> type.  Components allow you to take advantage of te full Mule  
>> processing
>> model.
>>
>
>
> -----
> Thanks & Regards,
> Nirav Bharat Naik | Software Developer@i-Logicon IS | Bangalore.
> --
> View this message in context: http://www.nabble.com/transformer-vs.-component-tp18610215p18625563.html
> Sent from the Mule - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email