Dear users,
default users of the main functionality should not be affected by these
changes.
------------
Dear developers,
I've started with refactoring the sources following the PMD rules.
First, this is important to hide the internal JOELib development
process, e.g. using a more efficient implementation.
Second, these changes are at the moment only available in the CVS and if
you are a developer this may affect your implementation. So, the next
JOELib release will switch back into beta-release mode with focus on a
more stable release for the future.
Beta-release mode for the next release means that i've decided to change
method calls and signatures if necessary. So developers ... be warned.
Example: Load descriptors of unkown size. Load them into a data
structure, e.g. Vector, which causes a lot of memory swapping processes.
So, a LinkedList would be more efficient here.
So, the PMD coupling rule recommend to use always a List interface for
the user, so the user have not to know which implementation is used
internally.
This was not the case, because i've often used a Vector in method headers.
Until now i've corrected the 'basic','coupling' and 'import' rules. Two
of them causes no problems.
But the 'coupling' rule has forced me to change 'Vector-->List',
'HashMap-->Map'. So, this affects method calls and forces you to
change these things also, if you are using the JOELib library for
your own implementations.
This causes three main changes for you:
0. joelibMethod(myVector);
Nothing to do here, because List is an interface for the Vector
class
1. Vector myVector=joelibMethod();
Must be changed to:
List myList=joelibMethod();
or you should use casting from Vector to List and vice versa.
Depends on your implementation.
2. Vector myVector=joelibMethod();
Enumeration enum=myVector.enumeration();
enum.hasNextElement();
enum.nextElement();
Must be changed to:
Iteration iter=myVector.iterator();
iter.hasNext();
iter.next();
3. All users which have used the 'addElement', 'getElementAt'
should use the access method, which are recommended from the
interface:
'add' and 'get'
And 'setElementAt(object, index)' should be replaced by
'setElementAt(index, object)' interchanging the order of the
arguments.
Kind regards, Joerg
--
Dipl. Chem. Joerg K. Wegner
Center of Bioinformatics Tuebingen (ZBIT)
Department of Computer Architecture
Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany
Phone: (+49/0) 7071 29 78970
Fax: (+49/0) 7071 29 5091
E-Mail: mailto:we...@in...
WWW: http://www-ra.informatik.uni-tuebingen.de
--
Never mistake motion for action.
(E. Hemingway)
Never mistake action for meaningful action.
(Hugo Kubinyi,2004)
|