Dry-rb: what, why and how - course 4900 rub. from ThinkNetica, training 3 webinars, Date November 27, 2023.
Miscellaneous / / November 27, 2023
Format
3 webinars lasting 2 hours
Practice
You will do some of the practice right in class, and some of it yourself after the webinar.
Communication
You will have live chat support, and webinars will cover common questions and errors, examples of best practices and solutions.
Result
- You will understand why dependency injection is needed, how it helps in maintainability, testability and modularity of applications.
- You will understand what Inversion of Control (IoC) containers have to do with it and what analysis options you can use based on dependencies in containers
- Get acquainted with the railway pattern (not to be confused with the rails way) and learn how this approach helps in writing business logic that can fail at any of the steps.
- Create a simple service framework in which you can use any transport libraries (like for both consumer and http/rpc calls) and any libraries for persistence, not just AR or rom.
- You will learn what types of validation there can be and how to write a validator for any data schema.
- You will learn what is in Ruby development outside of RoR, thanks to which you will be able to understand not only hanami, but also frameworks in other languages (approaches are used in Python, Java, JS and other ecosystems)
- Learn how to use a monad
Requirements for participants
1. One year of Ruby development experience. It is important to know basic things related to web development, such as MVC, the ability to query the database and write minimal tests.
2. Profile on GitHub
3. Basic command line and git skills
4. Desire to understand approaches other than the rails way
3 webinars
Practical tasks
Communication with the author and answers to questions
Day 1. Dependencies, DI, IoC containers. We assemble the project framework.
- First, you will have to understand the dependencies in the code, i.e. in any libraries, classes, modules, functions, etc. that are used in the main unit.
- Let's look at two ways to track dependencies: Dependency Injection and basic. Let's see how DI helps in writing unit and integration tests.
- In order not to increase complexity, let's look at IoC containers, the implementation of which is dry-container.
- For loading management, consider dry-system. Finally, we'll look at a basic project that will allow you to add any layers to the system.
As a result, you will be able to:
Understand what dry-rb is in general and what Layered architecture style is and what problems it solves. And also understand how DI and containers help in creating application structures. Afterwards, we’ll write our first application using dry-system.
Day 2. We write business logic. Railway, result objects and validation.
- To work with business logic, we will consider the railway pattern, which allows you to connect the technical steps of a business process into a chain in which each step can complete the entire process.
- In order for railway to work, we will take DO-notations from dry-monads as a way to implement the pattern. Let's discuss how and why to use monads.
- And to be sure that the data schema with which we work and which we write into the database is valid, we will use dry-schema and dry-validation.
As a result, you will be able to:
Learn to use the railway approach to describe business logic. You will understand why monads are needed as result objects and how to validate data and business logic.
Day 3. Adding the transport and persistence layers. Let's look at the rest of the dry-rb libraries.
- Let's look at ways to add various transports (http, rabbit, kafka) and persistence libraries (rom, sequel, etc) and expand our project.
- Let's briefly look at the remaining dry libraries and talk about where to use them. And also what does functional objects have to do with it?
- Let's discuss what can be done next with the structure of the blank and how to change it. What to add, what to remove, how to get to the slice and hexagonal structure.
As a result:
Let's assemble the system into a single piece.
Let's look at how to add any type of transport and persistence layer.
Let's look at the remaining libraries from the dry-rb ecosystem.
Let's discuss further steps for development or for using a finished blank.