diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php
index 5a07c55..2eaabf2 100644
--- a/core/lib/Drupal/Core/CoreBundle.php
+++ b/core/lib/Drupal/Core/CoreBundle.php
@@ -54,6 +54,8 @@ public function build(ContainerBuilder $container) {
       ->setFactoryMethod('getConnection')
       ->addArgument('slave');
     $container->register('typed_data', 'Drupal\Core\TypedData\TypedDataManager');
+    $container->register('constraint', 'Drupal\Core\Validation\Constraint\ConstraintManager');
+    
     // Add the user's storage for temporary, non-cache data.
     $container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend');
     $container->register('user.tempstore', 'Drupal\user\TempStoreFactory')
diff --git a/core/lib/Drupal/Core/Plugin/Validation/Constraint/NotNullConstraint.php b/core/lib/Drupal/Core/Plugin/Validation/Constraint/NotNullConstraint.php
new file mode 100644
index 0000000..eb58032
--- /dev/null
+++ b/core/lib/Drupal/Core/Plugin/Validation/Constraint/NotNullConstraint.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Plugin\Validation\Constraint\NotNullConstraint.
+ */
+
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+
+namespace Drupal\Core\Plugin\Validation\Constraint;
+
+/**
+ * Check if a value is not NULL.
+ *
+ * @Plugin(
+ *   id = "notnull",
+ *   label = @Translation("NotNull")
+ * )
+ */
+class NotNullConstraint implements \Drupal\Core\Validation\Constraint\ConstraintInterface {
+
+  /**
+   * Validate a constraint.
+   *
+   * @return boolean
+   *   TRUE if the value is not NULL, FALSE if the value is NULL.
+   */
+  public function validate($value) {
+     return !is_null($value); 
+  }
+}
diff --git a/core/lib/Drupal/Core/Validation/Constraint/ConstraintBundle.php b/core/lib/Drupal/Core/Validation/Constraint/ConstraintBundle.php
new file mode 100644
index 0000000..ddd04a1
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Constraint/ConstraintBundle.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\ConstraintBundle.
+ */
+
+namespace Drupal\Core\Validation\Constraint;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+/**
+ * Constraint dependency injection container.
+ */
+class ConstraintBundle extends Bundle {
+
+  /**
+   * Overrides Symfony\Component\HttpKernel\Bundle\Bundle::build().
+   */
+  public function build(ContainerBuilder $container) {
+    // Register the ConstraintManager class with the dependency injection container.
+    $container->register('plugin.manager.constraint', 'Drupal\Core\Validation\Constraint\ConstraintManager');
+  }
+}
diff --git a/core/lib/Drupal/Core/Validation/Constraint/ConstraintFactory.php b/core/lib/Drupal/Core/Validation/Constraint/ConstraintFactory.php
new file mode 100644
index 0000000..ee7bdee
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Constraint/ConstraintFactory.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Validation\Constraint\ConstraintFactory.
+ */
+
+namespace Drupal\Core\Validation\Constraint;
+
+use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Component\Plugin\Exception\PluginException;
+
+/**
+ * A factory for constraint objects.
+ *
+ */
+class ConstraintFactory extends DefaultFactory {
+
+  /**
+   * Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
+   *
+   * @param string $plugin_id
+   *   The id of a plugin, i.e. the data type.
+   * @param array $configuration
+   *   The plugin configuration, i.e. the data definition.
+   *
+   * @return Drupal\Core\TypedData\TypedDataInterface
+   */
+  public function createInstance($plugin_id, array $configuration) {
+    $definition = $this->discovery->getDefinition($plugin_id);
+    $plugin_class = $definition['class'];
+    return new $plugin_class();
+  }
+}
diff --git a/core/lib/Drupal/Core/Validation/Constraint/ConstraintInterface.php b/core/lib/Drupal/Core/Validation/Constraint/ConstraintInterface.php
new file mode 100644
index 0000000..5a793bb
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Constraint/ConstraintInterface.php
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Validation\Constraint\ConstraintInterface.
+ */
+
+namespace Drupal\Core\Validation\Constraint;
+
+/**
+ * Interface for constraints.
+ *
+ */
+interface ConstraintInterface {
+
+  /**
+   * Validate a constraint.
+   * 
+   * @param $value
+   *   Value to validate.
+   *
+   * @return boolean
+   *   TRUE if the value is valid, FALSE otherwise.
+   */
+  public function validate($value);
+}
diff --git a/core/lib/Drupal/Core/Validation/Constraint/ConstraintManager.php b/core/lib/Drupal/Core/Validation/Constraint/ConstraintManager.php
new file mode 100644
index 0000000..aa159e0
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Constraint/ConstraintManager.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Validation\Constraint\ConstraintManager.
+ */
+
+namespace Drupal\Core\Validation\Constraint;
+
+use Drupal\Component\Plugin\PluginManagerBase;
+use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
+
+/**
+ * Constraint plugin manager.
+ */
+class ConstraintManager extends PluginManagerBase {
+  /**
+   * Overrides Drupal\Component\Plugin\PluginManagerBase::__construct().
+   */
+  public function __construct() {
+    // move constraints to system module so they get discovered (dixit fago)
+    $this->discovery = new AnnotatedClassDiscovery('Validation', 'Constraint');
+    $this->factory = new ConstraintFactory($this->discovery);
+  }
+
+  /**
+   * Implements Drupal\Component\Plugin\PluginManagerInterface::createInstance().
+   *
+   * @param string $plugin_id
+   *   The id of a plugin, i.e. the data type.
+   *
+   * @return Drupal\Core\TypedData\TypedDataInterface
+   */
+  public function createInstance($plugin_id, array $configuration = array()) {
+    return $this->factory->createInstance($plugin_id, $configuration);
+  }
+  
+}
diff --git a/core/lib/Drupal/Core/Validation/Constraint/test.php b/core/lib/Drupal/Core/Validation/Constraint/test.php
new file mode 100644
index 0000000..9993787
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Constraint/test.php
@@ -0,0 +1,14 @@
+<?php 
+
+try{
+$x = drupal_container()->get('constraint');
+dpm($x);
+$y = $x->createInstance('notnull', array());
+dpm($y);
+dpm($y->validate(1), 'validate 1');
+dpm($y->validate(0), 'validate 0');
+dpm($y->validate(NULL), 'validate NULL');
+
+} catch (\Exception $e) {
+  dpm( $e, 'ooops');
+}
diff --git a/core/lib/Drupal/Core/Validation/Validator/ValidatorInterface.php b/core/lib/Drupal/Core/Validation/Validator/ValidatorInterface.php
new file mode 100644
index 0000000..c3ef05f
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Validator/ValidatorInterface.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Validation\Validator\ValidatorInterface.
+ */
+
+namespace Drupal\Core\Validation\Validator;
+
+/**
+ * Interface for validators.
+ *
+ */
+interface ValidatorInterface {
+  
+  /**
+   * Validate.
+   *
+   * @return array
+   *   Array of violations.
+   */
+  public function validate();
+}
diff --git a/core/lib/Drupal/Core/Validation/Violation/ViolationInterface.php b/core/lib/Drupal/Core/Validation/Violation/ViolationInterface.php
new file mode 100644
index 0000000..cc080e1
--- /dev/null
+++ b/core/lib/Drupal/Core/Validation/Violation/ViolationInterface.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Validation\Violation\ViolationInterface.
+ */
+
+namespace Drupal\Core\Validation\Violation;
+
+/**
+ * Interface for violations.
+ *
+ */
+interface ViolationInterface {
+  
+  /**
+   * Get the error message.
+   *
+   * @return string
+   *   Error message.
+   */
+  public function getMessage();
+  
+  /**
+   * Get the constraint.
+   *
+   * @return Drupal\Core\Constraint\ConstraintInterface
+   *   The constraint.
+   */
+  public function getConstraint();
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Validation/ValidationConstraintTest.php b/core/modules/system/lib/Drupal/system/Tests/Validation/ValidationConstraintTest.php
new file mode 100644
index 0000000..ba8482a
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Validation/ValidationConstraintTest.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Validation\ValidationConstraintTest.
+*/
+
+namespace Drupal\system\Tests\Validation;
+
+use Drupal\simpletest\UnitTestBase;
+use Drupal\Core\Plugin\Validation\Constraint;
+
+/**
+ * Tests the Drupal\Core\Validation\Constraint class.
+ */
+class ValidationConstraintTest extends UnitTestBase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'ValidationConstraintTest',
+      'description' => "Test constraint.",
+      'group' => 'Validation',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+  }
+
+  /**
+   * Tests generating a UUID.
+   */
+  public function testNotNullConstraint() {
+    $constraint = new Constraint\NotNullConstraint();
+    $this->assertTrue($constraint->validate(1));
+    $this->assertTrue($constraint->validate(0));
+    $this->assertFalse($constraint->validate(NULL));
+  }
+}
