db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject [rfc] Do we need a naming standard ?
Date Wed, 13 Apr 2005 20:48:39 GMT
Hi folks,

something that bugs me is that we do not have a consistent naming
scheme in OJB, especially for the interfaces and implementation
classes. For instance, currently in CVS Head we have interfaces that
are suffixed with 'IF' like StatementManagerIF, others have plain
names, e.g. ConnectionFactory, and there are also some that would
really like to get a good name, but it had already been taken, such as
QueryFactoryNew. For reference have a look into the constructor and
initWithDefaults method of ContainerHelper.
The whole problem becomes more apparent now that a bigger part of OJB
is interface-based and pluggable.

What I would like to know is what you think about establishing a basic
naming standard for OJB. IMO we need one that at least deals with

* naming of interfaces vs. (abstract) implementation bases vs. default
* usage of abbreviations (esp. PB vs. PersistenceBroker)
* naming of factory classes (which in OJB 1.1 are objects, not classes
with static methods)

Of these IMO the most important is the first one.
One example of such a naming scheme would be:

* interfaces start with I (e.g. IQueryFactory), implementation bases
are suffixed with ImplBase, (QueryFactoryImplBase) and default impls
with DefaultImpl (QueryFactoryDefaultImpl)
* abbreviations should be used consistently or avoided, e.g. PB should
be replaced by PersistenceBroker
* factory classes should be suffixed with Factory, if interface-based
then the interface otherwise the class

(I think this is the internal Eclipse naming scheme).
One reason that I see why we should discuss this now and not later, is
that we havn't released an initial version of OJB 1.1 yet, so there is
no hard requirement of interface stability. I realize that we should
strive for backward compatibility with 1.0 but OJB 1.1 already
requires some code changes for users, and a clearer naming scheme
would be to the benefit of the users too.


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

View raw message