Service Objects Evolution

Abdriy Mosin
Abdriy MosinRuby on Rails Developer at Cater2.me
Service
Objects
Evolution
by @andriymosin
1
01
Service Objects benefits
What we trying to solve
04 Existing realizations
Gems, best practices and
ideas
03 What we want
Unification, Validation,
Combinations, etc.
02 What we had
Pretty basic object
05 What we have for now
Our current realization
01
next
Why use
Service
Objects?
2
next3
1. Atomic operations only
2. Encapsulate all logic
4. Easy to test
3. Easy to manage
5. Best place to put business logic
0. MVC is not enough
02
next
What we had
at the
beginning
4
next5
Basic implementation
next6
Usage
next
Service
Unification
7
1. Same action method name in all service objects
2. Only one public method in object
3. Result should always be true || false
4. No ‘returns’ inside Service Objects
next
And we start our first big refactoring
8
03
next
What we want
to have in our
Service
Objects
9
next
Our needs
10
1. Data Creating
2. Data Updating
3. Combination
4. Validation
5. Callbacks(success, error)
next
Data
create
&
update
11
next
Combi
nation
12
next
Validations
13
1. Input
1. Required
2. Optional
2. Output
1. Required
2. Optional
04
next
Existing
realizations
14
next15
1. Interactor
2. Light Service
3. ActiveInteraction
4. Mutations
05
next
What we have
for now
16
next
Own implementation
17
with Black Jack and unicorns…
https://github.com/rubakas/cater
next18
First step was to make
architecture and main
decisions about it
1. Modularity
2. Callbacks(success, error)
next19
next20
next21
next22
next23
next24
next
120!!!!!
25
30
60
90
120
150
Jul Sep Jan May
Services Refactoring
next
More services == More refactoring
Refactoring
time
increase
26
next27
Now we have callbacks and
platform for next
experiments
So it’s time for better
error handler and
validations
next
Errors
28
next
“Plan to throw one
(implementation)
away; you will,
anyhow.”
- Fred Brooks
29
next30
Validations
next
Modular implementation with
custom rules
31
next32
next33
next34
next
Virtus
35
next36
next37
Next
Milestone
next38
next39
close
Thank
YouPresenter: Andriy Mosin
http://moxa.io/
@andriymosin
1 of 40

Recommended

SharepointSharepoint
Sharepointthan sare
51 views34 slides
ApiDD OverviewApiDD Overview
ApiDD Overviewapidd
764 views18 slides
Adding you API to ApiDDAdding you API to ApiDD
Adding you API to ApiDDapidd
1K views11 slides
ApiDD ConsumerApiDD Consumer
ApiDD Consumerapidd
698 views19 slides
Apidd Member ManagementApidd Member Management
Apidd Member Managementapidd
679 views19 slides
Rabbitmq basicsRabbitmq basics
Rabbitmq basicsAbdriy Mosin
1.2K views14 slides

More Related Content

Similar to Service Objects Evolution

Test driven developmentTest driven development
Test driven developmentnamkha87
528 views18 slides
Learn SoapUILearn SoapUI
Learn SoapUIDavid Ionut
17K views42 slides

Similar to Service Objects Evolution(20)

Machine learning pipelineMachine learning pipeline
Machine learning pipeline
Vadym Kuzmenko230 views
06  the pipeline-deeper06  the pipeline-deeper
06 the pipeline-deeper
Shubham Atkare311 views
Test driven developmentTest driven development
Test driven development
namkha87528 views
Grails ServicesGrails Services
Grails Services
NexThoughts Technologies196 views
Making a Mock by Kelsey ShannahanMaking a Mock by Kelsey Shannahan
Making a Mock by Kelsey Shannahan
QA or the Highway216 views
Learn SoapUILearn SoapUI
Learn SoapUI
David Ionut17K views
03   setting up database server sample03   setting up database server sample
03 setting up database server sample
Sarath Chandra Aravapalli527 views
Presentation 1.pptxPresentation 1.pptx
Presentation 1.pptx
Rich Alex13 views
Less18 Patching oracle dba 11gLess18 Patching oracle dba 11g
Less18 Patching oracle dba 11g
vivaankumar1.4K views
Secure mvc application   saineshwarSecure mvc application   saineshwar
Secure mvc application saineshwar
Saineshwar bageri665 views
Mailing WebsiteMailing Website
Mailing Website
Mohammed Sajid46 views
Test automation engineerTest automation engineer
Test automation engineer
Sadaaki Emura40 views
Top 7 Mistakes in Performance TestingTop 7 Mistakes in Performance Testing
Top 7 Mistakes in Performance Testing
stuartmoncrieff4.5K views
Unit Testing and Why it MattersUnit Testing and Why it Matters
Unit Testing and Why it Matters
yahyaSadiiq101 views

Recently uploaded(20)

METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation23 views
Green Leaf Consulting: Capabilities DeckGreen Leaf Consulting: Capabilities Deck
Green Leaf Consulting: Capabilities Deck
GreenLeafConsulting170 views
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web Developers
Maximiliano Firtman152 views
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum183 views
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver23 views
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh34 views
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum118 views

Service Objects Evolution