Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

How to apply the Onion Architecture

Автор: Eric Normand

Загружено: 2019-02-05

Просмотров: 2806

Описание:

I got a lot of questions about how to apply the Onion Architecture to particular situations. In this episode, I try to answer it with a specific example.


►► Audio, Video, and Transcript available: https://lispcast.com/how-to-apply-the...
►► Subscribe on iTunes: https://itunes.apple.com/us/podcast/t...

Transcript

I answer some tough questions about the onion architecture. Hi, my name is Eric Normand and these are my thoughts on functional programming. This is season two and I hope to up the production quality that I had in the last season.

Let's get right into it. A few episodes back I introduced something that's called the onion architecture. I introduce it, meaning I explained it. Just real quick, the onion architecture is the layered architecture where you have your core domain implemented in a functional way in the middle.

It's layers like an onion. Around that you have your business rules, also functional. Then finally, the last layer is this interaction layer. This is the layer where all the actions happen. This is the layer that talks to the database. It gets Web requests and makes other API calls.

This is an architectural pattern that you can use to have a functional-style architecture. After I posted that, I got a lot of variations on the same question, which is, "How do I make decisions in my domain model that then result in taking different actions in the outer layer?"

The idea is, if you weren't going to architect this, let's say you just had a very basic, straight forward implementation. It's imperative. You would make an API call. Based on the results of that, you make some decision. Then you either call API A or you call API B. That's the end. The logic of what you do is mixed in with the actions that you take.

How do you extract that out into something that you can call an Onion Architecture? Right. That is the real question that people have. I have to say, I got a couple of examples of what people wanted to turn into an Onion Architecture.

My first thought was, there's not enough logic in it. There's not enough business rules. There's not enough domain in it to warrant coming up with different layers. Then I thought, "No, these are just simple examples that they're giving, so let's do it right." Here's an example that someone gave me. I should look up the name so I can reference them.

This is Andrew. Andrew, thanks for the question. In his example, you are implementing a web endpoint. This endpoint is for information about music albums. In the endpoint, you want to include images of the artists who worked on the album.

There's some constraints. You need to have as many images as you can, up to five. Things like that. The problem is, there's a lot of logic about...For instance, if there's more than one artist on the album. It's a compilation CD and you have a song from this artist and a song form that artist, you want to have one image from each artist. Not five of the first person.

How to apply the Onion Architecture

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Рабочая музыка для глубокой концентрации и сверхэффективности

Рабочая музыка для глубокой концентрации и сверхэффективности

Where does structural similarity come from?

Where does structural similarity come from?

Don't overcomplicate the onion architecture

Don't overcomplicate the onion architecture

Music for Work — Limitless Productivity Radio

Music for Work — Limitless Productivity Radio

Onion Architecture vs Clean Architecture Comparison

Onion Architecture vs Clean Architecture Comparison

Начало гражданской войны? / Минобороны готовится к отправке войск

Начало гражданской войны? / Минобороны готовится к отправке войск

Я в опасности

Я в опасности

Learn Clean Architecture & Domain-Driven Design

Learn Clean Architecture & Domain-Driven Design

The Man Behind Google's AI Machine | Demis Hassabis Interview

The Man Behind Google's AI Machine | Demis Hassabis Interview

КАТАСТРОФА С БЮДЖЕТОМ/ РЕЗКИЙ РОСТ ЦЕН/ БИЗНЕС В ПАНИКЕ/ ИСТЕРИКА ДЕРИПАСКИ. Милов об экономике

КАТАСТРОФА С БЮДЖЕТОМ/ РЕЗКИЙ РОСТ ЦЕН/ БИЗНЕС В ПАНИКЕ/ ИСТЕРИКА ДЕРИПАСКИ. Милов об экономике

Clojure 1.12.0 Release Rundown!

Clojure 1.12.0 Release Rundown!

Поймите чистую архитектуру за 7 минут

Поймите чистую архитектуру за 7 минут

cljs.main - David Nolen

cljs.main - David Nolen

Why you don’t understand onion / clean architecture

Why you don’t understand onion / clean architecture

Eric Normand Office Hours 2024-07-03

Eric Normand Office Hours 2024-07-03

Новый удар от ФНС: НДС 22%! Бизнес в России - ВСЁ?! Экономика в стагнации | Новости сегодня

Новый удар от ФНС: НДС 22%! Бизнес в России - ВСЁ?! Экономика в стагнации | Новости сегодня

Clean Architecture vs Onion Architecture

Clean Architecture vs Onion Architecture

Музыка для глубокого фокуса для улучшения концентрации — 12 часов эмбиентной учебной музыки для конц

Музыка для глубокого фокуса для улучшения концентрации — 12 часов эмбиентной учебной музыки для конц

Onion architecture with stereotypes by Alain Sahli

Onion architecture with stereotypes by Alain Sahli

What, me worry? or Should We Fear Intelligent Machines? - Gerald Jay Sussman

What, me worry? or Should We Fear Intelligent Machines? - Gerald Jay Sussman

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com