anchor.diff:      true -> ?NOTIFY({app, updated, App});
       false -> ?NOTIFY({app, created, App})
     end,
  -  db:write(App),
  +  save(App),
     App;
   create(NewProps) ->
     create(new(NewProps)).
  
positive.code:   all/0,
    exist/1,
    create/1,
    update/1, update_by_name/1,
    delete/1, new/1
  ]).
  
  % Find the first application named Name
  
negative.code: 
  all() ->
    db:find(qlc:q([ B || B <- mnesia:table(app) ])).
  
  save(App) when is_record(App, app) ->
    db:write(App).
    
  new(NewProps) ->
    PropList = ?rec_info(app, #app{}),
    FilteredProplist1 = misc_utils:filter_proplist(PropList, NewProps, []),
    FilteredProplist2 = misc_utils:new_or_previous_value(FilteredProplist1, PropList, []),
    FilteredProplist = validate_app_proplists(FilteredProplist2),
    list_to_tuple([app|[proplists:get_value(X, FilteredProplist) || X <- record_info(fields, app)]]).
  
  update_proplist_for_app(App, NewProps) ->
    PropList = ?rec_info(app, App),
    FilteredProplist1 = misc_utils:filter_proplist(PropList, NewProps, []),
    FilteredProplist2 = misc_utils:new_or_previous_value(FilteredProplist1, PropList, []),
    FilteredProplist = validate_app_proplists(FilteredProplist2),
  