Podcasts about single responsibility principle

  • 21PODCASTS
  • 40EPISODES
  • 41mAVG DURATION
  • ?INFREQUENT EPISODES
  • Nov 12, 2024LATEST

POPULARITY

20172018201920202021202220232024


Best podcasts about single responsibility principle

Latest podcast episodes about single responsibility principle

javaswag
#71 - Алексей Жидков - эргономичный подход и декомпозиция архитектуры

javaswag

Play Episode Listen Later Nov 12, 2024 108:51


В 71 выпуске подкаста Javaswag поговорили с Алексеем Жидковым об эргономичном подходе для разработки архитектуры проекта 00:00 Начало 12:06 Работа консультанта 17:38 Эргономичный подход и его принципы 26:44 Практика применения принципов разработки 30:55 Трудности внедрения DDD на практике 37:15 Популярность DDD и его реальная эффективность 39:33 TDD и его место в эргономичном подходе 41:00 Тестирование как основа разработки 43:55 Проблемы с моками в тестировании 48:50 Архитектурные подходы и JPA 51:01 Функциональная архитектура и ее влияние на разработку 55:36 Проблемы с ORM и Hibernate 01:00:03 Эргономичность и альтернативы ORM 01:01:53 Неизменяемая модель данных 01:05:58 Эргономичный подход в разработке 01:08:32 Обсуждение стека технологий и его эволюция 01:11:21 Эргономичный подход в разработке проектов 01:17:14 Проблемы объектно-ориентированного программирования 01:20:56 Декомпозиция системы и создание API 01:22:38 Тестирование и разработка по TDD 01:27:24 Экономика эргономичной архитектуры 01:30:59 Элементы эргономичного подхода 01:40:15 Проблемы многопоточности 01:42:58 Непопулярное мнение Гость - https://t.me/ergonomic_code Ссылки: Канал в телеграме https://t.me/ergonomic_code Сайт Алексея https://azhidkov.pro/ Многоликий принцип единственности ответственности - мой разбор формулировок и интерпретаций Single Responsibility Principle, которые даёт сам Анкл Боб. FizzBuzz Enterprise Edition - пример доведения Open-Closed Principle до абсурда SOLID Deconstruction - Kevlin Henney - c 28:23 докладчик говорит о том, что Liskov Substituion Principle является нонсенсом - для его соблюдения, вы не можете переобределять методы - только добавлять новые, про которые программа-клиент ничего не знает Domain-Driven Design: Tackling Complexity in the Heart of Software - та самая книга про DDD Принципы юнит-тестирования - самая крутая на сегодняшний день книга по тестированию бакендов Сайт Владимира Хорикова РЕПЕТИЦИЯ Структурный дизайн. Древний секрет простого и быстрого кода. - репетиция моего доклада на Joker ‘24 РЕПЕТИЦИЯ Функциональная архитектура и Spring Data JDBC. 4 года в проде, полёт отличны" - репетиция моего второго доклада на Joker ‘24, который в итоге стал Lightening Talk-ом Why is Java making so many things immutable? - пост в блоге Оракла, где автор пишет “чуваки, не парьтесь, GC заточен на быстрое создание объектов” Trainer Advisor - реальный проект по Эргономичному подходу Диаграмма эффектов - диаграмма, которую я использую для декопозиции ядра/домена/модели (сущностей и интеграций) на модули Алексей Жидков — Рациональный подход к декомпозиции систем на модули или микросервисы - мой доклад на JPoint ‘23 с алгоримтом декомпозиции диаграммы эффектов Lean Architecture: for Agile Software Development The Transformation Priority Premise, Code That Fits in Your Head - как выходить из тупика, когда в продовом коде захардкожен OK 200 и тест зелёный Как я превратил легаси-проект в конфетку за полгода. Том 1 - мой пост о том, как я переделал проект по Эргономичному подходу и ускорил работу команды в три раза Метрика Cognitive complexity или простой способ измерить сложность кода - лучшая альтеранитва цикломатической сложности Code Complexity - плагин для IDEA, который рисует когнитивную сложность прямо в редакторе Alan Kay at OOPSLA 1997 - The computer revolution hasnt happened yet - Алан Кей говорит, что не имел ввиду C++, когда придумывал термин ООП Dr. Alan Kay on the Meaning of “Object-Oriented Programming” - Алан Кей говорит, что имел ввиду под ООП Кип сейф!

The GeekNarrator
Clean Code Adventures with Uncle Bob

The GeekNarrator

Play Episode Listen Later Feb 17, 2024 94:01


In this episode, we dive deep into the world of clean coding with none other than the master and pioneer of the field, Uncle Bob. We explore the nuances and the art behind writing effective and efficient scripts. This conversation covers the nitty-gritty of writing and editing scripts, from understanding how to break down large functions, to discussing principles like 'Single Responsibility Principle', 'Dependency Inversion Principle' and how to balance the 'DRY' (Don't Repeat Yourself) principles. Uncle Bob also shares valuable insights on testing, handling errors, naming conventions and how to work with different types of duplication in coding. He shares recommended resources and books that every coder should read. Chapters: 00:00 Introduction and Welcome 00:06 The Importance of Code Quality 00:29 Introducing Robert Martin (Uncle Bob) 01:39 Uncle Bob's Journey in Programming 02:34 Discussion on Functional Design and New Book 03:52 The Evolution of Software Development 04:28 Revisiting the Clean Code Book 04:49 The Impact of Hardware Changes on Software 06:13 The Evolution of Programming Languages 07:33 The Importance of Code Structure and Organization 09:07 The Impact of Microservices and Open Source 11:14 The Role of Modular Programming 22:07 The Importance of Naming in Code 26:31 The Role of Functions in Code 34:12 The Role of Switch Statements in Code 42:36 The Importance of Immutability 51:00 Dealing with Complex Steps in Programming 51:21 Implementing State Machines in Programming 51:46 The Pragmatic Approach to Programming 53:01 Understanding Error Handling in Programming 54:08 The Challenge of Exception Handling 57:27 The Importance of Log Messages in Debugging 01:03:05 The Dilemma of Code Duplication 01:05:51 The Intricacies of Error Handling 01:07:40 The Role of Abstraction in Programming 01:13:55 The Importance of Testing in Programming 01:19:43 The Challenges of Mocking in Testing 01:25:11 The Essence of Programming: Discipline, Ethics, and Standards Book Recommendations: Tidy First: https://www.oreilly.com/library/view/tidy-first/9781098151232/ Design Patterns: https://www.amazon.de/-/en/Erich-Gamma/dp/0201633612 Analysis Pattern: https://martinfowler.com/books/ap.html Structured Analysis and System Specification: https://www.amazon.de/-/en/Tom-Demarco/dp/0138543801 Fundamental Algorithms: https://www.amazon.com/Art-Computer-Programming-Vol-Fundamental/dp/0201896834 Sorting and Searching: https://www.amazon.de/-/en/Donald-Knuth/dp/0201896850 Structure and Interpretation of Computer Programs: https://web.mit.edu/6.001/6.037/sicp.pdf =============================================================================== For discount on the below courses: Appsync: https://appsyncmasterclass.com/?affiliateId=41c07a65-24c8-4499-af3c-b853a3495003 Testing serverless: https://testserverlessapps.com/?affiliateId=41c07a65-24c8-4499-af3c-b853a3495003 Production-Ready Serverless: https://productionreadyserverless.com/?affiliateId=41c07a65-24c8-4499-af3c-b853a3495003 Use the button, Add Discount and enter "geeknarrator" discount code to get 20% discount. =============================================================================== Follow me on Linkedin and Twitter: https://www.linkedin.com/in/kaivalyaapte/ and https://twitter.com/thegeeknarrator If you like this episode, please hit the like button and share it with your network. Also please subscribe if you haven't yet. Database internals series: https://youtu.be/yV_Zp0Mi3xs Popular playlists: Realtime streaming systems: https://www.youtube.com/playlist?list=PLL7QpTxsA4se-mAKKoVOs3VcaP71X_LA- Software Engineering: https://www.youtube.com/playlist?list=PLL7QpTxsA4sf6By03bot5BhKoMgxDUU17 Distributed systems and databases: https://www.youtube.com/playlist?list=PLL7QpTxsA4sfLDUnjBJXJGFhhz94jDd_d Modern databases: https://www.youtube.com/playlist?list=PLL7QpTxsA4scSeZAsCUXijtnfW5ARlrsN Stay Curios! Keep Learning!

Android story
ASP-83: Скажи SOLID НІ! Він застарів.

Android story

Play Episode Listen Later Dec 7, 2023 56:33


Подивитись відео на YouTube 00:00:00 - Вова знайшов цікаву статтю в коментарях на Доу. Про спільний словниковий запас на співбесідах.00:06:28 - Фігня ваш SOLID було сказано на PubConf.00:10:45 - Що не так з Single Responsibility Principle. І що замість нього.00:25:55 - Що не так з Open-Closed Principle. І що замість нього.00:34:22 - Що не так з Liskov's Substitution Principle. І що замість нього.00:39:34 - Interface Segragation Principle і як на нього можна по різному дивитися.00:44:41 - Головне зло. Що не так з Dependency Inversion Principle.https://dannorth.net/cupid-the-back-story/Коментарі та побажання можна залишити в нашому телеграм чаті.Наш патреон, на якому тепер можна отримати trial на 7 днів та слухати випуски з пре-шоу, яке часто довше ніж сам випуск :)

solid liskov single responsibility principle
Android story
ASP-83: Скажи SOLID НІ! Він застарів.

Android story

Play Episode Listen Later Dec 7, 2023 56:33


В цьому випуску 00:00:00 - Вова знайшов цікаву статтю в коментарях на Доу. Про спільний словниковий запас на співбесідах.00:06:28 - Фігня ваш SOLID було сказано на PubConf.00:10:45 - Що не так з Single Responsibility Principle. І що замість нього.00:25:55 - Що не так з Open-Closed Principle. І що замість нього.00:34:22 - Що не так з Liskov's Substitution Principle. І що замість нього.00:39:34 - Interface Segragation Principle і як на нього можна по різному дивитися.00:44:41 - Головне зло. Що не так з Dependency Inversion Principle.Згадано в випускуПідтримай нас на Patreon

solid liskov single responsibility principle
Android story
ASP-83: Скажи SOLID НІ! Він застарів.

Android story

Play Episode Listen Later Dec 7, 2023 56:32


00:00:00 - Вова знайшов цікаву статтю в коментарях на Доу. Про спільний словниковий запас на співбесідах.00:06:28 - Фігня ваш SOLID було сказано на PubConf.00:10:45 - Що не так з Single Responsibility Principle. І що замість нього.00:25:55 - Що не так з Open-Closed Principle. І що замість нього.00:34:22 - Що не так з Liskov's Substitution Principle. І що замість нього.00:39:34 - Interface Segragation Principle і як на нього можна по різному дивитися.00:44:41 - Головне зло. Що не так з Dependency Inversion Principle.Коментарі та побажання можна залишити в нашому телеграм чаті.Наш патреон, на якому тепер можна отримати trial на 7 днів та слухати випуски з пре-шоу, яке часто довше ніж сам випуск :) - https://www.patreon.com/androidstory Тут для вас є ще більше нашого контенту Hosted on Acast. See acast.com/privacy for more information.

acast solid liskov single responsibility principle
Macht der Craft
Clean Code - Erweiterbarkeit - Teil 2

Macht der Craft

Play Episode Listen Later Jul 18, 2023 37:18


In dieser Folge sprechen wir über die Solid-Prinzipien und über Separation of Concerns. Durch klare Verantwortlichkeiten und die Trennung von Code können wir unsere Anwendung erweiterbarer gestalten. Der Einsatz des Single Responsibility Principle sorgt dafür, dass Klassen nur eine Aufgabe haben. Das Open-Closed-Prinzip ermöglicht es uns, neuen Code hinzuzufügen, anstatt bestehenden zu verändern. Das Interface Segregation Principle macht Interfaces fokussierter. Das Dependency Inversion Principle verringert Abhängigkeiten zwischen Klassen.

Arch-In-Minutes
Quando não utilizar Single Responsibility Principle no desenvolvimento de software ?

Arch-In-Minutes

Play Episode Listen Later Apr 9, 2023 4:19


O Single Responsibility Principle (Princípio de Responsabilidade Única) é um princípio do SOLID, este princípio enfatiza a importância de cada classe ter apenas uma responsabilidade, ou seja, uma classe deve ter apenas uma razão para mudar.Ao seguir o Single Responsibility Principle, o código se torna mais modular, testável e flexível, o que ajuda a garantir a qualidade e eficiência do software. Em resumo, o Single Responsibility Principle é importante para criar um código organizado, de fácil manutenção e escalável.No entanto, é importante lembrar que a Single Responsibility Principle não é uma regra absoluta e, em alguns casos, pode não ser possível ou desejável aplicá-la completamente. Neste vídeo eu explico para você em quais cenários o Single Responsibility Principle não deve ser utilizado e porque o Single Responsibility Principle não deve ser utilizado.Quer saber em quais cenários não utilizar o Single Responsibility Principle e também o porquê não utilizar? Então assista ao vídeo agora mesmo!—DICAS DE VÍDEOS PARA VOCÊ MARATONAR:▶️ Clean Code - Codando com menos ifshttps://www.youtube.com/watch?v=0_Jyp6ah-6M&t=74s▶️ Código bem feito SEMPRE: será que vale a pena?

Arch-In-Minutes
Título: Aprenda como aplicar o Single Responsibility Principle através de um exemplo prático em Typescript

Arch-In-Minutes

Play Episode Listen Later Apr 9, 2023 11:20


Existem várias maneiras de aplicar o Single Responsibility Principle (SRP) ao código. Uma maneira é dividir a lógica do código em diferentes classes ou módulos que realizam tarefas específicas. Isso pode ajudar a evitar a criação de classes sobrecarregadas com muitas responsabilidades, o que pode tornar o código mais difícil de manter. Em geral, a aplicação do Single Responsibility Principle ao código pode ajudar a melhorar a qualidade do software, tornando-o mais fácil de entender, modificar e testar. Além disso, ao seguir o princípio de responsabilidade única, os desenvolvedores podem evitar problemas comuns, como código duplicado e dependências desnecessárias. Em resumo, o Single Responsibility Principle é um princípio fundamental de design de software que deve ser aplicado sempre que possível para criar código mais eficiente e eficaz.Neste vídeo eu irei lhe mostrar um exemplo prático de aplicação do Single Responsibility Principle em um sistema de e-commerce explorando um código que trata meios de pagamento. A linguagem utilizada durante o exemplo é o Typescript, uma linguagem de programação mais próxima do Javascript que a maioria dos desenvolvedores conhecem e que, qualquer pessoa que tenha familiaridade com C#, C++, Java ou .NET também conseguirá entender.Bora aprender a como aplicar o Single Responsibility na prática?!

Ardiland
Programming principles - SOLID - Single-responsibility Principle - SRP

Ardiland

Play Episode Listen Later Feb 14, 2023 27:38


این ویدیو اولین ویدیو از سری اصول برنامه نویسی هستدر این سری به بررسی کاربردی انواع اصول برنامه نویسی می پردازم و با هم میبینیم که هر یک از این اصول یعنی چه و چرا باید رعایت بشهاصولی مثل:SOLID principlesDRY - Do not repeat yourselfYAGNI - You ain't gonna need itKISS - Keep it simple stupid!و ....در این ویدیو به بررسی دقیق اصل اول یا S در مجموعه SOLID می پردازیمSRP - Single-responsibility Principle---------------------------------------------------------------لینک کانال در سایر شبکه های اجتماعیYouTube:https://www.youtube.com/c/Ardiland1---------------------------------------------------------------Telegram:https://t.me/ardiland_tm---------------------------------------------------------------Instagram:https://www.instagram.com/ardiland_ig/---------------------------------------------------------------Twitter:https://twitter.com/Ardiland3---------------------------------------------------------------GitHub:https://github.com/ardalanebrahimi---------------------------------------------------------------LinkedIn:https://www.linkedin.com/in/ardalan-ebrahimi---------------------------------------------------------------

principles solid programming single responsibility principle
The Rabbit Hole: The Definitive Developer's Podcast
253. SOLID - Single Responsibility Principle (Replay)

The Rabbit Hole: The Definitive Developer's Podcast

Play Episode Listen Later May 3, 2022 16:07


Do you know how you can feel overwhelmed when you have too much on your plate? Well, your code can feel the same way. This is why it's important to follow the Single Responsibility Principle, SRP, which is what the ‘s' in SOLID stands for. Today we do a deep dive into the SRP and how you can ensure that your class or object only does one thing at a time. We take a look at some of the benefits of following the SRP, such as ease of testing and greater flexibility with making changes. When there is more than one responsibility designated to a class, it can quickly become confusing when you need to alter a piece of code. We also look into why you should try to keep classes as small as you can, how to know if a class or object has more than one responsibility, and why you should always be ready to refactor.

solid srp single responsibility principle
Modernize or Die ® Podcast - CFML News Edition
Modernize or Die® - CFML News for April 19th, 2022 - Episode 144

Modernize or Die ® Podcast - CFML News Edition

Play Episode Listen Later Apr 19, 2022 49:33


2022-04-19 Weekly News - Episode 144Watch the video version on YouTube at https://youtu.be/UrcOxVA2XcA Hosts: Gavin Pickin - Senior Developer at Ortus SolutionsEric Peterson - Senior Developer at Ortus SolutionsThanks to our Sponsor - Ortus SolutionsThe makers of ColdBox, CommandBox, ForgeBox, TestBox and all your favorite box-en out there. A few ways  to say thanks back to Ortus Solutions: Like and subscribe to our videos on YouTube.  Help ORTUS reach for the Stars - Star and Fork our Repos Star all of your Github Box Dependencies from CommandBox with https://www.forgebox.io/view/commandbox-github  Subscribe to our Podcast on your Podcast Apps and leave us a review Sign up for a free or paid account on CFCasts, which is releasing new content every week Buy Ortus's Book - 102 ColdBox HMVC Quick Tips and Tricks on GumRoad (http://gum.co/coldbox-tips)  Patreon SupportWe have 35 patreons providing 92% of the funding for our Modernize or Die Podcasts via our Patreon site: https://www.patreon.com/ortussolutions. News and EventsLast chance for ITB CFP - Into the Box 2022 CFPSupposed to Close April 17th, but the form is still up there… go submit now - we have extended it until April 30th!!!Into the Box will be live in Houston in September 2022.  We want you to speak there! Topic submission closes at midnight April 30th, 2022https://forms.gle/HR1vQf2T5rs8yCZo9https://intothebox.orgCFML Community Submissions - Curl Converter by Scott SteinbeckConvert curl commands to Python, JavaScript, PHP, R, Go, Rust, Elixir, Java, MATLAB, Dart, CFML, Ansible URI, Strest or JSON and now CFML.https://curlconverter.com/ We need more of these tools pages to include CFML - like the QuickRef that James Moberg mentions on Twitter (talk about later)Pull request that made it happen: https://github.com/curlconverter/curlconverter/pull/376HostMedia - Released an Update to CFManagerWe've released a new update to our CFManager @cPanel plugin, improvements include UX tweaks, option to support UTF8 connection strings and a new dedicated documentation website at cfmanager.infohttps://cfmanager.info/ Mid-Michigan CFUG - John Farrar is presenting on 13 ways to modernize with Vue 34/19/2022 - 7 pm eastern time.Learn everything that is new and how to transition to Vue 3.Meeting URL: https://bit.ly/3rwOxvq Ortus Webinar - April - cbSecurity: Passwords, Tokens, and JWTs with Eric PetersonApril 29th 202211:00 AM Central Time (US and Canada)Learn how to integrate cbSecurity into your application whether you are using passwords, API tokens, JWTs, or a combination of all three!More Webinars: https://www.ortussolutions.com/events/webinars Hawaii ColdFusion Meetup Group - Using ColdFusion ORMs with Nick KwiatkowskiFriday, April 29, 20224:00 PM to 5:00 PM PDTThe ColdFusion language introduced the concept of ORM (Object Relation Mappings) to allow developers to be able to do database work without having to write database-dependent SQL.Nick Kwiatkowski is an adjunct professor at Michigan State University, a member of the Mid-Michigan CFUG, and Apache Foundation Member. His day job also includes managing the telecommunications platforms at MSU as well as managing a variety of applications on campus. He has been a ColdFusion developer for nearly 25 years and an instructor for 15.https://www.meetup.com/hawaii-coldfusion-meetup-group/events/285109975/ Adobe WorkshopsJoin the Adobe ColdFusion Workshop to learn how you and your agency can leverage ColdFusion to create amazing web content. This one-day training will cover all facets of Adobe ColdFusion that developers need to build applications that can run across multiple cloud providers or on-premiseTHURSDAY, APRIL 21, 202210:00 AM PDTAdobe ColdFusion TruthsMark Takatahttps://adobe-coldfusion-truths.meetus.adobeevents.com/TUESDAY, APRIL 26, 20229:00 AM CETAdobe ColdFusion WorkshopDamien Bruyndonckx (Brew-en-dohnx) https://adobe-workshop-coldfusion.meetus.adobeevents.com/FREE :)Full list - https://meetus.adobeevents.com/coldfusion/ CFCasts Content Updateshttps://www.cfcasts.comJust Released Gavin Pickin - Publish Your First ForgeBox PackageCreating an Account - Onlinehttps://cfcasts.com/series/publish-your-first-forgebox-package/videos/creating-an-account-online Creating an Account - CLIhttps://cfcasts.com/series/publish-your-first-forgebox-package/videos/creating-an-account-cli Coming SoonMore… Gavin Pickin - Publish Your First ForgeBox PackageConferences and TrainingICYMI - LAST WEEK - DevNexus 2022 - The largest Java conference in the USApril 12-14, 2022Atlanta, GABrad & Luis will be speakingLuis - Alpine.js: Declare and React with SimplicityBrad - What's a Pull Request? (Contributing to Open Source)https://devnexus.com/They really enjoyed itRay Camden was tweeting about Luis's Alpine session, he might love it :)DockerConMay 10, 2022Free Online Virtual ConferenceDockerCon will be a free, immersive online experience complete with Docker product demos , breakout sessions, deep technical sessions from Docker and our partners, Docker experts, Docker Captains, our community and luminaries from across the industry and much more. Don't miss your chance to gather and connect with colleagues from around the world at the largest developer conference of the year. Sign up to pre-register for DockerCon 2022!https://www.docker.com/dockercon/ US VueJS ConfFORT LAUDERDALE, FL • JUNE 8-10, 2022Beach. Code. Vue.Workshop day: June 8Main Conference: June 9-10https://us.vuejs.org/That ConferenceHowdy. We're a full-stack, tech-obsessed community of fun, code-loving humans who share and learn together.We geek-out in Texas and Wisconsin once a year but we host digital events all the time.For a limited time all monthly THAT Online events are free and do not require a ticket to participate.Read more at: https://that.us/events/thatus/2022-5/ on THAT.There have webinars too https://that.us/activities/WISCONSIN DELLS, WI / JULY 25TH - 28TH, 2022A four-day summer camp for developers passionate about learning all things mobile, web, cloud, and technology.https://that.us/events/wi/2022/ Our very own Daniel Garcia is speaking there https://that.us/activities/sb6dRP8ZNIBIKngxswIt CF SummitIn person at Las Vegas, NV in October 2022!Official-”ish” dates:Oct 3rd & 4th - CFSummit ConferenceOct 5th - Adobe Certified Professional: Adobe ColdFusion Certification Classes & Testshttps://twitter.com/MarkTakata/status/1511210472518787073Into The Box 2022Solid Dates - September 2022One day workshops before the two day conference!Early bird pricing available until April 30, 2022Call for Speakers:https://forms.gle/HR1vQf2T5rs8yCZo9Conference Website:https://intothebox.orgInto the Box Latam 2022Tentative dates - Dec 1-2CFCampStill waiting as well.More conferencesNeed more conferences, this site has a huge list of conferences for almost any language/community.https://confs.tech/Blogs, Tweets, and Videos of the WeekBEN CORNER4/18/22 Tweet - Ben Nadel - Lucee thinks 2.1 million items might be too many???Apparently, the #Lucee #CFML server isn't happy taking an array of 2.1 M items and splitting it up into chunks of 100. I had NO IDEA that the algorithm I wrote would ever encounter an array with 2M items in it

The Rabbit Hole: The Definitive Developer's Podcast
162. SOLID - Single Responsibility Principle

The Rabbit Hole: The Definitive Developer's Podcast

Play Episode Listen Later Jun 30, 2020 16:07


Do you know how you can feel overwhelmed when you have too much on your plate? Well, your code can feel the same way. This is why it's important to follow the Single Responsibility Principle, SRP, which is what the ‘s' in SOLID stands for. Today we do a deep dive into the SRP and how you can ensure that your class or object only does one thing at a time. We take a look at some of the benefits of following the SRP, such as ease of testing and greater flexibility with making changes. When there is more than one responsibility designated to a class, it can quickly become confusing when you need to alter a piece of code. We also look into why you should try to keep classes as small as you can, how to know if a class or object has more than one responsibility, and why you should always be ready to refactor.

solid srp single responsibility principle
.NET in pillole
SOLID #1 - Single Responsibility Principle

.NET in pillole

Play Episode Listen Later Jun 1, 2020 20:28


Iniziamo questo percorso alla scoperta di SOLID, i primi cinque principi dello sviluppo del software orientato agli oggetti descritti da Robert Martin nei primi anni 2000, e alla base dello sviluppo di software leggibile, estendibile e manutenibile.Oggi puntata dedicata al primo principio: Single Responsibility Principle

solid oggi iniziamo oop robert martin single responsibility principle
Python Bytes
#177 Coding is 90% Google searching or is it?

Python Bytes

Play Episode Listen Later Apr 16, 2020 41:43


Sponsored by Datadog: pythonbytes.fm/datadog We’re launching a YouTube Project: pythonbytes.fm/youtube Brian #1: Announcing a new Sponsorship Program for Python Packaging “The Packaging Working Group of the Python Software Foundation is launching an all-new sponsorship program to sustain and improve Python's packaging ecosystem. Funds raised through this program will go directly towards improving the tools that your company uses every day and sustaining the continued operation of the Python Package Index.” Improvements since 2017, as a result of one time grants, a contract, and a gift: relaunch PyPI in 2018 added security features in 2019 improve support for users with disabilities and multiple locales in 2019 security features in 2019, 2020 pip & dependency resolver in 2020 Let’s keep it going We use PyPI every day We need packaging to keep getting better You, and your company, can sponsor. View the prospectus, apply to sponsor, or ask questions. Individuals can also donate. Michael #2: energy-usage A Python package that measures the environmental impact of computation. Provides a function to evaluate the energy usage and related carbon emissions of another function. Emissions are calculated based on the user's location via the GeoJS API and that location's energy mix data (sources: US E.I.A and eGRID for the year 2016). Can save report to PDF, run silently, etc. Only runs on Linux Brian #3: Coding is 90% Google Searching — A Brief Note for Beginners Colin Warn Short article, mostly chosen to discuss the topic. Michael & Brian disagree, so, what’s wrong with this statement? Michael #4: Using WSL to Build a Python Development Environment on Windows Article by Chris Moffet VMs aren’t fair to Windows (or macOS or …) But you need to test on linux-y systems! Enter WSL. In 2016, Microsoft launched Windows Subsystem for Linux (WSL) which brought robust unix functionality to Windows. May 2019, Microsoft announced the release of WSL 2 which includes an updated architecture that improved many aspects of WSL - especially file system performance. Check out Chris’ article for What is WSL and why you may want to install and use it on your system? Instructions for installing WSL 2 and some helper apps to make development more streamlined. How to use this new capability to work effectively with python in a combined Windows and Linux environment. The main advantage of WSL 2 is the efficient use of system resources. Running a very minimal subset of Hyper-V features and only using minimal resources when not running. Takes about 1 second to start. The other benefit of this arrangement is that you can easily copy files between the virtual environment and your base Windows system. Get the most out of this with VS Code + Remote - WSL Python Extension Anaconda Extension Pack Brian #5: A Pythonic Guide to SOLID Design Principles Derek D Again, mostly including this as a discussion point But for reference, here’s the decoder Single Responsibility Principle Every module/class should only have one responsibility and therefore only one reason to change. Open Closed Principle Software Entities (classes, functions, modules) should be open for extension but closed to change. Liskov's Substitutability Principle If S is a subtype of T, then objects of type T may be replaced with objects of Type S. Interface Segregation Principle A client should not depend on methods it does not use. Dependency Inversion Principle High-level modules should not depend on low-level modules. They should depend on abstractions and abstractions should not depend on details, rather details should depend on abstractions. Michael #6: Types for Python HTTP APIs: An Instagram Story Let’s talk about Typed HTTP endpoints Instagram has a few (thousand!) on a single Django app We can have data access layers with type annotations, but how do these manifest in HTTP endpoints? Instagram has a cool api_view decorator to “upgrade” regular typed methods to HTTP endpoints. For data exchange, dataclasses are nice, they have types, they have type validation, they are immutable via frozen. But some code is old and crusty, so TypedDict out of mypy allows raw dict usage with validation still. OpenAPI can be used for very nice documentation generation. Comments are super interesting. Suggesting pydantic, fastapi, and more. But that all ignores the massive legacy code story. But one is helpful and suggests Schemathesis: A tool for testing your web applications built with Open API / Swagger specifications. Extras: Michael: superstring follow up Joke: "How many programmers does it take to kill a cockroach? Two: one holds, the other installs Windows on it."

Adventures in .NET
.NET 011: SOLID and .NET Predictions with Patrick Smacchia

Adventures in .NET

Play Episode Listen Later Oct 22, 2019 59:37


In this episode of Adventures in .NET the panel interviews Patrick Smacchia who is known for his static analyzer, NDepend. The panel discusses NDepend, Patrick explains a bit about what is and how it works along with his history in .NET. Patrick is here to explains SOLID, an acronym introduced by Robert C. Martin outlining principles for object-oriented programming.  These principles teach programmers to use object-oriented programming correctly. The panel considers what can go wrong when object-oriented programming is misused. They also explain that the most important thing when it comes to SOLID is to try your best, it is impossible to be perfect in anything. Patrick explains that when your code is SOLID is will be easily testable and maintainable.  The five principles are Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Of all the principles, Single Responsibility is unique. Patrick explains that this principle is all about organization and advises developers to be very careful when using this principle in your domain. The domain is where it is most important to have SOLID code and it needs to be 100% covered by testing. The panel shares that this is the principle that they try the hardest to follow.   The definition given by Patrick for Single Responsibility is that a class should have a single responsibility or a class should have only one reason to change. Patrick warns the listeners that this is a very complex concept that is difficult to explain. The panel explains that Single Responsibility is a way to accomplish a separation of concern. The panel outlines the benefits of following this principle while Patrick shares some examples and walk the listeners implementing this principle.  The next principle is Open-Closed. Patrick’s definition of this principle is modules should be open for extension but closed for modification. He and the panel dive deeper into what this means. He advises developers when designing a class to be very careful when choosing the point of variation and make sure you don’t change the code in your base class. Caleb shares the problems they experienced in one of his recent projects when this principle was not followed. Patrick explains why the solution is more often the interface rather than the base class.  Moving on to the next principle, the Liskov substitution. Patrick explains how this principle using the example of the ibird. The Liskov substitution principle is that objects in a program should be replaceable so that you can’t tell the difference. In the ibird example, you can not replace the ibird with any bird because if the ibird can fly but the replacement bird is an ostrich it cannot perform the necessary functions. Patrick explains how ilists are in opposition to the Liskov principle.   Next is the Interface Segregation Principle. Patrick explains how this relates to the Single Responsibility Principle. He also discusses how the Liskov Substitution and the Interface Segregation are two sides of the same coin when it comes to designing interfaces. The Interface Segregation explains that many smaller client-specific interfaces are better that one large interface with everything on it.  The final principle is Dependency Inversion. Patrick explains that this principle does not help you design your interface, it helps you organize dependencies into your code structure.   This principle advises developers to depend on abstractions. He explains how this principle relates to dependency injection. The panel considers the damage dependencies can cause in a codebase if improperly used. Patrick explains when a developer will want to use abstractions and when to use classes. He explains that these 5 principles will become natural and feel like common sense as developers gain experience. Switching gears, the panel moves on to discuss a blogpost Patrick wrote explaining 4 predictions he had for the future of .NET. He wrote the article because of the announcement that .NET core will become .NET 5. The future of .NET has a great impact on NDepend and Patrick wanted to give some perspective to the changes and how they might affect his company.   His first prediction is that .NET standards won’t evolve much. Patrick explains that the purpose of .NET Standards was to support all the .NET flavors and with only .NET to support that job will become much simpler. He also speculates on the reasons for Microsoft wanting only one .NET. Some of the reasons he lists are that Microsoft does not have an endless workforce and .NET core is open source and multiplatform.  Patrick’s second prediction greatly impacts NDepend. His prediction is that Visual Studios will run on .NET 5, explaining why he is so sure that they will switch Visual Studios over to .NET 5. Patrick believes that it may take a while for the switch to happen. The panel considers the future of Windows.  The third prediction Patrick makes is that .NET will propose a cross-platform UI framework. Microsoft did a poll asking developers about the need for a cross-platform UI framework. The panel speculates how this framework will happen. Patrick wonders at the possibility of WPF. The panel brings up the final prediction, that Blazor has a bright future, and wonder if Blazor could become that cross-platform UI framework.   Panelists Shawn Clabough Caleb Wells Guest Patrick Smacchia Sponsors My Ruby Story React Native Radio Adventures in Angular CacheFly Links www.ndepend.com  SOLID  4 Predictions for the Future of .NET   Satya Nadella reveals why Windows may not be the future of Microsoft’s business .NET 003: Blazor with Daniel Roth https://www.facebook.com/Adventures-in-NET-373059030062837/ https://twitter.com/dotNET_Podcast Picks Caleb Wells: https://www.packtpub.com/free-learning  Shawn Clabough: https://conemu.github.io/ 

Devchat.tv Master Feed
.NET 011: SOLID and .NET Predictions with Patrick Smacchia

Devchat.tv Master Feed

Play Episode Listen Later Oct 22, 2019 59:37


In this episode of Adventures in .NET the panel interviews Patrick Smacchia who is known for his static analyzer, NDepend. The panel discusses NDepend, Patrick explains a bit about what is and how it works along with his history in .NET. Patrick is here to explains SOLID, an acronym introduced by Robert C. Martin outlining principles for object-oriented programming.  These principles teach programmers to use object-oriented programming correctly. The panel considers what can go wrong when object-oriented programming is misused. They also explain that the most important thing when it comes to SOLID is to try your best, it is impossible to be perfect in anything. Patrick explains that when your code is SOLID is will be easily testable and maintainable.  The five principles are Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Of all the principles, Single Responsibility is unique. Patrick explains that this principle is all about organization and advises developers to be very careful when using this principle in your domain. The domain is where it is most important to have SOLID code and it needs to be 100% covered by testing. The panel shares that this is the principle that they try the hardest to follow.   The definition given by Patrick for Single Responsibility is that a class should have a single responsibility or a class should have only one reason to change. Patrick warns the listeners that this is a very complex concept that is difficult to explain. The panel explains that Single Responsibility is a way to accomplish a separation of concern. The panel outlines the benefits of following this principle while Patrick shares some examples and walk the listeners implementing this principle.  The next principle is Open-Closed. Patrick’s definition of this principle is modules should be open for extension but closed for modification. He and the panel dive deeper into what this means. He advises developers when designing a class to be very careful when choosing the point of variation and make sure you don’t change the code in your base class. Caleb shares the problems they experienced in one of his recent projects when this principle was not followed. Patrick explains why the solution is more often the interface rather than the base class.  Moving on to the next principle, the Liskov substitution. Patrick explains how this principle using the example of the ibird. The Liskov substitution principle is that objects in a program should be replaceable so that you can’t tell the difference. In the ibird example, you can not replace the ibird with any bird because if the ibird can fly but the replacement bird is an ostrich it cannot perform the necessary functions. Patrick explains how ilists are in opposition to the Liskov principle.   Next is the Interface Segregation Principle. Patrick explains how this relates to the Single Responsibility Principle. He also discusses how the Liskov Substitution and the Interface Segregation are two sides of the same coin when it comes to designing interfaces. The Interface Segregation explains that many smaller client-specific interfaces are better that one large interface with everything on it.  The final principle is Dependency Inversion. Patrick explains that this principle does not help you design your interface, it helps you organize dependencies into your code structure.   This principle advises developers to depend on abstractions. He explains how this principle relates to dependency injection. The panel considers the damage dependencies can cause in a codebase if improperly used. Patrick explains when a developer will want to use abstractions and when to use classes. He explains that these 5 principles will become natural and feel like common sense as developers gain experience. Switching gears, the panel moves on to discuss a blogpost Patrick wrote explaining 4 predictions he had for the future of .NET. He wrote the article because of the announcement that .NET core will become .NET 5. The future of .NET has a great impact on NDepend and Patrick wanted to give some perspective to the changes and how they might affect his company.   His first prediction is that .NET standards won’t evolve much. Patrick explains that the purpose of .NET Standards was to support all the .NET flavors and with only .NET to support that job will become much simpler. He also speculates on the reasons for Microsoft wanting only one .NET. Some of the reasons he lists are that Microsoft does not have an endless workforce and .NET core is open source and multiplatform.  Patrick’s second prediction greatly impacts NDepend. His prediction is that Visual Studios will run on .NET 5, explaining why he is so sure that they will switch Visual Studios over to .NET 5. Patrick believes that it may take a while for the switch to happen. The panel considers the future of Windows.  The third prediction Patrick makes is that .NET will propose a cross-platform UI framework. Microsoft did a poll asking developers about the need for a cross-platform UI framework. The panel speculates how this framework will happen. Patrick wonders at the possibility of WPF. The panel brings up the final prediction, that Blazor has a bright future, and wonder if Blazor could become that cross-platform UI framework.   Panelists Shawn Clabough Caleb Wells Guest Patrick Smacchia Sponsors My Ruby Story React Native Radio Adventures in Angular CacheFly Links www.ndepend.com  SOLID  4 Predictions for the Future of .NET   Satya Nadella reveals why Windows may not be the future of Microsoft’s business .NET 003: Blazor with Daniel Roth https://www.facebook.com/Adventures-in-NET-373059030062837/ https://twitter.com/dotNET_Podcast Picks Caleb Wells: https://www.packtpub.com/free-learning  Shawn Clabough: https://conemu.github.io/ 

Weekly Dev Tips
Interface Segregation

Weekly Dev Tips

Play Episode Listen Later Sep 2, 2019 5:57


Hi and welcome back to Weekly Dev Tips. I’m your host Steve Smith, aka Ardalis. This is episode 55, on the Interface Segregation principle. Interface Segregation Principle This week's tip is brought to you by devBetter.com. Sponsor - devBetter Group Career Coaching for Developers You can find help and advice all over today, from twitter to Stack Overflow to various Slack communities. These are great, but if you need more, if you need someone you can count on when you reach out for advice on code or your career, check out devBetter.com. Read the testimonials. Join risk free and see if it's for you. Not only will you learn from me, but if you stay for a while you'll grow and begin to be a mentor for others, gaining valuable confidence and experience. I've watched it happen. Show Notes / Transcript Returning back to the next SOLID principle, this week we're on the I as in Interface. Yes, it's the Interface Segregation Principle! Or ISP for short. Let's start by defining what this principle says. ISP states that no client should be forced to depend on methods it does not use. That's it. You can think of ISP as basically suggesting that you should prefer small, cohesive interfaces to large interfaces. In episode 49, which hopefully you already heard because you're listening to these in sequential order, we talked about the Single Responsibility Principle. These two principles are related! If you have classes that have only one responsibility, they're likely to expose a small, cohesive interface. That might be worth diving into a bit more. I'm guessing that when some developers, especially C# or Java developers, hear about ISP, they immediately map the word 'interface' to the interface type and keyword in these languages. That's not wrong, it's just not fully right, either. The public methods and properties a class exposes are its interface, even if it doesn't implement any interface defined separately. And ISP applies to implicit class interfaces just as much as it does to explicit interface definitions declared with the interface type. If you keep this in mind, it may make it easier to see how SRP and ISP relate, since SRP doesn't make any mention of interface types, only classes. The previous principle we discussed, Liskov Substitution, also relates to ISP. If you have a small, cohesive interface on a class, then when you decide to inherit from it you only have a few methods to worry about. If you have a massive number of methods, and your subtype is only concerned with a subset of them, it's much more likely that you won't fully implement all of the class's methods, potentially leaving some methods to throw NotImplementedException. Thus, it's easier to follow LSP if you first follow ISP. What's the point of having a smaller interface instead of a larger one, though? What's the down side to having fewer, larger classes with many methods on them? Certainly there's an argument to be made, and many have, that it makes it easier to find methods when you don't have so many different classes to search through to find them. The goal of ISP is to reduce dependency between types and especially between components in a system. The more types that depend on a particular type, the more difficult that type is to change. The more inertia it has in the system. If you have a class in your application that's used by 100 other classes, how likely are you to make major changes to its design, compared to one that you just wrote that has literally no other classes using it yet? Of course it's easier and WAY less risky to change classes that have few references to them. Let's say you want to change something fundamental about how that class that's used by 100 other classes works. One way you could do that would be to create a new instance of that class's interface or abstract base class, but then you'd have to implement all of its methods. Odds are, there are a bunch of them. That's not going to be easy - so instead you might just add some more conditional logic to some of the methods. Maybe add a few more method parameters to some methods. Maybe add a couple of new method overloads. And guess what? The problem just got bigger. The class just got bigger. The inertia just grew. By having a small interface and being focused on a small set of functionality, ISP-following classes are easier to change an easier to replace. By being small, they're easier to subtype or implement, making it easier to build systems that are modular. You find a class that has two methods and you want to change how it works in some situations? Just write a new class, implement the two methods, and swap it in where appropriate. Prefer writing new code to change legacy systems rather than modifying existing code. By following ISP, it's easier to replace classes with different variants that implement the same interface, which results in more loosely coupled and modular designs. These designs are easier to maintain and easier to test. You can learn more about ISP and the rest of the SOLID principles from my courses on Pluralsight, linked from this episode's show notes on weeklydevtips.com/episodes/55. Show Resources and Links devBetter SOLID Principles for C# Developers SOLID Principles of Object Oriented Design -and the DRY Principle Refactoring for C# Developers That’s it for this week. If you want to hear more from me, go to ardalis.com/tips to sign up for a free tip in your inbox every Wednesday. I'm also streaming programming topics on twitch.tv/ardalis most Fridays at noon Eastern Time. Thank you for subscribing to Weekly Dev Tips, and I'll see you next week with another great developer tip.

Weekly Dev Tips
Single Responsibility Principle

Weekly Dev Tips

Play Episode Listen Later May 20, 2019 5:46


Hi and welcome back to Weekly Dev Tips. I’m your host Steve Smith, aka Ardalis. This is episode 49 on the Single Responsibility Principle. Single Responsibility This week's tip is brought to you by devBetter.com. Sponsor - devBetter Group Career Coaching for Developers Are you a software developer looking to advance in your career more quickly? Would you find a mentor and a group of like-minded professionals valuable? If so, check out devBetter.com and read the testimonials at the bottom of the page. Sign up for a risk free membership if you're interested in growing your network and skills with us. Show Notes / Transcript The Single Responsibility Principle, or SRP, is the S in the SOLID principles macronym. The short version of it is that a class should have only one reason to change. Specifically, the reason referred to here is tied to the application's requirements. Each class should only be required to change in response to a single change in the application's requirements. These requirements typically correspond to real world things. For example, let's say the application needs to display a report for quarterly sales performance. The system's requirements might be that the report be rendered in a browser, that it include all sales for a given quarter grouped by individual sales representative. Either of these requirements might change in the future. Perhaps the reports need to be emailed as PDFs. Perhaps they need to be calculated monthly instead of quarterly or rolled up by sales region. Ideally, the format of the report and the details of how it is calculated should be separate responsibilities of separate classes. Why is SRP important? Back in episode 15, Maintain Legacy Code with New Code, I explain one reason. Every time you change a class, you risk breaking classes that work with it. When a class has multiple responsibilities, it will likely need to change more often. Also, it's likely these responsibilities will be tightly coupled together by the class, making it harder to change them independently and further increasing the inherent risk of changing them. Let's say you have to fix a bug in an application. Would you rather have to work in a single class that literally only does the thing that has the bug in it, or would you prefer to work in a 2000 line long class that does 10 different things, all of which are intermixed in the class's 50 methods and properties? I know which one I prefer. Too often, developers new to SOLID will hear about SRP and misunderstand a bit what a responsibility really is. They might have a class they've carved out from the rest of the application. Something like CustomerManager. They'll happily explain how CustomerManager is only responsible for Customers in the application, and thus is following SRP. But upon reviewing the code, it's clear that CustomerManager is responsible for Customer validation, Customer persistence, and Customer formatting for various user interfaces. It's responsible for notifying Customers when they place orders and oh yeah, it also is responsible for Customers placing orders, as well as managing their orders and their payment providers and their account history. But don't worry - CustomerManager only has one responsibility: Customers! Although I said responsibilities typically map to business requirements, they don't typically map to entities like customers or orders or policies. This is because these entities will often have a lot of rich behavior that can be isolated into separate responsibilities, often with cross-cutting concerns within the application. For instance, how a customer is validated will likely be very similar to how an order is validated. The same goes for persistence and UI formatting and a host of other activities. Each of these is a responsibility, and should be isolated in its own class. Now, it might seem like breaking up big classes into small ones is going to result in a lot more code, but often just the opposite occurs. As you pull cross-cutting concerns like validation, persistence, logging, notifications, formatting, etc. into their own classes, you'll often find ways to standardize the codebase and reuse these classes. A common way to achieve this reuse is through the strategy pattern, which I discuss in episode episode 19. The Strategy pattern lets you move responsibilities out of a class by delegating to other classes, which are often defined as fields or properties on the original class. These fields or properties have their instances set by having them passed in through the constructor, in what's commonly called dependency injection. Dependency injection and the strategy design pattern go hand-in-hand, and are my favorite way to refactor to achieve SRP in classes that I find have too many responsibilities. If you'd like to learn more about SRP and SOLID, check out my newly revised course, SOLID Principles for C# Developers, on Pluralsight. It's a complete update of my original SOLID Principles of Object Oriented Design course that has been in the top 100 for Pluralsight since it was published in 2010. The new one is shorter and streamlined, though it doesn't cover some topics the original course has. The new course also uses Visual Studio 2019 and has all of its course samples on GitHub. Check both of them out and let me know what you think. Show Resources and Links devBetter SOLID Principles for C# Developers SOLID Principles of Object Oriented Design -and the DRY Principle Refactoring Fundamentals That’s it for this week. If you want to hear more from me, go to ardalis.com/tips to sign up for a free tip in your inbox every Wednesday. I'm also streaming programming topics on twitch.tv/ardalis most Fridays at noon Eastern Time. Thank you for subscribing to Weekly Dev Tips, and I'll see you next week with another great developer tip.

Weekly Dev Tips
Introducing SOLID Principles

Weekly Dev Tips

Play Episode Listen Later May 6, 2019 7:26


Hi and welcome back to Weekly Dev Tips. I’m your host Steve Smith, aka Ardalis. This is episode 47, in which we'll introduce the SOLID principles. I'll spend a little time reviewing these principles in the upcoming episodes. What are the SOLID principles of object-oriented design? Sponsor - devBetter Group Career Coaching for Developers Are you a software developer looking to advance in your career more quickly? Would you find a mentor and a group of like-minded professionals valuable? If so, check out devBetter.com and read the testimonials at the bottom of the page. Sign up for a risk free membership if you're interested in growing your network and skills with us. Show Notes / Transcript Depending on how long you've been programming, you may have heard of the SOLID principles. These are a set of 5 principles that have been around for several decades, and about 15 years ago someone - I think it was Michael Feathers - had the idea to arrange them in such a way that they formed the macronym SOLID. Prior to that, I think the first time they were all published together was in Robert C. Martin's 2003 book, Agile Software Development: Principles, Patterns, and Practices in which their sequence spelled SOLDI - so close! This same sequence was used in the 2006 book Agile Principles, Patterns, and Practices in C#. So what are the SOLID principles? As I mentioned, SOLID is a macronym, meaning it is an acronym formed by other acronyms. In this case, these are SRP, OCP, LSP, ISP, and DIP. All those Ps at the end of each acronym stand for principle, of course. Listing each principle, we have: Single Responsibility Open/Closed Liskov Substitution Interface Segregation Dependency Inversion You may already be familiar with these principles. If you're a developer who's using a strongly typed language like C# or Java, you should be extremely familiar with them. If you're not, I recommend digging into them more deeply. Applying them can make a massive difference in the quality of code you write. How do I define quality? Well, that's probably a topic I could devote an episode to, but the short version is that quality code is code that is easy to understand and easy to change to suit new requirements. It's easily and quickly tested by automated tests, which reduces the need for expensive manual testing. And it's loosely coupled to infrastructure concerns like databases or files. How do these principles help you to write quality code? They provide guidance. You need to write code that solves a problem, first and foremost. But once you have code that does that, before you call it done and check it in, you should evaluate its design and see if it makes sense to spend a few moments cleaning anything up. Back in Episode 6 - you are listening to these in sequential, not reverse, order, right? - I talked about Kent Beck's approach of Make It Work, Make It Right, Make It Fast. SOLID principles should generally be applied during the Make It Right step. Don't apply them up front, but as I discussed in Episode 10, follow Pain Driven Development. If you try to apply every principle to every part of your codebase from the start, you'll end up with extremely abstract code that could do anything but actually does nothing. Don't do that. Instead, build the code you need to solve the problem at hand, and then evaluate whether that code has any major code smells like I discussed in episode 30. One huge code smell is code that is hard to unit test, meaning it's hard to write an automated test that can just test your code, without any external infrastructure or dependencies like databases, files, or web servers. Code that is easy to unit test is generally easy to change, and code that has tests is also easier to refactor because when you're done you'll have some degree of confidence that you haven't broken anything. In upcoming episodes, I'll drill into each principle a bit more. I've published two courses on SOLID at Pluralsight where you can obviously learn a lot more and see real code as opposed to just hearing me through a podcast. The first one was published in 2010 and so the tools and look were a bit dated. The more recent one is slimmed down and uses the latest version of Visual Studio and .NET Core. There are links to both courses in the show notes - the original one also covers the Don't Repeat Yourself principle. Let me wrap this episode up with a very brief overview of each principle. The Single Responsibility Principle is generally applied to classes and suggests that classes should have only one responsibility, which can also be thought of as one reason to change. Responsibilities include things like business logic, ui logic, data access, and more. Following this principle, you'll tend to have smaller, more focused classes. The Open/Closed Principle suggests that you should be able to change the behavior of your system without changing its source code. This generally relies on some kind of parameter or plug-in capability to provide new behavior to an existing class or service. The Liskov Substitution Principle cautions against creating inheritance hierarchies in which child types are not 100% substitutable for their base types. When violated, this can result in messy code and bugs. The Interface Segregation Principle suggests that classes that use interfaces should use all or most of the interface's exposed members. This then leads to interfaces that are small, focused, and cohesive, much like SRP. Finally, the Dependency Inversion Principle recommends that low-level concerns depend on high level concerns, not the other way around. This means for example that business layer code shouldn't directly depend on data access code, but rather an abstraction should exist that the business code works with and that the data access code implements. At runtime, the data access code will be provided as an implementation of the interface the business code is written to work with, providing loose coupling and more testable code. Show Resources and Links devBetter SOLID Principles for C# on Pluralsight Refactoring Fundamentals on Pluralsight SOLID Principles of Object Oriented Design on Pluralsight (published in 2010) Agile Software Development: Principles, Patterns, and Practices on Amazon Agile Principles, Patterns, and Practices in C# on Amazon See Visualizations and Subscribe to WeeklyDevTips in YouTube Clean Code on Amazon That’s it for this week. If you want to hear more from me, go to ardalis.com/tips to sign up for a free tip in your inbox every Wednesday. I'm also streaming programming topics on twitch.tv/ardalis most Fridays at noon Eastern Time. Thank you for subscribing to Weekly Dev Tips, and I'll see you next week with another great developer tip.

Thoughts on Functional Programming Podcast by Eric Normand
Single Responsibility Principle for Functional Programming

Thoughts on Functional Programming Podcast by Eric Normand

Play Episode Listen Later Oct 11, 2018 10:59


How do functional programmers use the Single Responsibility Principle?

functional programming single responsibility principle
Weekly Dev Tips
Layering Patterns on Repositories

Weekly Dev Tips

Play Episode Listen Later Aug 27, 2018 7:28


Layering Patterns on Repositories This week we're sticking to the patterns and repositories theme. I started down the design patterns path with Episode 17 so start at least from there if you want to listen to the sequence more-or-less in order. In this episode, we'll look at some combinations with other patterns that make using the Repository pattern even more attractive. Sponsor - DevIQ Thanks to DevIQ for sponsoring this episode! Check out their list of available courses and how-to videos. Show Notes / Transcript Last week I mentioned how the Repository pattern works well with the Strategy pattern, so that you can use dependency injection with it. This is the first of many ways in which you can combine Repository with other patterns, and is probably the most powerful of them all (though probably taken for granted by many). I described the strategy pattern in episode 19. Let's look at two other patterns now that we can combine with Repository. First, let's talk about a common pain point with repositories: custom queries. I talked about the need to encapsulate query logic so it doesn't leak out of your repository in episode 18. However, I saved a powerful technique for doing so until this tip. (Sorry, there's only so much I can put into each of these and keep them short.) If you follow my earlier advice and you don't leak query logic outside of your repositories, it's likely your repository implementations have a bunch of custom query methods. Maybe you have standard GetById and List methods, but then you also have ListByState, ListByModel, ListByOwner, etc. Maybe you have methods that correlate directly to business use cases or even UI concerns, like ListPremiumCustomers or ListForSearchScreen. The point is, you may find yourself with the code smell of too many one-off custom query methods on your repositories. This is pretty common, and the worse it gets the more cumbsersome it becomes to work with the repositories. The solution to this problem is to introduce another pattern. The Specification pattern is designed to encapsulate a query within an object. I mentioned it briefly in episode 24. It's especially useful when you're using an ORM tool like EF or EF Core because not only can you encapsulate filter expressions, but you can also specify which properties to eager load. Thus, you can create a specification for a shopping basket type that might be called BasketWithItemsByCustomerId or something similar. A typical specification I use will include the filter expression (to be used with a Where LINQ expression) and will let me specify which properties and subproperties I want the query to return with it. What are the benefits of using this pattern? First, you eliminate duplication of query logic if you were previously letting client code create queries on the fly. Second, you establish a library of known queries that your development team can review, reuse, and discuss. These should be organized so they're extremely discoverable so there's minimal need to try and reinvent the wheel when someone needs a particular query that already exists. They also help clean up your repositories, eliminating most of the scenarios where you would need non-generic repository methods, and thus dramatically reducing how many repository implementations you need to write and maintain. Your repository code will better follow the Single Responsibility Principle and the Open/Closed Principle, and you won't need a bunch of custom IWhateverRepository interfaces. Finally, you can easily unit test your specifications' filter logic to ensure it's correct and provide examples for the team. Another useful pattern you can use with repository is the proxy or decorator pattern to add caching. I call this the CachedRepository pattern and I've written a number of articles about it. I mention both patterns because they're functionally the same, but differ based on intent. A proxy controls access to something. A decorator adds behavior to something. A CachedRepository controls access to the real, underlying repository, exposing it only when the result isn't in the cache. In this way, it's a proxy. But it also is responsible for adding caching behavior to any repository. In this way, it's a decorator. Either way, it's an extremely useful pattern. Most applications make a lot of queries to their database for results that don't change frequently. A lot of applications use a database to define some or all of their navigation, or the contents of common dropdownlists on forms. These and other common results are great candidates for caching, but often this behavior isn't added because of the work and complexity involved. Adding caching to a method in a data access repository isn't ideal, since it couples two unrelated concerns and breaks the single responsibility principle. It's also not very reusable. A better approach is to create a generic CachedRepository that can be used for any type that would benefit from caching. Determining whether or not to use this caching functionality can be controlled centrally for the application wherever its services are configured. Circling back around to the specification pattern, you can combine it with the CachedRepository to help with key generation. Every cache entry needs to have a unique key, and you need to take care when constructing keys that you take into account any variables or parameters that were used for a particular query. Your specification objects know exactly which parameters they require, and can easily expose a cache key property that can be used by your CachedRepository. You can also add a property to toggle whether certain specifications should be cached at all, if that's helpful. If you'd like to see what this looks like in a simple sample application, check out the eShopOnWeb sample on GitHub. I have a link in the show notes. There's also a free 110-page eBook that goes along with the sample that I encourage you to check out. I developed both the book and the sample for Microsoft as a free resource and they're both up-to-date with .NET Core 2.1 as of July 2018. Do you think your team or application could be improved by better use of design patterns? I offer remote and onsite workshops guaranteed to improve your coding skills and application code quality. Contact me at ardalis.com and let's see how I can help. Show Resources and Links Repository Pattern SOLID Principles Specification Pattern Building a CachedRepository in ASP.NET Core Introducing the CachedRepository Pattern Building a CachedRepository via Strategy Pattern

Anwendungsentwickler-Podcast
Single Responsibility Principle (SRP) – Wissenshäppchen #3

Anwendungsentwickler-Podcast

Play Episode Listen Later Jun 3, 2018 26:46


Mein drittes Wissenshäppchen hat das Single Responsibility Principle zum Thema. Inhalt Das SRP ist das erste der sogenannten SOLID-Prinzipien. Robert „Uncle Bob“ Martin definiert es so: There should never be more than one reason for a class to change. Jede Klasse sollte genau einen einzigen Grund haben, um geändert zu werden. Man kann das Prinzip... Der Beitrag Single Responsibility Principle (SRP) – Wissenshäppchen #3 erschien zuerst auf IT-Berufe-Podcast.

man thema grund prinzip der beitrag single responsibility principle wissensh
Fatal Error
20. Simple Made Easy

Fatal Error

Play Episode Listen Later Mar 6, 2017 31:07


Simple Made Easy by Rich Hickey “Rich Hickey emphasizes simplicity's virtues over easiness', showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path.” Talk Transcript, with slides Fatal Error episode 7: The Single Responsibility Principle Fatal Error episode 15: Not Invented Here Some examples we mention: Object-Relational Mapping vs Key-value Database CocoaPods vs. Carthage Slides mentioned in this post: Development Speed Simplicity Made Easy

object databases slides carthage fatal error cocoapods rich hickey not invented here single responsibility principle simple made easy
Fatal Error
7. The Single Responsibility Principle

Fatal Error

Play Episode Listen Later Oct 24, 2016 36:24


A responsibility is an axis of change — a potential motivation for change. SRP is the S in SOLID Book chapter about SRP from Uncle Bob via Uncle Bob's Principles of Object-Oriented Design Single Responsibility Principle: A Recipe for Great Code SRP in Ruby Off-topic: Falsehoods Programmers Believe About Names A Controller By Any Other Name (Soroush) Episode 2: View Models

single principles solid uncle bob srp soroush single responsibility principle
Q.E.D. Code
QED 16: Elements

Q.E.D. Code

Play Episode Listen Later Aug 14, 2016 17:42


Euclid's Elements takes a disciplined, formal approach to proving assertions based only on simple axiomatic statements. While most of these axioms are elegant, one of them is more complex and wordy. It seems as if it should be provable from the others. Several mathematicians have tried, but eventually they found a surprising result. Beware when proving your own assertions that you don't make the mistake of assuming something that seems obvious. Category theory isn't as complex as you might be lead to believe. A category is nothing more than a contract that sets rules on how a type is to behave. Functors, despite having a weird name, are just types that can map functions into a different space. The List type is an example of a functor, because it can transform a function on its elements into a function on lists. And Applicatives are just wrapper types. They are especially useful for building pipelines. CQRS, Command Query Responsibility Segregation, is a pattern that applies the Single Responsibility Principle to components such that they either change the system (commands), or observe it (queries). Segregation alone gives us the ability to prove some very useful things about a system: safety, determinism, and consistency for example. But it does not prescribe asynchrony or eventual consistency. Those are architectural decisions left to you.

elements cqrs single responsibility principle euclid's elements
All Ruby Podcasts by Devchat.tv
237 RR Rails + JavaScript + Functional Programming with Brad Urani

All Ruby Podcasts by Devchat.tv

Play Episode Listen Later Dec 9, 2015 57:02


Check out JS Remote Conf and All Remote Confs!   02:32 - Brad Urani Introduction Twitter GitHub Blog Procore 04:01 - Immutable/Persistent Data Structures; Advantages Changing the Unchangeable: The Hows and Whys of Immutable Data Structures @ RubyConf 2015 hamster 07:30 - Tools for Debugging 08:23 - Why do Rubyists care about things like Elm? 09:39 - Persistent Data Structure Use Cases; Functional Programming 12:07 - Testability 13:51 - Where does “functional play a role in a typical CRUD app? Active Record, The Single Responsibility Principle (SRP) Callbacks Object-oriented Programming (OOP) “Nouns are objects; verbs are methods” - Corey Haines 22:49 - Coworker Receptiveness of Ruby + JavaScript Style of Programming Codebase Inconsistency? “Merit” 26:41 - Service-oriented Architecture (SOA) vs Monolithic Applications Remote Procedure Calls (RPC) Representational State Transfer (REST) 30:21 - Monoliths as a Necessary Stage in the Development of a Mature Application Elixir The Phoenix Framework ecto 33:23 - The Repository Pattern; Terminology & Naming Patterns of Enterprise Application Architecture by Martin Fowler 37:40 - Structured Query Language (SQL) Avdi Grimm: The Soul of Software @ RubyConf Portugal '15 The Sapir Whorf Hypothesis' Picks Dan Carlin's Hardcore History (Coraline) Stuff You Missed in History Class (Coraline) Buffer (Avdi) New Belgium Brewing Accumulation White IPA (Avdi) Saramonic SmartMixer Professional Recording Stereo Microphone Rig (Chuck) LaunchCode (Brad) Turing's Cathedral: The Origins of the Digital Universe by George Dyson (Coraline) VAT19 (Brad)

Ruby Rogues
237 RR Rails + JavaScript + Functional Programming with Brad Urani

Ruby Rogues

Play Episode Listen Later Dec 9, 2015 57:02


Check out JS Remote Conf and All Remote Confs!   02:32 - Brad Urani Introduction Twitter GitHub Blog Procore 04:01 - Immutable/Persistent Data Structures; Advantages Changing the Unchangeable: The Hows and Whys of Immutable Data Structures @ RubyConf 2015 hamster 07:30 - Tools for Debugging 08:23 - Why do Rubyists care about things like Elm? 09:39 - Persistent Data Structure Use Cases; Functional Programming 12:07 - Testability 13:51 - Where does “functional play a role in a typical CRUD app? Active Record, The Single Responsibility Principle (SRP) Callbacks Object-oriented Programming (OOP) “Nouns are objects; verbs are methods” - Corey Haines 22:49 - Coworker Receptiveness of Ruby + JavaScript Style of Programming Codebase Inconsistency? “Merit” 26:41 - Service-oriented Architecture (SOA) vs Monolithic Applications Remote Procedure Calls (RPC) Representational State Transfer (REST) 30:21 - Monoliths as a Necessary Stage in the Development of a Mature Application Elixir The Phoenix Framework ecto 33:23 - The Repository Pattern; Terminology & Naming Patterns of Enterprise Application Architecture by Martin Fowler 37:40 - Structured Query Language (SQL) Avdi Grimm: The Soul of Software @ RubyConf Portugal '15 The Sapir Whorf Hypothesis' Picks Dan Carlin's Hardcore History (Coraline) Stuff You Missed in History Class (Coraline) Buffer (Avdi) New Belgium Brewing Accumulation White IPA (Avdi) Saramonic SmartMixer Professional Recording Stereo Microphone Rig (Chuck) LaunchCode (Brad) Turing's Cathedral: The Origins of the Digital Universe by George Dyson (Coraline) VAT19 (Brad)

Devchat.tv Master Feed
237 RR Rails + JavaScript + Functional Programming with Brad Urani

Devchat.tv Master Feed

Play Episode Listen Later Dec 9, 2015 57:02


Check out JS Remote Conf and All Remote Confs!   02:32 - Brad Urani Introduction Twitter GitHub Blog Procore 04:01 - Immutable/Persistent Data Structures; Advantages Changing the Unchangeable: The Hows and Whys of Immutable Data Structures @ RubyConf 2015 hamster 07:30 - Tools for Debugging 08:23 - Why do Rubyists care about things like Elm? 09:39 - Persistent Data Structure Use Cases; Functional Programming 12:07 - Testability 13:51 - Where does “functional play a role in a typical CRUD app? Active Record, The Single Responsibility Principle (SRP) Callbacks Object-oriented Programming (OOP) “Nouns are objects; verbs are methods” - Corey Haines 22:49 - Coworker Receptiveness of Ruby + JavaScript Style of Programming Codebase Inconsistency? “Merit” 26:41 - Service-oriented Architecture (SOA) vs Monolithic Applications Remote Procedure Calls (RPC) Representational State Transfer (REST) 30:21 - Monoliths as a Necessary Stage in the Development of a Mature Application Elixir The Phoenix Framework ecto 33:23 - The Repository Pattern; Terminology & Naming Patterns of Enterprise Application Architecture by Martin Fowler 37:40 - Structured Query Language (SQL) Avdi Grimm: The Soul of Software @ RubyConf Portugal '15 The Sapir Whorf Hypothesis' Picks Dan Carlin's Hardcore History (Coraline) Stuff You Missed in History Class (Coraline) Buffer (Avdi) New Belgium Brewing Accumulation White IPA (Avdi) Saramonic SmartMixer Professional Recording Stereo Microphone Rig (Chuck) LaunchCode (Brad) Turing's Cathedral: The Origins of the Digital Universe by George Dyson (Coraline) VAT19 (Brad)

Developer Tea
Single Responsibility Principle: A Class Should Have One, and Only One Reason to Change

Developer Tea

Play Episode Listen Later Aug 3, 2015 9:51


In today's episode I review why focus is so important to coding. Today's episode is presented by DigitalOcean. Go to https://digitalocean.com to get started, and use the promo code DEVELOPER TEA at the checkout after you create your account to get a $10 credit!

class one reason digital ocean developer tea single responsibility principle
Devchat.tv Master Feed
211 RR DCI with Jim Gay

Devchat.tv Master Feed

Play Episode Listen Later Jun 10, 2015 55:50


02:48 - Jim Gay Introduction Twitter GitHub Blog Ruby DSL Handbook 03:43 - Object Design Clean Ruby SOLID Principles 04:39 - DCI (Data, Context, Interaction) Main Resource for DCI (FullOO) 07:20 - What Painpoint DCI Aims to Solve The Gang of Four Book object-composition Mailing List (Google Group) 09:31 - Designing From DCI From the Start (Process) Levels of Use Cases Writing Effective Use Cases by Alistair Cockburn 11:42 - Object Composition Single Responsibility Principle 13:56 - Definitions: Forwarding, Delegation, Consultation, and Inheritance Class-Based Inheritance vs Prototype-Based Inheritance JavaScript Influence 18:37 - DCI and Service Objects Context 24:36 - Roles and Object Factoring Authentication 28:49 - One Context in a Single File surrounded 30:17 - Coupling and Cohesion 31:37 - Typeclasses 33:09 - DCI Criticism casting 36:51 - The Current State of DCI (Skepticism & Criticism?) Domain-Driven Design 38:56 - Preventing Reuse 41:18 - When should you not use DCI? 43:45 - Transition: Using/Undoing DCI (Experimentation) 45:04 - Resources fulloo.info Marvin object-composition Mailing List (Google Group) Clean Ruby More DCI Blog Posts by Jim Delegation Is Everything And Inheritance Does Not Exist Chubby Models Are Still Fat With Concerns. DCI Focuses On How Things Work Together The Gang Of Four Is Wrong And You Don't Understand Delegation Triggering The DCI Context OOP, DCI And Ruby - What Your System Is Vs. What Your System Does 4 Simple Steps - Extending Ruby Objects - The Tip Of The Iceberg With DCI Picks Richard Hamming: You and Your Research (Jessica) Martin Fowler: Yagni (Coraline) Ruby Monday (Saron) JunkFill (Saron) Wappalyzer (Saron) WhatFont (Saron) Julian Feliciano: What Is Source Control? (Saron) Bodum Santos Stovetop Glass Vacuum 34-Ounce Coffee Maker (Avdi) The Master and His Emissary: The Divided Brain and the Making of the Western World by Iain McGilchrist (Jim) request_store_rails (Jim) littleBits (Jim)

All Ruby Podcasts by Devchat.tv
211 RR DCI with Jim Gay

All Ruby Podcasts by Devchat.tv

Play Episode Listen Later Jun 10, 2015 55:50


02:48 - Jim Gay Introduction Twitter GitHub Blog Ruby DSL Handbook 03:43 - Object Design Clean Ruby SOLID Principles 04:39 - DCI (Data, Context, Interaction) Main Resource for DCI (FullOO) 07:20 - What Painpoint DCI Aims to Solve The Gang of Four Book object-composition Mailing List (Google Group) 09:31 - Designing From DCI From the Start (Process) Levels of Use Cases Writing Effective Use Cases by Alistair Cockburn 11:42 - Object Composition Single Responsibility Principle 13:56 - Definitions: Forwarding, Delegation, Consultation, and Inheritance Class-Based Inheritance vs Prototype-Based Inheritance JavaScript Influence 18:37 - DCI and Service Objects Context 24:36 - Roles and Object Factoring Authentication 28:49 - One Context in a Single File surrounded 30:17 - Coupling and Cohesion 31:37 - Typeclasses 33:09 - DCI Criticism casting 36:51 - The Current State of DCI (Skepticism & Criticism?) Domain-Driven Design 38:56 - Preventing Reuse 41:18 - When should you not use DCI? 43:45 - Transition: Using/Undoing DCI (Experimentation) 45:04 - Resources fulloo.info Marvin object-composition Mailing List (Google Group) Clean Ruby More DCI Blog Posts by Jim Delegation Is Everything And Inheritance Does Not Exist Chubby Models Are Still Fat With Concerns. DCI Focuses On How Things Work Together The Gang Of Four Is Wrong And You Don't Understand Delegation Triggering The DCI Context OOP, DCI And Ruby - What Your System Is Vs. What Your System Does 4 Simple Steps - Extending Ruby Objects - The Tip Of The Iceberg With DCI Picks Richard Hamming: You and Your Research (Jessica) Martin Fowler: Yagni (Coraline) Ruby Monday (Saron) JunkFill (Saron) Wappalyzer (Saron) WhatFont (Saron) Julian Feliciano: What Is Source Control? (Saron) Bodum Santos Stovetop Glass Vacuum 34-Ounce Coffee Maker (Avdi) The Master and His Emissary: The Divided Brain and the Making of the Western World by Iain McGilchrist (Jim) request_store_rails (Jim) littleBits (Jim)

Ruby Rogues
211 RR DCI with Jim Gay

Ruby Rogues

Play Episode Listen Later Jun 10, 2015 55:50


02:48 - Jim Gay Introduction Twitter GitHub Blog Ruby DSL Handbook 03:43 - Object Design Clean Ruby SOLID Principles 04:39 - DCI (Data, Context, Interaction) Main Resource for DCI (FullOO) 07:20 - What Painpoint DCI Aims to Solve The Gang of Four Book object-composition Mailing List (Google Group) 09:31 - Designing From DCI From the Start (Process) Levels of Use Cases Writing Effective Use Cases by Alistair Cockburn 11:42 - Object Composition Single Responsibility Principle 13:56 - Definitions: Forwarding, Delegation, Consultation, and Inheritance Class-Based Inheritance vs Prototype-Based Inheritance JavaScript Influence 18:37 - DCI and Service Objects Context 24:36 - Roles and Object Factoring Authentication 28:49 - One Context in a Single File surrounded 30:17 - Coupling and Cohesion 31:37 - Typeclasses 33:09 - DCI Criticism casting 36:51 - The Current State of DCI (Skepticism & Criticism?) Domain-Driven Design 38:56 - Preventing Reuse 41:18 - When should you not use DCI? 43:45 - Transition: Using/Undoing DCI (Experimentation) 45:04 - Resources fulloo.info Marvin object-composition Mailing List (Google Group) Clean Ruby More DCI Blog Posts by Jim Delegation Is Everything And Inheritance Does Not Exist Chubby Models Are Still Fat With Concerns. DCI Focuses On How Things Work Together The Gang Of Four Is Wrong And You Don't Understand Delegation Triggering The DCI Context OOP, DCI And Ruby - What Your System Is Vs. What Your System Does 4 Simple Steps - Extending Ruby Objects - The Tip Of The Iceberg With DCI Picks Richard Hamming: You and Your Research (Jessica) Martin Fowler: Yagni (Coraline) Ruby Monday (Saron) JunkFill (Saron) Wappalyzer (Saron) WhatFont (Saron) Julian Feliciano: What Is Source Control? (Saron) Bodum Santos Stovetop Glass Vacuum 34-Ounce Coffee Maker (Avdi) The Master and His Emissary: The Divided Brain and the Making of the Western World by Iain McGilchrist (Jim) request_store_rails (Jim) littleBits (Jim)

Devchat.tv Master Feed
210 RR Roda and Routing Trees with Jeremy Evans

Devchat.tv Master Feed

Play Episode Listen Later Jun 3, 2015 72:56


Sign up for Ruby Remote Conf!!   02:49 - Jeremy Evans Introduction Twitter GitHub Blog Sequel Ruby Hero Awards 03:58 - Roda and Routing Trees rum Cuba Ruby Rogues Episode #182: Keeping Libraries and Utilities Small and Simple with Michel Martens Plugins: ClassLevelRouting 08:56 - Roda vs Padrino, Sinatra 10:03 - Nested Routing 11:09 - Snipping Routing Trees? MultiRoute 13:19 - Dispatching from One Rack Application to Another 13:54 - Rails Integration 14:33 - Performance and Benchmarking @tenderlove (Aaron Patterson)   nyny r10k bench-micro 17:29 - Streaming reel 19:26 - Support Decisions (Roadmapping) Opal More on Opal: Ruby Rogues Episode #193: The Volt Framework with Ryan Stout tilt The Changelog Episode #154: All Things Ruby with 2015’s Ruby Heroes 22:05 - Plugin Architecture Sequel The Single Responsibility Principle roda/lib/roda/plugins at master 28:00 - Security Ruby Rogues Episode #207: Rebuilding Rails with Noah Gibbs DefaultHeaders 30:17 - Apps That Work Well with Roda and Using Roda 33:16 - Application Freezing 36:12 - Jeremy’s Typical Stack/Workflow 37:30 - When Should You Not Use Roda? 38:39 - Roda Timeline and Roadmap 40:01 - Jeremy’s Work/Life Balance OpenBSD 43:46 - Open Source Getting Paid Picking a Project 49:03 - Application Optimization Big O Notation 57:00 - Routing Approaches The Annotated C++ Reference Manual by Ellis and Stroustrup Picks Self: The Movie; (Avdi) Self and Self: Whys and Wherefores (Avdi) April Fools Video Prank in Math Class (Saron) A pattern language for microservices (Coraline) Wytches (Coraline) Garmin Vivosmart (David) "REDNECK AVENGERS: TULSA NIGHTS" — A Bad Lip Reading of Marvel's The Avengers (David) CodeNewbie Episode #37: From Skates To Code with Aimee Knight (Chuck) This Is Your Life Podcast (Chuck) Cleaning off your desk (Chuck) Ys (Jeremy) minjs (Jeremy) Camp (2013) (Jeremy) 

Ruby Rogues
210 RR Roda and Routing Trees with Jeremy Evans

Ruby Rogues

Play Episode Listen Later Jun 3, 2015 72:56


Sign up for Ruby Remote Conf!!   02:49 - Jeremy Evans Introduction Twitter GitHub Blog Sequel Ruby Hero Awards 03:58 - Roda and Routing Trees rum Cuba Ruby Rogues Episode #182: Keeping Libraries and Utilities Small and Simple with Michel Martens Plugins: ClassLevelRouting 08:56 - Roda vs Padrino, Sinatra 10:03 - Nested Routing 11:09 - Snipping Routing Trees? MultiRoute 13:19 - Dispatching from One Rack Application to Another 13:54 - Rails Integration 14:33 - Performance and Benchmarking @tenderlove (Aaron Patterson)   nyny r10k bench-micro 17:29 - Streaming reel 19:26 - Support Decisions (Roadmapping) Opal More on Opal: Ruby Rogues Episode #193: The Volt Framework with Ryan Stout tilt The Changelog Episode #154: All Things Ruby with 2015’s Ruby Heroes 22:05 - Plugin Architecture Sequel The Single Responsibility Principle roda/lib/roda/plugins at master 28:00 - Security Ruby Rogues Episode #207: Rebuilding Rails with Noah Gibbs DefaultHeaders 30:17 - Apps That Work Well with Roda and Using Roda 33:16 - Application Freezing 36:12 - Jeremy’s Typical Stack/Workflow 37:30 - When Should You Not Use Roda? 38:39 - Roda Timeline and Roadmap 40:01 - Jeremy’s Work/Life Balance OpenBSD 43:46 - Open Source Getting Paid Picking a Project 49:03 - Application Optimization Big O Notation 57:00 - Routing Approaches The Annotated C++ Reference Manual by Ellis and Stroustrup Picks Self: The Movie; (Avdi) Self and Self: Whys and Wherefores (Avdi) April Fools Video Prank in Math Class (Saron) A pattern language for microservices (Coraline) Wytches (Coraline) Garmin Vivosmart (David) "REDNECK AVENGERS: TULSA NIGHTS" — A Bad Lip Reading of Marvel's The Avengers (David) CodeNewbie Episode #37: From Skates To Code with Aimee Knight (Chuck) This Is Your Life Podcast (Chuck) Cleaning off your desk (Chuck) Ys (Jeremy) minjs (Jeremy) Camp (2013) (Jeremy) 

All Ruby Podcasts by Devchat.tv
210 RR Roda and Routing Trees with Jeremy Evans

All Ruby Podcasts by Devchat.tv

Play Episode Listen Later Jun 3, 2015 72:56


Sign up for Ruby Remote Conf!!   02:49 - Jeremy Evans Introduction Twitter GitHub Blog Sequel Ruby Hero Awards 03:58 - Roda and Routing Trees rum Cuba Ruby Rogues Episode #182: Keeping Libraries and Utilities Small and Simple with Michel Martens Plugins: ClassLevelRouting 08:56 - Roda vs Padrino, Sinatra 10:03 - Nested Routing 11:09 - Snipping Routing Trees? MultiRoute 13:19 - Dispatching from One Rack Application to Another 13:54 - Rails Integration 14:33 - Performance and Benchmarking @tenderlove (Aaron Patterson)   nyny r10k bench-micro 17:29 - Streaming reel 19:26 - Support Decisions (Roadmapping) Opal More on Opal: Ruby Rogues Episode #193: The Volt Framework with Ryan Stout tilt The Changelog Episode #154: All Things Ruby with 2015’s Ruby Heroes 22:05 - Plugin Architecture Sequel The Single Responsibility Principle roda/lib/roda/plugins at master 28:00 - Security Ruby Rogues Episode #207: Rebuilding Rails with Noah Gibbs DefaultHeaders 30:17 - Apps That Work Well with Roda and Using Roda 33:16 - Application Freezing 36:12 - Jeremy’s Typical Stack/Workflow 37:30 - When Should You Not Use Roda? 38:39 - Roda Timeline and Roadmap 40:01 - Jeremy’s Work/Life Balance OpenBSD 43:46 - Open Source Getting Paid Picking a Project 49:03 - Application Optimization Big O Notation 57:00 - Routing Approaches The Annotated C++ Reference Manual by Ellis and Stroustrup Picks Self: The Movie; (Avdi) Self and Self: Whys and Wherefores (Avdi) April Fools Video Prank in Math Class (Saron) A pattern language for microservices (Coraline) Wytches (Coraline) Garmin Vivosmart (David) "REDNECK AVENGERS: TULSA NIGHTS" — A Bad Lip Reading of Marvel's The Avengers (David) CodeNewbie Episode #37: From Skates To Code with Aimee Knight (Chuck) This Is Your Life Podcast (Chuck) Cleaning off your desk (Chuck) Ys (Jeremy) minjs (Jeremy) Camp (2013) (Jeremy) 

Ruby Rogues
206 RR Trailblazer with Nick Sutterer

Ruby Rogues

Play Episode Listen Later May 6, 2015 52:14


02:53 - Nick Sutterer Introduction Twitter GitHub Blog Trailblazer: A New Architecture For Rails by Nick Sutterer 03:31 - Trailblazer [GitHub] trailblazer 04:56 - Form Object “Operation” 07:28 - Validations ActiveModel::Validations lotus/validations Introducing Lotus::Validations 08:47 - Decoupling 09:45 - Namespace Reuse Concepts/Concerns 11:50 - Process Method => Procedural Code 12:54 - Inheritance 13:57 - Contracts 14:57 - How is Using Trailblazer Different? 18:17 - What Would DHH Think? 19:32 - Trailblazer as an Extra Layer Single Responsibility Principle Monoliths RailsConf 2015: David Heinemeier Hansson Keynote 27:20 - Testing 28:35 - When Should You NOT Use Trailblazer? 29:53 - Moving to Trailblazer 36:03 - Rails 5 and Trailblazer 37:22 - Maintainers Abdelkader Boudih Celso Fernandes 38:44 - APIs Deserialization 41:04 - Parts of Trailblazer reform roar cells 44:16 - Generators Picks A Gentleman’s Guide To Street Harassment (Saron) Tor and HTTPS (Saron) How it feels to watch a user test your product for the first time (Saron) Humane Development (Coraline) The Left Hand of Darkness (Coraline) Star Wars: Episode VII - The Force Awakens (Chuck) WorkFlowy (Chuck) Ruby Rogues Episode #204: Limerence with Dave Thomas (Chuck) JS Remote Conf Talks (Chuck) Trailblazer: A New Architecture For Rails by Nick Sutterer (Nick) [YouTube] Cinco Face Time Party Snoozer (Nick)

All Ruby Podcasts by Devchat.tv
206 RR Trailblazer with Nick Sutterer

All Ruby Podcasts by Devchat.tv

Play Episode Listen Later May 6, 2015 52:14


02:53 - Nick Sutterer Introduction Twitter GitHub Blog Trailblazer: A New Architecture For Rails by Nick Sutterer 03:31 - Trailblazer [GitHub] trailblazer 04:56 - Form Object “Operation” 07:28 - Validations ActiveModel::Validations lotus/validations Introducing Lotus::Validations 08:47 - Decoupling 09:45 - Namespace Reuse Concepts/Concerns 11:50 - Process Method => Procedural Code 12:54 - Inheritance 13:57 - Contracts 14:57 - How is Using Trailblazer Different? 18:17 - What Would DHH Think? 19:32 - Trailblazer as an Extra Layer Single Responsibility Principle Monoliths RailsConf 2015: David Heinemeier Hansson Keynote 27:20 - Testing 28:35 - When Should You NOT Use Trailblazer? 29:53 - Moving to Trailblazer 36:03 - Rails 5 and Trailblazer 37:22 - Maintainers Abdelkader Boudih Celso Fernandes 38:44 - APIs Deserialization 41:04 - Parts of Trailblazer reform roar cells 44:16 - Generators Picks A Gentleman’s Guide To Street Harassment (Saron) Tor and HTTPS (Saron) How it feels to watch a user test your product for the first time (Saron) Humane Development (Coraline) The Left Hand of Darkness (Coraline) Star Wars: Episode VII - The Force Awakens (Chuck) WorkFlowy (Chuck) Ruby Rogues Episode #204: Limerence with Dave Thomas (Chuck) JS Remote Conf Talks (Chuck) Trailblazer: A New Architecture For Rails by Nick Sutterer (Nick) [YouTube] Cinco Face Time Party Snoozer (Nick)

Devchat.tv Master Feed
206 RR Trailblazer with Nick Sutterer

Devchat.tv Master Feed

Play Episode Listen Later May 6, 2015 52:14


02:53 - Nick Sutterer Introduction Twitter GitHub Blog Trailblazer: A New Architecture For Rails by Nick Sutterer 03:31 - Trailblazer [GitHub] trailblazer 04:56 - Form Object “Operation” 07:28 - Validations ActiveModel::Validations lotus/validations Introducing Lotus::Validations 08:47 - Decoupling 09:45 - Namespace Reuse Concepts/Concerns 11:50 - Process Method => Procedural Code 12:54 - Inheritance 13:57 - Contracts 14:57 - How is Using Trailblazer Different? 18:17 - What Would DHH Think? 19:32 - Trailblazer as an Extra Layer Single Responsibility Principle Monoliths RailsConf 2015: David Heinemeier Hansson Keynote 27:20 - Testing 28:35 - When Should You NOT Use Trailblazer? 29:53 - Moving to Trailblazer 36:03 - Rails 5 and Trailblazer 37:22 - Maintainers Abdelkader Boudih Celso Fernandes 38:44 - APIs Deserialization 41:04 - Parts of Trailblazer reform roar cells 44:16 - Generators Picks A Gentleman’s Guide To Street Harassment (Saron) Tor and HTTPS (Saron) How it feels to watch a user test your product for the first time (Saron) Humane Development (Coraline) The Left Hand of Darkness (Coraline) Star Wars: Episode VII - The Force Awakens (Chuck) WorkFlowy (Chuck) Ruby Rogues Episode #204: Limerence with Dave Thomas (Chuck) JS Remote Conf Talks (Chuck) Trailblazer: A New Architecture For Rails by Nick Sutterer (Nick) [YouTube] Cinco Face Time Party Snoozer (Nick)

Giant Robots Smashing Into Other Giant Robots
10: Isn't the last stage of grieving acceptance?

Giant Robots Smashing Into Other Giant Robots

Play Episode Listen Later Sep 2, 2012 43:03


Ben Orenstein is joined by Joe Ferris and Mike Burns. They start off with some recommendations for awesome programming books and then dive right in to questions about not following "Tell don't ask" in the view, how MVC and the Single Responsibility Principle may be at odds with "Tell don't ask" in the view, and what a more object oriented approach may look like. They also discuss "Class-oriented programming", what it is, why it is bad, how Rails does it, and how to avoid it. They take a quick trip through Mike's experiments in Ruby and Smalltalk in creating his own programming language. The three codecateers then take on the really important topic of method order and code organization, and finally they reflect on how their code has changed over the years, how no solution is foolproof, and how to move to the next level as a programmer. These topics and more, in this installment of the GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS podcast! Structure and Interpretation of Computer Programs MIT course that everyone failed Growing Object-Oriented Software, Guided by Tests Clean Code: A Handbook of Agile Software Craftsmanship Tell Don't Ask Single Responsibility Principle Shotgun Surgery Smalltalk, Squeak Scala, Play framework Follow @thoughtbot, @r00k, @joeferris, @mikeburns on twitter.

Devchat.tv Master Feed
ActiveRecord Observers

Devchat.tv Master Feed

Play Episode Listen Later Sep 7, 2011 7:12


About a month ago, I talked about ActiveRecord Callbacks. Observers are a way of moving callbacks out of the Model. Usually this is done to adhere to the Single Responsibility principle. So, for example, programmers will move sending an email when a record is updated or created to an Observer. class UserObserver < ActiveRecord::Observer def after_create(user) UserMailer.sign_up(user).deliver end end   Observers should be included in your app/models folder and named using the same convention as your models. So in this case, this observer would be saved to /app/models/user_observer.rb. To load the observer in your application, you need to include this line in your config/application.rb config.active_record.observers = :user_observer   Finally, you can observe more than one model with the same observer. class SignUpObserver < ActiveRecord::Observer observer :user, :admin def after_create(user) UserMailer.sign_up(user).deliver end end   I personally like Observers when they help keep you from repeating code or increase code readability. In many cases, I simply keep callbacks in models and violate the Single Responsibility Principle.

model observer observers activerecord single responsibility principle