(SmallTalk, Java, PHP); no developers who “were born with Rails”; we needed to be unique and have something to unite us; say “no” to “the architecture astronauts Java way” or the “PHP spaghetti way”; • • • •
including the views; external gems used for most of the features; non-trivial logic with the combination of filters, callbacks, conditional validations and tons of ; • • •
including the views; external gems used for most of the features; non-trivial logic with the combination of filters, callbacks, conditional validations and tons of ; metaprogramming; • • • •
including the views; external gems used for most of the features; non-trivial logic with the combination of filters, callbacks, conditional validations and tons of ; metaprogramming; only 3 layers - Models, Views, Controllers. • • • • •
and/or joins in other tables; have single interface #call(relation) ; return ActiveRecord::Relation ; accept query params as constructor arguments. • • • •
BaseService def call(deal) contact = something_that_creates_contact(deal) contact.save! Success(contact) end end class Validator < ::ApplicationValidator validates :email, presence: true end end
create command = Lead::CreateLead.new result = command.(resource_lead, params[:lead]) when Dry::Monads::Success render #… when Dry::Monads.Failure(JetRockets::ValidationError) render #… when Dry::Monads.Failure render #… end end end
specific (e.g. Users::ForgotPassword ); use namespaces based on domain concepts (e.g. /crm/documents/category/update_category ); focus on readability of your call method; • • • •
specific (e.g. Users::ForgotPassword ); use namespaces based on domain concepts (e.g. /crm/documents/category/update_category ); focus on readability of your call method; return results with state. • • • • •