 
     domainEvent = new DomainEvent eventParams
     @_domainEvents.push domainEvent
-
-
-  _getChanges: ->
-    @_observer.deliver()
-
-    changes = {}
-    if Object.keys(@_propsChanged).length > 0
-      changes = @_propsChanged
-
-    changes
 
 
   _getEntityMap: ->



  generateDomainEvent: (eventName, params={}) ->
    eventParams =
      name: eventName
      aggregate:
        id: @id
        name: @_name

    changes = @_getChanges()
    if Object.keys(changes).length > 0
      eventParams.aggregate.changed = changes

    entityMap = @_getEntityMap()
    if Object.keys(entityMap).length > 0


  constructor: (name, definition) ->
    @_name              = name
    @_definition        = definition
    @_root              = new @_definition.root
    @_propsChanged      = {}
    @_domainEvents      = []

    @_observerOpen()

