Skip to content

Instantly share code, notes, and snippets.

@jmaicher
Created March 16, 2012 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmaicher/2049779 to your computer and use it in GitHub Desktop.
Save jmaicher/2049779 to your computer and use it in GitHub Desktop.
Streama (Specification of Activities)
# Is it possible with the current streama DSL to explicitly say that the verb is not the identifier?
activity :created_event do
actor :user, :cache => [:username, :slug]
verb :post
object :event, :cache => [:name, :acronym, :slug]
end
# The combination of actor, verb, object (and target) has implicit and unique representation of the activity
# => maybe the identifier can be ommitted?
activity do
actor :user, :cache => [:username, :slug]
verb :post
object :event, :cache => [:name, :acronym, :slug]
end
# And when we are changing the DSL we could make the actor optional
# and give it globally a default
activity.defaults do
actor :user, :cache => [:username, :slug]
end
# Implicit identifier and default actor:
activity do
verb :post
object :event, :cache => [:name, :acronym, :slug]
end
# => :user, :post and :event is unique representation of the activity
# => :post_event could be the implicit identifier which is the same as :user_post_event (user is default).
# Giving explicit actors should still be possible:
activity do
actor :organizer, :cache [:forename, :surname]
verb :update
target :call_for_papers
end
# => :organizer_update_call_for_papers is implicit identifier
# Giving explicit identifiers should still be possible:
activity :custom_identifier do
verb :post
object :event
end
# => :custom_identifier is explicit identifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment