You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Thomas Dudziak <to...@gmail.com> on 2005/04/24 15:09:44 UTC

[vote] Naming standard

Following our discussion, I thought it useful to vote about a naming
standard and - if successful - apply it prior to releasing the first
version of the 1.1 branch.

In the discussion the following scheme has emerged so I hereby propose it:

* Interfaces for extension points have plain names, e.g. QueryFactory,
PersistenceBroker etc.

[ ] +1
[ ] +/- 0
[ ] -1

* The class names of Implementations of such interfaces end in "Impl".

[ ] +1
[ ] +/- 0
[ ] -1

* Abstract base classes of such implementations have their name ending
in "AbstractImpl"

[ ] +1
[ ] +/- 0
[ ] -1

* If OJB ships with one concrete implementation, and the interface is
meant to be an extension point for users for their own implementations
(e.g. ProxyFactory), then the implementation class name ends in
"DefaultImpl".

[ ] +1
[ ] +/- 0
[ ] -1

* Static factory classes will be removed. To my knowledge there are
only two such classes in the 1.1 branch: QueryFactory and
PersistenceBrokerFactory. The former is not really necessary because
the methods only wrap around a constructor class. The latter mainly
wraps around methods in the OJB class. The most interesting methods
(defaultPersistenceBroker, createPersistenceBroker, etc.) should be
moved to the OJB class.

[ ] +1
[ ] +/- 0
[ ] -1

* Abbreviations where the unabbreviated name is used in OJB, are
replaced with the unabbreviated name. E.g. PersistenceConfigurationKey
instead of PCKey.

[ ] +1
[ ] +/- 0
[ ] -1

regards,
Tom

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


Re: [vote] Naming standard

Posted by Martin Kalén <mk...@apache.org>.
Thomas Dudziak wrote:
> * Interfaces for extension points have plain names, e.g. QueryFactory,
> PersistenceBroker etc.

+1

> * The class names of Implementations of such interfaces end in "Impl".

+0

I don't think this is needed in general, but OJB has a history with this
naming and I agree with Armin's point of "InterfaceNameAImpl" and
"InterfaceNameBImpl" beeing easy to group together.

> * Abstract base classes of such implementations have their name ending
> in "AbstractImpl"

+1

> * If OJB ships with one concrete implementation, and the interface is
> meant to be an extension point for users for their own implementations
> (e.g. ProxyFactory), then the implementation class name ends in
> "DefaultImpl".

+0

Don't have a strong opinion about this one.

> * Static factory classes will be removed. To my knowledge there are
> only two such classes in the 1.1 branch: QueryFactory and
> PersistenceBrokerFactory. The former is not really necessary because
> the methods only wrap around a constructor class. The latter mainly
> wraps around methods in the OJB class. The most interesting methods
> (defaultPersistenceBroker, createPersistenceBroker, etc.) should be
> moved to the OJB class.

-0

I don't think QueryFactory is too "evil", but I have not extensively
followed the 1.1 IoC refactoring so I am not voting against this.

> * Abbreviations where the unabbreviated name is used in OJB, are
> replaced with the unabbreviated name. E.g. PersistenceConfigurationKey
> instead of PCKey.

-1

The old "PBKey" is a well-known entity in the "PB-API world context",
I do not see any problems with having some abbreviated class names.

I also don't see a problem with having "PersistenceConfiguration"
and "PCKey" co-existing.



Thanks for summing up the vote, Tom!
Regards,
  Martin

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


Re: [vote] Naming standard

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi tom,

well there are no problems with parameters but i was used (Smalltalk 
background) to prefix parameters with 'a'

public void doSomething(String aName, Broker aBroker.....)

to distinguish parameters from temp vars.

jakob

Thomas Dudziak schrieb:

>On 4/24/05, Jakob Braeuchi <jb...@gmx.ch> wrote:
>
>  
>
>>here are the results of the swiss jury.
>>what about naming of instvars, parameters etc. ?
>>    
>>
>
>I didn't include the variables because they are not visible to users
>so they don't have to be fixed once the first version of 1.1 is out.
>What problems do you see with the parameters ?
>
>Tom
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>  
>

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


Re: [vote] Naming standard

Posted by Thomas Dudziak <to...@gmail.com>.
On 4/24/05, Jakob Braeuchi <jb...@gmx.ch> wrote:

> here are the results of the swiss jury.
> what about naming of instvars, parameters etc. ?

I didn't include the variables because they are not visible to users
so they don't have to be fixed once the first version of 1.1 is out.
What problems do you see with the parameters ?

Tom

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


Re: [vote] Naming standard

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi all,

here are the results of the swiss jury.
what about naming of instvars, parameters etc. ?

jakob

Thomas Dudziak schrieb:

>Following our discussion, I thought it useful to vote about a naming
>standard and - if successful - apply it prior to releasing the first
>version of the 1.1 branch.
>
>In the discussion the following scheme has emerged so I hereby propose it:
>
>* Interfaces for extension points have plain names, e.g. QueryFactory,
>PersistenceBroker etc.
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>* The class names of Implementations of such interfaces end in "Impl".
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>* Abstract base classes of such implementations have their name ending
>in "AbstractImpl"
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>* If OJB ships with one concrete implementation, and the interface is
>meant to be an extension point for users for their own implementations
>(e.g. ProxyFactory), then the implementation class name ends in
>"DefaultImpl".
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>* Static factory classes will be removed. To my knowledge there are
>only two such classes in the 1.1 branch: QueryFactory and
>PersistenceBrokerFactory. The former is not really necessary because
>the methods only wrap around a constructor class. The latter mainly
>wraps around methods in the OJB class. The most interesting methods
>(defaultPersistenceBroker, createPersistenceBroker, etc.) should be
>moved to the OJB class.
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>* Abbreviations where the unabbreviated name is used in OJB, are
>replaced with the unabbreviated name. E.g. PersistenceConfigurationKey
>instead of PCKey.
>
>[X] +1
>[ ] +/- 0
>[ ] -1
>
>regards,
>Tom
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>  
>

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


Re: [vote] Naming standard

Posted by Armin Waibel <ar...@apache.org>.
Armin Waibel wrote:

>> * Static factory classes will be removed. To my knowledge there are
>> only two such classes in the 1.1 branch: QueryFactory and
>> PersistenceBrokerFactory. The former is not really necessary because
>> the methods only wrap around a constructor class. The latter mainly
>> wraps around methods in the OJB class. The most interesting methods
>> (defaultPersistenceBroker, createPersistenceBroker, etc.) should be
>> moved to the OJB class.

If we separate the PB-API from the OJB-Kernel api (we discussed this in 
another thread) in 1.1 this will be done automatic.

Armin

>>
>> [ x] +1
>> [ ] +/- 0
>> [ ] -1
>>

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


Re: [vote] Naming standard

Posted by Armin Waibel <ar...@apache.org>.
Hi,

Thomas Dudziak wrote:
> Following our discussion, I thought it useful to vote about a naming
> standard and - if successful - apply it prior to releasing the first
> version of the 1.1 branch.
> 
> In the discussion the following scheme has emerged so I hereby propose it:
> 
> * Interfaces for extension points have plain names, e.g. QueryFactory,
> PersistenceBroker etc.
> 
> [x ] +1
> [ ] +/- 0
> [ ] -1
> 
> * The class names of Implementations of such interfaces end in "Impl".
> 
> [x ] +1
> [ ] +/- 0
> [ ] -1
> 
> * Abstract base classes of such implementations have their name ending
> in "AbstractImpl"
> 
> [x ] +1
> [ ] +/- 0
> [ ] -1
> 
> * If OJB ships with one concrete implementation, and the interface is
> meant to be an extension point for users for their own implementations
> (e.g. ProxyFactory), then the implementation class name ends in
> "DefaultImpl".
> 
> [ x] +1
> [ ] +/- 0
> [ ] -1
> 
> * Static factory classes will be removed. To my knowledge there are
> only two such classes in the 1.1 branch: QueryFactory and
> PersistenceBrokerFactory. The former is not really necessary because
> the methods only wrap around a constructor class. The latter mainly
> wraps around methods in the OJB class. The most interesting methods
> (defaultPersistenceBroker, createPersistenceBroker, etc.) should be
> moved to the OJB class.
> 
> [ x] +1
> [ ] +/- 0
> [ ] -1
> 
> * Abbreviations where the unabbreviated name is used in OJB, are
> replaced with the unabbreviated name. E.g. PersistenceConfigurationKey
> instead of PCKey.
> 
> [ ] +1
> [x ] +/- 0
> [ ] -1
>

I'm not confident about this (but if most other developer agree with 
that I will accept it).
PCKey will be used often and the user/developer has to type the full 
name on the IDE when used first or when used in documentation, email, 
... - this is really nasty.
Using PersistenceConfiguration is the base concept of 1.x, so it's 
evident for user/developer what PC means. If we allow to rename 
PersistenceConfiguration.java to PC.java and use PCKey to lookup these 
instances, then I agree with this naming convention.
Or is the intention to completely avoid abbreviations?

regards,
Armin

> regards,
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

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


Re: [vote] Naming standard

Posted by Armin Waibel <ar...@apache.org>.
Brian McCallister wrote:

>> * The class names of Implementations of such interfaces end in "Impl".
>>
>> [ ] +1
>> [ ] +/- 0
>> [X ] -1
> 
> 
> Use a descriptive name instead.
>

Think we should difference in this case.

If the interface named StatementManager and OJB shipped with one 
pluggable class, then StatementManagerImpl/StatementManagerDefaultImpl 
is descriptive enough (what will be more descriptive?). The OJB user can 
extend/implement his own class and can name it 
StatementManagerMyCompanyImpl.

On the other hand we have interfaces like ObjectCache. In this case a 
descriptive name is mandatory, because OJB itself shipped with several 
versions and the function of ObjectCache is not clear. So names like 
ObjectCacheReadOnlyImpl, ObjectCacheTwoLevelImpl, ... are useful.


>>
>> * Abstract base classes of such implementations have their name ending
>> in "AbstractImpl"
>>
>> [ ] +1
>> [ ] +/- 0
>> [X ] -1
> 
> 
> Would prefer BaseFoo or, even better a descriptive name, to 
> FooAbstractImpl.
>

Could you give an example. What will be the descriptive name of 
ConnectionFactoryAbstractImpl? 
AbstractConnectionFactory/BaseConnectionFactory isn't more descriptive.


>>
>> * If OJB ships with one concrete implementation, and the interface is
>> meant to be an extension point for users for their own implementations
>> (e.g. ProxyFactory), then the implementation class name ends in
>> "DefaultImpl".
>>
>> [ ] +1
>> [ ] +/- 0
>> [X ] -1
> 
> 
> DefaultProxyFactory is way better than ProxyFactoryDefaultImpl
>

but then you have to look for
DefaultProxyFactory
JDKProxyFactory
CGLibProxyFactory

if you don't know the name in advance you have to search all class names 
(or look for all implementations of ProxyFactory interface) to find the 
shipped implementation classes. If we use
ProxyFactoryDefaultImpl
ProxyFactoryJDKImpl
ProxyFactoryCGLibImpl
it's easier to "bunch" the different implementation classes.

Seems you don't like the
AInterfaceNameImpl/AInterfaceNameDefaultImpl
naming convention in general.
Is it a linguistic problem? E.g. no one would say "BallGreen" if a 
"green ball" was meant.

regards,
Armin

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


Re: [vote] Naming standard

Posted by Brian McCallister <br...@apache.org>.
On Apr 24, 2005, at 9:09 AM, Thomas Dudziak wrote:

> Following our discussion, I thought it useful to vote about a naming
> standard and - if successful - apply it prior to releasing the first
> version of the 1.1 branch.
>
> In the discussion the following scheme has emerged so I hereby propose 
> it:
>
> * Interfaces for extension points have plain names, e.g. QueryFactory,
> PersistenceBroker etc.
>
> [X ] +1
> [ ] +/- 0
> [ ] -1
>
> * The class names of Implementations of such interfaces end in "Impl".
>
> [ ] +1
> [ ] +/- 0
> [X ] -1

Use a descriptive name instead.

>
> * Abstract base classes of such implementations have their name ending
> in "AbstractImpl"
>
> [ ] +1
> [ ] +/- 0
> [X ] -1

Would prefer BaseFoo or, even better a descriptive name, to 
FooAbstractImpl.

>
> * If OJB ships with one concrete implementation, and the interface is
> meant to be an extension point for users for their own implementations
> (e.g. ProxyFactory), then the implementation class name ends in
> "DefaultImpl".
>
> [ ] +1
> [ ] +/- 0
> [X ] -1

DefaultProxyFactory is way better than ProxyFactoryDefaultImpl

>
> * Static factory classes will be removed. To my knowledge there are
> only two such classes in the 1.1 branch: QueryFactory and
> PersistenceBrokerFactory. The former is not really necessary because
> the methods only wrap around a constructor class. The latter mainly
> wraps around methods in the OJB class. The most interesting methods
> (defaultPersistenceBroker, createPersistenceBroker, etc.) should be
> moved to the OJB class.
>
> [ ] +1
> [X ] +/- 0
> [ ] -1

The QueryFactory will throw people. It is useful.

>
> * Abbreviations where the unabbreviated name is used in OJB, are
> replaced with the unabbreviated name. E.g. PersistenceConfigurationKey
> instead of PCKey.
>
> [X ] +1
> [ ] +/- 0
> [ ] -1
>
> regards,
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>


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