de.fesenmeyer.dbnormalizer.core.algorithms
Class ThreeNFSynthesisAlgorithmKemper

java.lang.Object
  extended by de.fesenmeyer.dbnormalizer.core.algorithms.AbstractNormalizationAlgorithm
      extended by de.fesenmeyer.dbnormalizer.core.algorithms.ThreeNFSynthesisAlgorithmKemper

public class ThreeNFSynthesisAlgorithmKemper
extends AbstractNormalizationAlgorithm

Implementation of the synthesis normalization algorithm described in [Datenbanksysteme, Kemper/Eickler, 5th Ed., 2004, p. 181]. All tables of the generated decomposition are at least in 3NF. The algorithm has the lossless join property and is dependency-preserving. Unfortunately, in some cases the decomposition can create global redundancies.

Author:
DF

Field Summary
private static DBNormalizerLogger logger
          The logger for this class.
 
Constructor Summary
ThreeNFSynthesisAlgorithmKemper()
           
 
Method Summary
protected  void copyTableColumnInformation(NormalizationProposal normProposal)
          Copies the table column information from the old table to the new (created) tables of the given normalization proposal.
protected  NormalizationProposal doNormalize(Table oldTable)
          The actual normalization algorithm based on [Datenbanksysteme, Kemper/Eickler, 5th Ed., 2004, p. 181].
 NormalizationProposal normalize(Table oldTable)
           Creates a normalization proposal for the Table specified by the argument oldTable.
protected  NormalizationProposal postNormalize(NormalizationProposal normProposal)
           Method called after the actual normalization algorithm, to do necessary work not included in the normalization algorithm, such as calculating minimal cover and candidate keys for the new (created) tables, determining foreign keys (FKs) etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static DBNormalizerLogger logger
The logger for this class.

Constructor Detail

ThreeNFSynthesisAlgorithmKemper

public ThreeNFSynthesisAlgorithmKemper()
Method Detail

doNormalize

protected NormalizationProposal doNormalize(Table oldTable)
                                     throws DBNormalizerException
The actual normalization algorithm based on [Datenbanksysteme, Kemper/Eickler, 5th Ed., 2004, p. 181].

Parameters:
oldTable - the old table, the table to be normalized
Returns:
the tables in which the table has been split
Throws:
DBNormalizerException - if an exception occurs
See Also:
AbstractNormalizationAlgorithm.normalize(Table)

postNormalize

protected NormalizationProposal postNormalize(NormalizationProposal normProposal)
                                       throws DBNormalizerException

Method called after the actual normalization algorithm, to do necessary work not included in the normalization algorithm, such as calculating minimal cover and candidate keys for the new (created) tables, determining foreign keys (FKs) etc.

Extends the normalization proposal by adding further information.

Parameters:
normProposal - the normalization proposal to be extended
Returns:
the extend normalization proposal
Throws:
DBNormalizerException

copyTableColumnInformation

protected void copyTableColumnInformation(NormalizationProposal normProposal)
Copies the table column information from the old table to the new (created) tables of the given normalization proposal.

Parameters:
normProposal - the normalization proposal

normalize

public NormalizationProposal normalize(Table oldTable)
                                throws DBNormalizerException
Description copied from class: AbstractNormalizationAlgorithm

Creates a normalization proposal for the Table specified by the argument oldTable.

NOTE: Before applying this method to a table, make sure that it contains all the necessary data such as minimal cover (Table.setFDMinCover(java.util.Set)), candidate keys (Table.setCandKeys(java.util.Set)) and primary key (Table.setPk(de.fesenmeyer.dbnormalizer.core.PK)). The methods for calculating this data can be found in the FDAlgorithms class.

Specified by:
normalize in class AbstractNormalizationAlgorithm
Parameters:
oldTable - the Table, for which a normalization proposal should be created
Returns:
a normalization proposal
Throws:
DBNormalizerException - if the table object does not supply all of the data needed for normalization or if another error occurs.