   match = components
 
   while (segment = path.shift())?
-    match[segment] = {} unless segment of match
+    match[segment] = new components.constructor() unless segment of match
     match = match[segment]
     assert _.isObject match
 

  namespace = getNamespace components, path
  return null unless namespace

  namespace[COMPONENTS_FIELD]?[name] or null

setComponent = (components, name, component) ->
  assert _.isObject components


  lastValue

class ComponentsNamespace
  # We have a special field for components. This allows us to have the namespace with the same name
  # as a component, without overriding anything in the component (we do not want to use component
  # object as a namespace object).
  @COMPONENTS_FIELD: ''

getPathAndName = (name) ->
  assert name
