commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heuer <heue...@acm.org>
Subject Re: [Clazz] names of classes
Date Tue, 17 Jun 2003 23:56:56 GMT

For what it's worth, I've always used ~Support to indicate a class that is
used via delegation to fulfill the contract of an interface.

e.g.

interface XxxInterface
{
  public void a();
}

abstract class AbstractXxx
  implements XxxInterface
{
  public void a() { ...; }
}

class XxxSupport
// may extend AbstractXxx
{
  public void a() { ...; }
}

then you can do

class MyClass
  extends AbstractXxx
{
  ...
}

or

class MyClass
  implements XxxInterface
{
  private XxxSupport support = new XxxSupport();

  public void a() { support.a(); }
}


This is in the spirit of java.beans.PropertyChangeSupport.

   michael


On Tue, 17 Jun 2003, David Graham wrote:

> > > >I do not like the names of ~Support classes. ~Support or ~Helper
> >indicate
> > > >(for me)
> > > >that these are Helper classes with (often static) utility functions. In
> > > the
> > > >Java API I think
> > > >I have found the usage of Abstract~ or Base~ much more often for
> >classes
> > >
> > > You've missed an important difference between Helper classes and
> > > Base/Abstract classes.  Helper classes allow composition/reuse outside
> >of
> > > a
> > > class hierarchy.  Abstract class' methods can only be used by
> >subclasses.
> > >
> >
> >Thanks for expressing that much better than I could. So the ~Suppport
> >classes
> >_are_ Base/Abstract classes, since they are abstract and only used by
> >subclassing in Clazz, aren't they?
>
> I don't work on, nor use the Clazz package so I don't know the details.  I
> was making a statement about OOP design in general.  If the Clazz classes
> you're referring to are, in fact, abstract classes used in a class
> hierarchy, they should be named Abstract* or Base* to follow widely used
> Java naming conventions.
>
> David
>
> >
> >Victor
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message