Helper,Worker,Wrapper

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Wai
Reply | Threaded
Open this post in threaded view
|

Helper,Worker,Wrapper

Wai
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
Reply | Threaded
Open this post in threaded view
|

Re: Helper,Worker,Wrapper

Bilgin Ibryam-2
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 <[hidden email]> 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.
>