Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/Makefile.am	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -125,4 +125,5 @@
 	RandomNumbers/RandomNumberDistributionFactory.cpp \
 	RandomNumbers/RandomNumberEngineFactory.cpp \
+	RandomNumbers/RandomNumberGenerator.cpp \
 	RandomNumbers/RandomNumberGeneratorFactory.cpp
 
Index: src/RandomNumbers/RandomNumberDistribution.hpp
===================================================================
--- src/RandomNumbers/RandomNumberDistribution.hpp	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/RandomNumberDistribution.hpp	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -14,4 +14,7 @@
 #endif
 
+class RandomNumberDistributionFactoryTest;
+class RandomNumberGenerator;
+
 /** Abstract base class for a random number distribution.
  *
@@ -23,4 +26,14 @@
 class RandomNumberDistribution
 {
+  /**
+   * test has to access cstor/dstor.
+   */
+  friend class RandomNumberDistributionFactoryTest;
+
+  /**
+   * RandomNumberGenerator(_Encapsulation) needs access to dstor.
+   */
+  friend class RandomNumberGenerator;
+
 public:
   /** Getter for the type name of the internal distribution.
@@ -29,7 +42,17 @@
   virtual std::string name()=0;
 
+  /** Destructor of class RandomNumberDistribution.
+   *
+   * @note must be public such that instances from factory can be destroyed.
+   *
+   */
+  virtual ~RandomNumberDistribution() {};
+protected:
+
+  /** Constructor of class RandomNumberDistribution.
+   *
+   * @note is protected such that instances can only be created by the factory.
+   */
   RandomNumberDistribution() {};
-  virtual ~RandomNumberDistribution() {};
-
 };
 
Index: src/RandomNumbers/RandomNumberEngine.hpp
===================================================================
--- src/RandomNumbers/RandomNumberEngine.hpp	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/RandomNumberEngine.hpp	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -14,4 +14,7 @@
 #endif
 
+class RandomNumberEngineFactoryTest;
+class RandomNumberGenerator;
+
 /** Abstract base class for a random number engine.
  *
@@ -23,4 +26,14 @@
 class RandomNumberEngine
 {
+  /**
+   * test has to access cstor/dstor.
+   */
+  friend class RandomNumberEngineFactoryTest;
+
+  /**
+   * RandomNumberGenerator(_Encapsulation) needs access to dstor.
+   */
+  friend class RandomNumberGenerator;
+
 public:
   /** Set the generator's seed.
@@ -30,10 +43,4 @@
   virtual void seed(unsigned int _seed)=0;
 
-  /** Getter for the generator's seed.
-   *
-   * @return _seed seed to set to
-   */
-  virtual unsigned int getseed() const = 0;
-
   /** Getter for the type name of the internal engine.
    *
@@ -41,7 +48,24 @@
   virtual std::string name()=0;
 
+  /** Destructor of class RandomNumberEngine.
+   *
+   * @note must be public such that instances from factory can be destroyed.
+   *
+   */
+  virtual ~RandomNumberEngine() {};
+protected:
+  /** Constructor of class RandomNumberEngine.
+   *
+   * @note is protected such that instances can only be created by the factory.
+   */
   RandomNumberEngine() {};
-  virtual ~RandomNumberEngine() {};
 
+  /** Getter for the generator's seed.
+   *
+   * @note is only used internally for unit test.
+   *
+   * @return _seed seed to set to
+   */
+  virtual unsigned int getseed() const = 0;
 };
 
Index: src/RandomNumbers/RandomNumberGenerator.cpp
===================================================================
--- src/RandomNumbers/RandomNumberGenerator.cpp	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/RandomNumberGenerator.cpp	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -19,2 +19,17 @@
 
 #include "CodePatterns/MemDebug.hpp"
+
+#include "RandomNumberDistribution.hpp"
+#include "RandomNumberEngine.hpp"
+#include "RandomNumberGenerator.hpp"
+
+RandomNumberGenerator::RandomNumberGenerator() :
+  engine_type(NULL),
+  distribution_type(NULL)
+{};
+
+RandomNumberGenerator::~RandomNumberGenerator() {
+  delete engine_type;
+  delete distribution_type;
+};
+
Index: src/RandomNumbers/RandomNumberGenerator.hpp
===================================================================
--- src/RandomNumbers/RandomNumberGenerator.hpp	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/RandomNumberGenerator.hpp	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -13,4 +13,8 @@
 #include <config.h>
 #endif
+
+class RandomNumberDistribution;
+class RandomNumberEngine;
+
 
 /** Abstract base class for a random number generator.
@@ -45,6 +49,22 @@
   virtual std::string DistributionName()=0;
 
-  RandomNumberGenerator() {};
-  virtual ~RandomNumberGenerator() {};
+  /** Destructor of class RandomNumberGenerator.
+   *
+   * @note must be public such that instances from factory can be destroyed.
+   *
+   */
+  virtual ~RandomNumberGenerator();
+
+protected:
+  /** Constructor of class RandomNumberGenerator.
+   *
+   * @note is protected such that instances can only be created by the factory.
+   */
+  RandomNumberGenerator();
+
+  // we place them here such that they can be made friend of these
+  // classes and are granted access to dstor
+  RandomNumberEngine *engine_type;
+  RandomNumberDistribution *distribution_type;
 
 };
Index: src/RandomNumbers/RandomNumberGenerator_Encapsulation.hpp
===================================================================
--- src/RandomNumbers/RandomNumberGenerator_Encapsulation.hpp	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/RandomNumberGenerator_Encapsulation.hpp	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -143,6 +143,4 @@
    */
   RandomNumberGenerator_Encapsulation() :
-    engine_type(NULL),
-    distribution_type(NULL),
     randomgenerator(NULL)
   {
@@ -165,14 +163,14 @@
       RandomNumberDistribution *_distribution_type
       ) :
-    engine_type(_engine_type),
-    distribution_type(_distribution_type),
-    randomgenerator(
-        new boost::variate_generator<engine, distribution> (
-            (dynamic_cast<RandomNumberEngine_Encapsulation<engine> *>(engine_type))
-            ->getEngine(),
-            (dynamic_cast<RandomNumberDistribution_Encapsulation<distribution> *>(distribution_type))
-            ->getDistribution())
-    )
-  {}
+        randomgenerator(NULL)
+  {
+    engine_type = _engine_type;
+    distribution_type = _distribution_type;
+    randomgenerator = new boost::variate_generator<engine, distribution> (
+          (dynamic_cast<RandomNumberEngine_Encapsulation<engine> *>(engine_type))
+          ->getEngine(),
+          (dynamic_cast<RandomNumberDistribution_Encapsulation<distribution> *>(distribution_type))
+          ->getDistribution());
+  }
 
   /** Destructor of the class.
@@ -182,11 +180,6 @@
   {
     // NULL pointer may be deleted
-    delete engine_type;
-    delete distribution_type;
     delete randomgenerator;
   }
-protected:
-  RandomNumberEngine *engine_type;
-  RandomNumberDistribution *distribution_type;\
 private:
   mutable boost::variate_generator<engine, distribution> *randomgenerator;
Index: src/RandomNumbers/unittests/Makefile.am
===================================================================
--- src/RandomNumbers/unittests/Makefile.am	(revision 9b3476e89c8176ecacfb1a4825157fcc620108b1)
+++ src/RandomNumbers/unittests/Makefile.am	(revision 15911c97898d09d69931fb955bf4db5cea2b7dc1)
@@ -55,4 +55,5 @@
 	$(srcdir)/../RandomNumberEngineFactory.cpp \
 	$(srcdir)/../RandomNumberEngineFactory.hpp \
+	$(srcdir)/../RandomNumberGenerator.cpp \
 	$(srcdir)/../RandomNumberGeneratorFactory.cpp \
 	$(srcdir)/../RandomNumberGeneratorFactory.hpp
@@ -66,4 +67,5 @@
 	$(srcdir)/../RandomNumberEngineFactory.cpp \
 	$(srcdir)/../RandomNumberEngineFactory.hpp \
+	$(srcdir)/../RandomNumberGenerator.cpp \
 	$(srcdir)/../RandomNumberGeneratorFactory.cpp \
 	$(srcdir)/../RandomNumberGeneratorFactory.hpp
