You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tiles.apache.org by Antonio Petrelli <an...@gmail.com> on 2007/04/24 17:12:38 UTC

Class name constant convention

Hi all!
I noticed that, in Tiles codebase, when a String constant is used as a
init parameter containing a class name:
* in TilesContainerFactory, it is the base class/interface name in
upper-case-underscore-separated, like in
"org.apache.tiles.CONTAINER_FACTORY";
* in DefinitionsFactory, it is the bas class/interface name itself.

To make things homogeneous, what style do you prefer?
>From my POV, it is best to use the base class/interface name.

Antonio

Re: Class name constant convention

Posted by Antonio Petrelli <an...@gmail.com>.
2007/4/24, David H. DeWolf <dd...@apache.org>:
> The second provides configuration for an implementation class to use.
> I'm assuming these are out of scope of this discussion

Yes, they are out of the scope.

> , but I'd assume
> that they are namespaced in some way so that they can be reused across
> implementations that would have similar config.

I just committed a change in the Tiles site containing the
configuration reference (not complete, but all the names are there).
Maybe you (I mean "you all") can review it to see if something needs
to be changed.

Thanks
Antonio

Re: Class name constant convention

Posted by "David H. DeWolf" <dd...@apache.org>.

Antonio Petrelli wrote:
> Hi all!
> I noticed that, in Tiles codebase, when a String constant is used as a
> init parameter containing a class name:
> * in TilesContainerFactory, it is the base class/interface name in
> upper-case-underscore-separated, like in
> "org.apache.tiles.CONTAINER_FACTORY";
> * in DefinitionsFactory, it is the bas class/interface name itself.
> 
> To make things homogeneous, what style do you prefer?
>> From my POV, it is best to use the base class/interface name.

I think there are two different kinds of configuration.  One which 
specifies a class which implements an interface.  For this, I agree that 
the config parameter should be the interface name.

The second provides configuration for an implementation class to use. 
I'm assuming these are out of scope of this discussion, but I'd assume 
that they are namespaced in some way so that they can be reused across 
implementations that would have similar config.

David
> 
> Antonio
> 

Re: Class name constant convention

Posted by Nathan Bubna <nb...@gmail.com>.
On 4/24/07, Antonio Petrelli <an...@gmail.com> wrote:
> Hi all!
> I noticed that, in Tiles codebase, when a String constant is used as a
> init parameter containing a class name:
> * in TilesContainerFactory, it is the base class/interface name in
> upper-case-underscore-separated, like in
> "org.apache.tiles.CONTAINER_FACTORY";
> * in DefinitionsFactory, it is the bas class/interface name itself.
>
> To make things homogeneous, what style do you prefer?
> From my POV, it is best to use the base class/interface name.

+1

> Antonio
>