Skip to content

Roadmap

Nick Sutterer edited this page Sep 6, 2016 · 5 revisions

Operation

result = Operation.(params: params, **)

Model/Contract

Both model and contract are not included per default.

Dependency Injection

Operation supports dependency injection and auto-injection.

result = Operation.(params: params, "policy.create" => Comment::Policy::Create)

auto_inject

Operation supports auto_inject.

class Create < Trailblazer::Operation
  include AutoInject[:user_repository]
end

Result Object

The operation in Trailblazer 1.2 returns a Result object that is compatible with dry-matcher.

result = Operation.(params: params, **)

Endpoint

Endpoints can be hooked to routes in the infrastructure framework (e.g. Rails or Hanami-router). The provide generic logic such as

  • HTTP status/redirect/bodys for document APIs (similar to responders work in Rails).
  • Serialize the outbound document using a configured representer (or serializer).

Goal of endpoints is to have generic handling code that is neither coupled to Trailblazer::Operation nor to a specific infrastructure framework.

Transaction

Operation integrates dry-transaction with a nice slim API for transactions in the operation.

Clone this wiki locally