Spark Academy are recurring 2-hour workshops every Thursday at 18.30 in Spark’s office at Jasna 15 (started on October 25th) and happening every week, according to the schedule. Each workshop will have separate topic and consist of a live coding session / devops with some homework for the participants, to be submitted for review and feedback (not mandatory).
For whom?
For Junior and Mid RoR developers
Why?
Free RoR workshops with Senior Developers on interesting topics - improve your dev skills, gain some experience, make new friends!
Mentors
Piotr Leniec - Senior Fullstack Dev at Spark Solutions
Yuriy Kushnir - Senior RoR Dev at Spark Solutions
How to enroll?
1. Book some time
2/ Complete an evaluation task: Create a simple URL shortener using Rails or any other Ruby Web Framework and deploy it to Heroku.The user should be able to paste a link of any length and convert it to a short 8-character URL. Provide a link to Github / BitBucket repo & a link to a deployed website on Heroku.
3. Submit your application with a link to your task solution
4. Wait a bit for our reply
5. Code!
Seats are limited, so apply now! We’ll be selecting the most promising candidates.
Schedule & Topics*
10/25/2018 PORO objects & their usage
11/8/2018 AWS/Heroku/DevOps
11/15/2018 Newest Rails Features
11/22/2018 Advanced Testing
11/29/2018 Refactoring techniques & approaches
12/6/2018 Rails Performance Optimization
12/13/2018 Payment Provider Integration
* Some workshops will be delivered in English
Apply TODAY! Number of seats is limited. Snacks and drinks are on us :)
https://spark-solutions.workable.com/jobs/833497
4. Value Objects
A small simple object, like money or a date range, whose
equality isn’t based on identity.
The attributes of a value object will remain unchanged from
instantiation to the last state of its existence.
11. A separate class that contains one specific query that
implements just one business logic rule and isolates complex
queries.
Query Objects should be built in a way that supports
composition with other Query Objects
Query Objects
13. Stick to one naming convention
Use .call method returning a relation to call query objects
Always accept relation like object as first argument
Provide a way to accept extra options
Focus on readability of your querying method
Group query objects in a separate namespaces
Query Objects
17. Use Query Objects when:
● You need to reuse one query in multiple places of application
● You need to extend, compose or inherit queries and their relations
● You need to write a lot of raw SQL, but don’t want to mess up your code
● Your query is too complex / vast for just one method or scope
Don’t use Query Objects when:
● Your query is simple enough for just one method or scope
● You don’t need to extend, compose or inherit your query
● Your query is unique and you don’t want to make it reusable
Query Objects
18. Primitive Ruby objects, used for checking operations in isolation
Policy Objects encapsulate and express a set of business rules
Predicate methods
No side effects and modification of passed attributes
Simple logic, no database calls and complicated operations
Policy Objects
21. A Service Object is meant to decompose business objects into
manageable classes and methods
Commands
Services
Operation [TRB]
Service Objects
22. The action is complex
The action reaches across multiple models
The action interacts with an external service
The action is not a core concern of the underlying model
There are multiple ways of performing the action
Service Objects
25. A form object is an object designed specifically to aggregate data to
create multiple objects or to receive ephemeral data that is used and
then discarded.
Form Objects
28. Simple classes that sit between the model and the view and provide a
nice, DRY object-oriented way of working with complex display logic
Presenters / Decorators
32. There are two types of Interactors - Basic Interactors and Organizers
Organizer’s purpose is to run other interactors via shared global
context
Basic interactor is a single-purpose building block of application.
Interactors
35. Provides a unified interface to a set of interfaces in a subsystem
Facade defines a higher-level interface that makes the
subsystem easier to use
Facades
37. Don’t be afraid to have a lot of different objects
It’s much better to have a billion classes with 1 method than
to have 1 class with a billion methods
SOLID / DDD / PoEAA
Final Thoughts