Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > what is a helper class ?

Reply
Thread Tools

what is a helper class ?

 
 
maas
Guest
Posts: n/a
 
      09-25-2006

i think you can define a 'helper class' or a 'helper method' as
something that's not 'conceptually' connected to your application,
having no meaning attached to it, serving solely for "helping" other
classes. It has nothing to do with visibility or encapsulation
(public/private...) although you are not expected to use 'helper'
functions from any library.

maas

-
www.marcosaurelio.com

gk wrote:
> Mark Space wrote:
> > Jeffrey Schwab wrote:
> > > gk wrote:
> > >>
> > >> can we say D is now a Helper class ? look i have made D as a member
> > >> variable of class C.
> > >
> > > It's impossible to tell whether D is a mere helper class from the code
> > > you have shown. The fact that C has a member of type D does not tell us

> >
> > Yes, Jeffrey is correct. My Java is a little rusty still, but I think
> > this example might help:
> >
> > // All in file MyBean.java
> > public class MyBean {
> > void setA ( ... ){...};
> > String getA () {...};
> > // Many more methods...
> > // ...
> > }
> > class MyBeanHelper {
> > // Methods here to help MyBean
> > }

>
>
> How its going to help MyBean class ?
>
> whats the relationship with MyBeanHelper class and MyBean class.
>
> you told MyBeanHelper helps MyBean class...but how ?
>
>
>
>
>
>
> >
> > Note that the name is unimportant. MyBeanHelper is a private class that
> > is only accessible from within the MyBean.java file. That means it's
> > probably got only one function, something to do with MyBean. Since it
> > isn't the MyBean class itself, it's safe to assume that it's a helper
> > class for MyBean.


 
Reply With Quote
 
 
 
 
Mark Space
Guest
Posts: n/a
 
      09-26-2006
gk wrote:

> How its going to help MyBean class ?


Just by being there. Presumably it has some methods for MyBean to
call, but there might be other ways too.

>
> whats the relationship with MyBeanHelper class and MyBean class.


They are in the same file. That's all.

>
> you told MyBeanHelper helps MyBean class...but how ?
>


Method invocation, or instantiation. There is no formal relationship
other than both classes exist and one (the helper) has no other
relationship with any other part of the program.
 
Reply With Quote
 
 
 
 
sparkle sparkle is offline
Junior Member
Join Date: Mar 2012
Posts: 1
 
      03-02-2012
Quote:
Originally Posted by gk View Post
Hi,

I want to know , what is a helper class ?

i have seen this term is frequently used in EJB, JAVA ,JSP in many
places.

and it seems to me they have different meaning in different context.

is it so ?

I found normal java classes are helper classes.

why they are called helper then ....does it help ? help to whom ?


can you please show me an example of helper class and tell me how it
helps ?
Although a Java program is sometimes called a class, there are many occasions when a program requires more than one class to get its work done. A multiclass program consists of a main class and any helper classes that are needed. These helper classes earn their name by helping the main class do its work.

Link reference: http://www.informit.com/library/cont...urs&seqNum=129
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Helper class uses main class' pointer Nephi Immortal C++ 1 02-09-2011 11:56 AM
Convenience class vs helper class Crocodile Java 0 09-22-2008 12:50 PM
What's the purpose of the helper cache and is there a way to just turn off helper cache-ing? kevin Ruby 1 07-21-2006 03:42 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
Problem with singleton helper class for java rmi server. Arijit Mukherjee Java 0 01-02-2004 05:01 AM



Advertisments