You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2012/10/09 13:13:35 UTC

[v2] abstract class name pattern

Hi All:

I see that some of our abstract class names are called one of:

1) AbstractFoo (e.g. AbstractLogger)
2) Foo (e.g. ConfigurationFactory)
3) FooBase (e.g. AppenderBase)

This is all pretty inconsistent. I like (1) the best and find (3) rather
bad.

I can talk about "an abstract foo doing something", "a foo doing
something", but never would (an English speaker at least) talk about "a foo
base doing something", that is just not a proper sentence fragment. Unless
you are talking about chemistry I suppose, but not in our domain.

I propose to start by changing (3)s into (1)s. We can decide about (2)s
now, later or on a case by case basis. But for me, consistency is better.
When I see an AbstractFoo in the code, I know what I am dealing an abstract
type.

Thoughts?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [v2] abstract class name pattern

Posted by Paul Benedict <pb...@apache.org>.
+1 for option 1)

On Tue, Oct 9, 2012 at 6:13 AM, Gary Gregory <ga...@gmail.com> wrote:

> Hi All:
>
> I see that some of our abstract class names are called one of:
>
> 1) AbstractFoo (e.g. AbstractLogger)
> 2) Foo (e.g. ConfigurationFactory)
> 3) FooBase (e.g. AppenderBase)
>
> This is all pretty inconsistent. I like (1) the best and find (3) rather
> bad.
>
> I can talk about "an abstract foo doing something", "a foo doing
> something", but never would (an English speaker at least) talk about "a foo
> base doing something", that is just not a proper sentence fragment. Unless
> you are talking about chemistry I suppose, but not in our domain.
>
> I propose to start by changing (3)s into (1)s. We can decide about (2)s
> now, later or on a case by case basis. But for me, consistency is better.
> When I see an AbstractFoo in the code, I know what I am dealing an abstract
> type.
>
> Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

Re: [v2] abstract class name pattern

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Oct 9, 2012 at 12:12 PM, Gary Gregory <ga...@gmail.com>wrote:

> On Tue, Oct 9, 2012 at 9:52 AM, Ralph Goers <ra...@dslextreme.com>wrote:
>
>> Despite writing most of the code, I didn't start from scratch.  I would
>> guess that most of the classes named *Base were pulled in from log4j 1.x
>> and modified.  I don't mind moving in the direction of 1).  Note though,
>> that although ConfigurationFactory is a base class it also has the static
>> methods that create all the ConfigurationFactory instances.
>>
>
> Right, which is why I am proposing a two-step, 1) change *Base to
> Abstract* and 2) consider the others individually.
>

Step 1 is in SVN.

Gary


>
> Gary
>
>>
>> Ralph
>>
>> On Oct 9, 2012, at 4:13 AM, Gary Gregory wrote:
>>
>> Hi All:
>>
>> I see that some of our abstract class names are called one of:
>>
>> 1) AbstractFoo (e.g. AbstractLogger)
>> 2) Foo (e.g. ConfigurationFactory)
>> 3) FooBase (e.g. AppenderBase)
>>
>> This is all pretty inconsistent. I like (1) the best and find (3) rather
>> bad.
>>
>> I can talk about "an abstract foo doing something", "a foo doing
>> something", but never would (an English speaker at least) talk about "a foo
>> base doing something", that is just not a proper sentence fragment. Unless
>> you are talking about chemistry I suppose, but not in our domain.
>>
>> I propose to start by changing (3)s into (1)s. We can decide about (2)s
>> now, later or on a case by case basis. But for me, consistency is better.
>> When I see an AbstractFoo in the code, I know what I am dealing an abstract
>> type.
>>
>> Thoughts?
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> JUnit in Action, 2nd Ed: <http://goog_1249600977/>http://bit.ly/ECvg0
>> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [v2] abstract class name pattern

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Oct 9, 2012 at 9:52 AM, Ralph Goers <ra...@dslextreme.com>wrote:

> Despite writing most of the code, I didn't start from scratch.  I would
> guess that most of the classes named *Base were pulled in from log4j 1.x
> and modified.  I don't mind moving in the direction of 1).  Note though,
> that although ConfigurationFactory is a base class it also has the static
> methods that create all the ConfigurationFactory instances.
>

Right, which is why I am proposing a two-step, 1) change *Base to Abstract*
and 2) consider the others individually.

Gary

>
> Ralph
>
> On Oct 9, 2012, at 4:13 AM, Gary Gregory wrote:
>
> Hi All:
>
> I see that some of our abstract class names are called one of:
>
> 1) AbstractFoo (e.g. AbstractLogger)
> 2) Foo (e.g. ConfigurationFactory)
> 3) FooBase (e.g. AppenderBase)
>
> This is all pretty inconsistent. I like (1) the best and find (3) rather
> bad.
>
> I can talk about "an abstract foo doing something", "a foo doing
> something", but never would (an English speaker at least) talk about "a foo
> base doing something", that is just not a proper sentence fragment. Unless
> you are talking about chemistry I suppose, but not in our domain.
>
> I propose to start by changing (3)s into (1)s. We can decide about (2)s
> now, later or on a case by case basis. But for me, consistency is better.
> When I see an AbstractFoo in the code, I know what I am dealing an abstract
> type.
>
> Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977/>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [v2] abstract class name pattern

Posted by Ralph Goers <ra...@dslextreme.com>.
Despite writing most of the code, I didn't start from scratch.  I would guess that most of the classes named *Base were pulled in from log4j 1.x and modified.  I don't mind moving in the direction of 1).  Note though, that although ConfigurationFactory is a base class it also has the static methods that create all the ConfigurationFactory instances.

Ralph

On Oct 9, 2012, at 4:13 AM, Gary Gregory wrote:

> Hi All:
> 
> I see that some of our abstract class names are called one of:
> 
> 1) AbstractFoo (e.g. AbstractLogger)
> 2) Foo (e.g. ConfigurationFactory)
> 3) FooBase (e.g. AppenderBase)
> 
> This is all pretty inconsistent. I like (1) the best and find (3) rather bad. 
> 
> I can talk about "an abstract foo doing something", "a foo doing something", but never would (an English speaker at least) talk about "a foo base doing something", that is just not a proper sentence fragment. Unless you are talking about chemistry I suppose, but not in our domain.
> 
> I propose to start by changing (3)s into (1)s. We can decide about (2)s now, later or on a case by case basis. But for me, consistency is better. When I see an AbstractFoo in the code, I know what I am dealing an abstract type.
> 
> Thoughts?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory