You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by Knut Urdalen <kn...@php.no> on 2009/05/04 23:04:28 UTC

Class naming convention and directory structure

Hi,

While cleaning up I'm wondering if we also should care about the naming 
convention of the class names and directory structure? If we should do 
it, this is the right time to do it.

I propose these changes in class names to align all names with eachother.

LoggerPatternLayout -> LoggerLayoutPattern
LoggerXmlLayout -> LoggerLayoutXml
LoggerDefaultRenderer -> LoggerRendererDefault
LoggerObjectRenderer -> LoggerRendererObject
LoggerPropertyConfigurator -> LoggerConfiguratorProperty
LoggerBasicConfigurator -> LoggerConfiguratorBasic
LoggerDOMConfigurator -> LoggerConfiguratorDOM
LoggerDenyAllFilter -> LoggerFilterDenyAll
LoggerLevelMatchFilter -> LoggerFilterLevelMatch
LoggerLevelRangeFilter -> LoggerFilterLevelRange
LoggerStringMatchFilter -> LoggerFilterStringMatch

We can also rename some folders:

varia -> filters
or -> renderers
xml -> configurators (and move all configurators here)

The "spi" folder only contains one interface. We could rename this 
folder to "core" i.e. and put all abstract classes, base classes and 
interfaces here.

Let me know what you think! Is it ok for you? Any objections? If you 
don't disagree I can apply this soon.

Knut


Re: Class naming convention and directory structure

Posted by Christian Grobmeier <gr...@gmail.com>.
> Yes, LoggerPropertyGetter can be removed, and we should also try to get rid
> of LoggerPropertySetter in my eyes. Utilizing __get() and __set() magic
> methods is a little nicer option in PHP 5.

OK at removing Getter. About property setter: we have several other
places in code where methods named "factory" and "singleton" exist.
They are used for reflective creation of f.e. appender classes. I
think those methods should be moved to ReflectionUtils.

I am not sure about the __get() and __set() too - this looks like an
interceptor in aop style rather more than the normal getter/setter
philosphie.

Christian


>>
>> Why not have all core classes in the "root" folder src/main/php/* ?
>>
>
> Yes, let's have all these classes in "root"-folder.
>
> Knut
>
>

Re: Class naming convention and directory structure

Posted by Knut Urdalen <kn...@php.no>.
Christian Grobmeier wrote:
> +1 on all!
>
>   
Cool :) Then I'll reorganize this soon.
> In the config folder is just LoggerPropertyGetter/Setter. This should
> be core (as ReflectionUtils) or in the configurators folder too.
> LoggerPropertyGetter doesn't provide anything, should be removed.
> LoggerPropertySetter could be renamed to ReflectionUtils (cause its
> not only for configurations imho)
>   
Yes, LoggerPropertyGetter can be removed, and we should also try to get 
rid of LoggerPropertySetter in my eyes. Utilizing __get() and __set() 
magic methods is a little nicer option in PHP 5.
> Why not have all core classes in the "root" folder src/main/php/* ?
>   
Yes, let's have all these classes in "root"-folder.

Knut


Re: Class naming convention and directory structure

Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,

+1 on all!


> xml -> configurators (and move all configurators here)

In the config folder is just LoggerPropertyGetter/Setter. This should
be core (as ReflectionUtils) or in the configurators folder too.
LoggerPropertyGetter doesn't provide anything, should be removed.
LoggerPropertySetter could be renamed to ReflectionUtils (cause its
not only for configurations imho)

> The "spi" folder only contains one interface. We could rename this folder to
> "core" i.e. and put all abstract classes, base classes and interfaces here.

Why not have all core classes in the "root" folder src/main/php/* ?

> Let me know what you think! Is it ok for you? Any objections? If you don't
> disagree I can apply this soon.

Cool :-)
Christian