on Rails since 2006 - Current role: CTO at setyl.com - Passion: Complexity organization optimization - At my agency: RBBR Limited - Methodology: “Painless Rails“ - My twittter: x.com/inemation - My stuff: taplink.cc/inem
separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions
separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic
separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic • coordinates responses
separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic • coordinates responses
separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic • coordinates responses
named for an activity rather than an entity • represent signi fi cant business domain processes/operations • are distinct from technical services • may have side effects
stateless • named for an activity rather than an entity • represent signi fi cant business domain processes/operations • are distinct from technical services • may have side effects Service layer: • separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic
stateless • named for an activity rather than an entity • represent signi fi cant business domain processes/operations • are distinct from technical services • may have side effects Service layer: • separates domain logic from application logic • de fi nes application boundary • sets available operations • coordinates domain objects • controls transactions • encapsulates the app's business logic 🤔
Services, which are: • are stateless • named for an activity rather than an entity • represent signi fi cant operations • coordinate domain objects & control transactions • may have side effects The message being sent to us 🤔
an activity, not entity represents business operations coordinates domain objects controls transactions should theoretically have side effects no application logic Domain Service:
named for an activity, not entity represents business operations coordinates domain objects controls transactions should theoretically have side effects no application logic
activity, not entity represents business operations coordinates domain objects controls transactions should theoretically have side effects no application logic
use Service Objects • Split your code by the types of work done by it • Types of work → Types of building blocks • Measure your services with Fowler-Evans ruler!