You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Wai <bz...@gmail.com> on 2011/11/14 22:59:31 UTC

Helper,Worker,Wrapper

Hello All,

Could someone tell me the difference between a Helper class, a Worker class,
and a Wrapper class.  How would I decide whether to create one over another? 
I cannot seem to get the bigger picture just looking at the code.

Thanks All

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Helper-Worker-Wrapper-tp4041022p4041022.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Helper,Worker,Wrapper

Posted by Bilgin Ibryam <bi...@gmail.com>.
These terms are not OFBiz specific, you can see examples of these in
any OO (or other types of) code.

Also it is hard to make a formal distinction among them, because they
overlap most of the time but basically (my understanding is that)

- helper is a class with common (static) methods, used from different
classes(because the methods cannot be put to one or the other class
they are extracted to a helper class).

- workers sometimes are used as helper and sometime to indicate a
class that is executing a task/thread

- wrapper is a little bit different than the previous two, because it
is supposed to wrap another object, so it has a state - the wrapped
object and enrich its functionality(decorator), or provide a
simplified interface(facade) or change the interface(adapter)

HTH
Bilgin Ibryam




On Mon, Nov 14, 2011 at 9:59 PM, Wai <bz...@gmail.com> wrote:
> Hello All,
>
> Could someone tell me the difference between a Helper class, a Worker class,
> and a Wrapper class.  How would I decide whether to create one over another?
> I cannot seem to get the bigger picture just looking at the code.
>
> Thanks All
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Helper-Worker-Wrapper-tp4041022p4041022.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>