Robert C Martin - The Single Responsibility Principle

  Рет қаралды 102,886

gnbitcom

gnbitcom

10 жыл бұрын

Пікірлер: 81
@DanielRamBeats
@DanielRamBeats 8 жыл бұрын
I really appreciate his talks.. The fact he doesn't need slides or examples and can conceptually engage you in re-thinking design patterns is amazing.
@joebenge7420
@joebenge7420 7 жыл бұрын
Problem with S.O.L.I.D is everyone who teaches it uses abstract examples: "Person", "Animal", "Employee", etc. These relations are obvious to anyone, but not all programming relations are as intuitively recognized. I think people should start using examples from real world applications. Show pseudo-code of a theoretical power-point application, sales system, photoshop. Yes, showing OOP is easy when using things we already recognize as physical "objects", but this get much more complex in applications.
@stefammagnumfernandesdemen4942
@stefammagnumfernandesdemen4942 6 жыл бұрын
Joe Benge Start applying this principle in simple modules, then you'll start to understand on how to apply in complex modules. Please, don't get me wrong, this is a tip and the way I followed.
@johnnyLikeVideo
@johnnyLikeVideo 6 жыл бұрын
Yes, but we need someone to show us a big project sometimes to see it actually done.
@ItsAStuckPixel
@ItsAStuckPixel 6 жыл бұрын
its done in the same way. simple or complex, the principle is the same... especially single responsibility.
@caesarbala
@caesarbala 5 жыл бұрын
Agree to you try to watch learn code solid principles of Bob paid courses but totally worth
@mescellaneous
@mescellaneous 5 жыл бұрын
what is an acronym? it's a brand, it's catchy, it seems to have huge meaning packed into it because each letter is actually a word, woah! SOLID is like someone giving one whole talk on "balance". would you watch a lecture on someone telling you how he is able to stand on one leg for a long period of time? how many lectures do you have to watch before you begin actually practicing balancing? can anyone teach you how to balance in a day? or is it a continual exercise that you get better and better at? are there rules to balancing? sure you have to understand about gravity and maybe intuitively about fulcrum. but you learn by doing it. all of his talks are effectively useless, he's just riding his clean code book. you dont watch bill nye to learn physics, so you shouldnt watch bob martin to learn to code. if you want to watch to learn, you watch someone who actually codes and is in practice. i highly suspect this guy is out of practice. i deplore this bob martin man, specifically because he has so LITTLE to say. but what can you do, right? there are kids and sometimes kids want to watch clowns. and who is going to ban that?
@ChristianLeovido
@ChristianLeovido 3 жыл бұрын
0:00 - Ice breaker - Entropy 6:14 - SRP, Views and SQL, Why separate things? 8:50 - Report generator example 11:41 - Responsibility for one person 13:14 - Mixing HTML and SQL example 14:13 - One change affecting other code 16:17 - Rigidity 17:20 - How can you separate the changes? 17:40 - Employee example 19:37 - Deceptive module; modules should know less about business objects 21:21 - Separate into smaller classes 21:50 - Roman numerals kata, TDD feels slow; comparison using TDD vs. no TDD 26:25 - Separate into smaller classes 30:05 - How many methods should a class have? 30:45 - The database is a detail; should be replaceable; our modules shouldn't care is we use SQL, NOSQL 34:41 - Business rules shouldn't belong on the database 36:10 - Symptoms of bad system design 38:10 - Forced to change in many places 39:25 - Fragility, touch a module and everything works, in a different part 43:00 - Mastermind 45:05 - Responsibilities breakdown 49:00 - Separating is hard 49:20 - Refactoring 50:30 - Separating code should be the last operation
@shairongodly3815
@shairongodly3815 3 жыл бұрын
Thank you!
@PeterHeard
@PeterHeard 9 жыл бұрын
Awesome!
@habibmammadov7213
@habibmammadov7213 5 жыл бұрын
Great talks !
@kamillatosinski3054
@kamillatosinski3054 5 жыл бұрын
My code at work is in maximum enthropy
@Newtube_Channel
@Newtube_Channel 3 жыл бұрын
It's not. It's in equilibrium until someone decides to come in and change it, be it a customer or whoever else.
@grumly85
@grumly85 2 жыл бұрын
You wish it'd be. Until someone else changes it. 😬
@pazuzutru-truluv7094
@pazuzutru-truluv7094 4 жыл бұрын
This sounds so much like Viewpoint analysis by Fukes and Finklestien back in the 80s
@VladimirMinkin
@VladimirMinkin 3 жыл бұрын
If every programmer (especially the one who called himself software architect) at least watched this lecture or better read his book (better first book on that path) before they started develop complex system how good life might be. Thanks for sharing!
@daniels3980
@daniels3980 Жыл бұрын
Not all at, it would just raise the bar and then we would have to really up our game to be the top income brackets. Luckily, as long as management focuses on going fast above all else, we won't have to worry about it.
@VladimirMinkin
@VladimirMinkin Жыл бұрын
@@daniels3980 Sometimes going fast depends on stability of the system.
@seemapradhan6970
@seemapradhan6970 6 жыл бұрын
One question related to identifying the people requesting the change. Where does the request for changes for Save() and FindByID() originate from? Sometimes new features introduce database schema changes. Sometimes performance optimization results in schema changes. Would it be correct to mention DBA as the source for change? Origin in the former case is end-user whereas in the latter, it is test team...
@LogicPhalanx
@LogicPhalanx 8 жыл бұрын
Uncle Bob is so funny
@eddydelvalle3713
@eddydelvalle3713 7 жыл бұрын
And so serious... hahaha
@AdrianCockburn
@AdrianCockburn 5 жыл бұрын
If you could save yourself, you'd save us all!
@turbulentgazelle6276
@turbulentgazelle6276 5 жыл бұрын
Heads up and tails down are the same thing right?
@graemejob1613
@graemejob1613 5 жыл бұрын
I caught that as well. I thought he was starting out on a trick question!
@georged8644
@georged8644 3 жыл бұрын
Physics isn't exactly his strong suit even though he wastes several minutes of every lecture he gives on it.
@Newtube_Channel
@Newtube_Channel 3 жыл бұрын
Wat?
@carsonholloway
@carsonholloway 3 жыл бұрын
So the answer should be 1000
@BryonLape
@BryonLape 3 жыл бұрын
I've written many .Net applications that used Oracle for the database.
@paulfrischknecht3999
@paulfrischknecht3999 Жыл бұрын
Transactions really break the "my application doesn't know it's a (sql) database"... You can definitely isolate very well against the relational model in sql, but I have not found a good way to let an application rely on transactionality of db modifications when the db is not actually transactional...
@Strategiusz
@Strategiusz 5 жыл бұрын
Calling this Single Resposibility Principle instead of Single Role Principle is a billion dollar mistake.
@ishcatu
@ishcatu 4 жыл бұрын
This. It's about a unique role and about a responsibility towards a user/code group (this agreeing united user/code group should be the one and only reason to change) and not about inner responsibility (cohesion) and Uncle Bob writes about this greatest misunderstanding of the principles in his book "Clean Architecture". Even a simple primitive constant can violate the SRP if it's used by disagreeing user/code groups instead of playing just one role.
@BryonLape
@BryonLape 3 жыл бұрын
Heads up and tails down is the same state.
@magniffsdigitaldevices2153
@magniffsdigitaldevices2153 3 жыл бұрын
Hm, it seems that Mr. Martins understanding of entropy is a bit messed up as he said, that going back in time we should expect the Universe be in a higher entropy state. It is opposite, isnt it? Anyway, great talk.
@Newtube_Channel
@Newtube_Channel 3 жыл бұрын
The universe had a higher entropy in the past. It had a warmer temperature and also much smaller in size.
@grygoriymelnyk4533
@grygoriymelnyk4533 7 жыл бұрын
He will never reveal an SRP solutions that appears in 26:10 :-)
@thomaswarner8884
@thomaswarner8884 7 жыл бұрын
Some nasty bug was attracted to SRP @35:26 : ) Did you try to squash it ?
@yogeshkurane123
@yogeshkurane123 3 жыл бұрын
What ?
@ChristopherJohnsonIsAwesome
@ChristopherJohnsonIsAwesome 7 жыл бұрын
This is great but I'd rather see a more practical example of someone applying this logic. Does anyone have a suggestion?
@thomaswarner8884
@thomaswarner8884 7 жыл бұрын
If ever you work for public services in Europe you'll get multiple full scale examples !
@ropro9817
@ropro9817 7 жыл бұрын
Lol, I love Uncle Bob, but why does he always start off his talks about completely random physics topics? :)
@h8h892
@h8h892 5 жыл бұрын
Because he wants to remember us of the logic of physics and the importance of science. It let the smart persons say what if we add some science as an accelerator for programming? Stupid persons say I just don't get it :)
@tubeyoupmj7
@tubeyoupmj7 3 жыл бұрын
Because people are sometimes late, so he warms things up with a brief, interesting story before getting to the main talk.
@NicholsonLifting
@NicholsonLifting 8 жыл бұрын
So, I generally love Uncle Bob (I have purchased all of his books), but this talk was pretty terrible. First quarter wasted to a discussion of physics, after that he is getting somewhere with a concrete example that he is about to show possible solutions for when all of a sudden he cuts off and starts talking about TDD and Katas and then he never gives any resolution to the example. I am a new developer and I would have really benefited if he actually showed some concrete solutions. I can infer what they should be, but what if my intuition is wrong and leads to bad code? I just want to know how he would have refactored the employee class...
@DanielRamBeats
@DanielRamBeats 8 жыл бұрын
+NicholsonLifting there can't really be a concrete example because there are too many. It's not really like an equation, it's more like a philosophy. You have to change the way you think about building systems so no thing is solely dependant on another class, rather you have either an interface or a generic class that facilitates the request. Example: USB is an interface, but can can have many uses. I hope that makes sense!
@ropro9817
@ropro9817 7 жыл бұрын
+NicholsonLifting, I totally agree! I love Uncle Bob, but this is the 5th talk of his that I've watched now, where he opens with an extremely long-winded and unrelated talk about physics! If I wanted to learn about physics, I'd go watch a Neil Degrasse Tyson or Lawrence Krauss talk.
@user-baev
@user-baev 7 жыл бұрын
That's the reason classes and systems become harder to maintain and why programming is so hard. Martin gave exactly what needs to understand the basic principle, his intro wasn't out of place, it was perfectly fit into its purpose. And yet you're asking for concrete example or concrete implementation. Use abstract thinking. Or any thinking. Also, intro wasn't about physics. It was about programming industry. It was about computer programs. It was about single responsibility principle.
@gamemusicmeltingpot2192
@gamemusicmeltingpot2192 3 жыл бұрын
@@ropro9817 hows it long winded it is 6 / 50 min talk its supposed to draw the viewers in and its for the live audience not you, you can skip past it
@georged8644
@georged8644 3 жыл бұрын
Single Responsibility Principle - Talk about software design, and not physics, in a lecture about software design.
@aleksandrsavvopulo4510
@aleksandrsavvopulo4510 Жыл бұрын
btw, tdd does not fit startups. its a madness to use tdd when you have short iterations and requirements changing often.
@adm3333
@adm3333 Жыл бұрын
This is completely and totally false. Requirements changing often means you'll be refactoring often, which means you need very strong unit tests, which means using TDD.
@aleksandrsavvopulo4510
@aleksandrsavvopulo4510 Жыл бұрын
@@adm3333 tests adds at least 30% of efforts to the development. You dont need 100% coverage at start. So cheaper solution would be e2e. That will give some guarantee that main functionality works. And that much much cheaper than tdd. Tdd in most cases is overkill.
@adm3333
@adm3333 Жыл бұрын
@@aleksandrsavvopulo4510 I suspect that you have a different definition of unit test. If your idea of a unit testing includes rampant mocking of internal dependencies and directly testing code in modules other than through entry points, then yeah, those tests suck, but they suck regardless of whether you're a startup or not. Proper module-level TDD unit tests are cheaper than E2E tests and more useful to catching bugs quickly.
@aleksandrsavvopulo4510
@aleksandrsavvopulo4510 Жыл бұрын
@@adm3333 Lets clarify things a bit using a fake example. Imagine you have to test user registration case. A positive one. To check controller/service/db layer it is enough to implement one e2e/integrational test case. How many unit tests should be implemented for this scenario? I can assume at least 3.
@hijarian
@hijarian Жыл бұрын
@@aleksandrsavvopulo4510 At the point where you need to test a "user registration case" with three layers, in a proper TDD you'd already have a whole suite of unit tests covering all of controller, service and DB connection code. You would literally not be able to arrive at the 3-layer code architecture without writing all of them. Given all these tests already in place, functional test covering a "user registration" will be pretty straightforward to write and it will not be a *unit* test anyway. TDD assumes completely different kind of automatic tests from what you have in mind based on your comments above.
@ChrisSeltzer
@ChrisSeltzer 7 жыл бұрын
I know he's revered in the community but I find his presentation style unbearable.
@Fizzgg
@Fizzgg 7 жыл бұрын
Agree, there's too much filler. He spends 20 mins making the exact same point. This whole talk could be condensed down to 15 mins or less.
@Newtube_Channel
@Newtube_Channel 3 жыл бұрын
@@BBB-zy6er But you don't get redundancy in a lecture. This is a just a semi-casual talk, relax.
@Newtube_Channel
@Newtube_Channel 3 жыл бұрын
@@BBB-zy6er The aim of a lecture is usually to deliver the maximum amount of info in the shortest amount of time. This isn't a lecture.
@AndyThomasStaff
@AndyThomasStaff 7 жыл бұрын
How not to give a presentation 101. Skip to 17:05, watch 1 minute, then delete this video. Trust me, there's nothing else valuable in here.
@kristupasantanavicius9093
@kristupasantanavicius9093 7 жыл бұрын
Really? I watched few of his talks and they are entertaining and informative at the same time. Perfect for after work.
@mescellaneous
@mescellaneous 5 жыл бұрын
i have been watching his talks and it's all junk. yes, he isn't promoting bad advice per se, but he doesn't really give solid practical advice either. and his talks are usually filled with fluff. he's an out of practice programmer giving talks because there is demand for him. i am surprised how he made a career out of this, his book must have built a huge cult following. i actually like his history/science tangents and how they are great analogies to software, but without doing any new work, he is just a puppet spewing something you can find on wikipedia. except he will draw it out and make it sound profound because he has nothing else to work with.
@vivekvitthalraopatil2775
@vivekvitthalraopatil2775 3 жыл бұрын
@@mescellaneous Damn, you salty
@MercedeX7
@MercedeX7 9 жыл бұрын
First 16 minutes when he was rambling about the coin flipping which had absolutely nothing to do with the topic. nor did he try to relate that discussion to the topic. Secondly, real life software development s much different and under strict constraints than what he perceives it to be. It's good that a function or module should do only 1 task or related tasks but applying the same theory to a function read it programmers.stackexchange.com/questions/275646/is-the-single-responsibility-principle-applicable-to-functions
@shipper66
@shipper66 9 жыл бұрын
spot on! I
@andurilan
@andurilan 9 жыл бұрын
Mercede Have you ever worked in a "real life software development" environment? It's a nightmare PRECISELY because firms don't follow the SOLID principle. Have you ever had to maintain spaghetti code 10-100k lines long where classes and functions and methods have multiple responsibilities, arcane couplings, spooky actions from a distance, etc. Let alone having to hunt down dependencies hacked together for the wont of C-level managers. My guess is if you have, and support it, you are glutton for punishment, or dont value your time. Keep in mind he is also one of the original creators of AGILE development and a HUGE proponent of FP, which uses only functions instead of objects to implement logic.
@vibovitold
@vibovitold 8 жыл бұрын
Mercede there can always be too much of a good thing, SRP is no different. but personally i prefer to err on the side of SRP and related principles, and i wish other developers had the same approach. btw "Uncle Bob" isn't some sort of an academic theoretician as you seem to imply, given his bio it's safe to assume he knows a thing or two about "real life software development"
@LogicPhalanx
@LogicPhalanx 8 жыл бұрын
The intro had everything to do with the topic at hand. I knew exactly where he was going with it right away. If you've ever worked on a team that pays no mind to SRP you find yourself working within a code base at maximum entropy. It's a beautiful analogy.
@techotopo
@techotopo 6 жыл бұрын
bla bla bla, rant, rant, who are you?
Robert C Martin - Clean Architecture and Design
58:39
gnbitcom
Рет қаралды 269 М.
The Scribe's Oath • Robert "Uncle Bob" Martin • GOTO 2017
59:15
GOTO Conferences
Рет қаралды 161 М.
ONE MORE SUBSCRIBER FOR 4 MILLION!
00:28
Horror Skunx
Рет қаралды 49 МЛН
ISSEI funny story 😂😂😂Strange World 🌏 Green
00:27
ISSEI / いっせい
Рет қаралды 84 МЛН
Final muy inesperado 😨
01:00
Juan De Dios Pantoja
Рет қаралды 49 МЛН
Ultimate Golang Developer Roadmap 2024 🚀
11:46
practicego
Рет қаралды 15 М.
Jim Coplien and Bob Martin Debate TDD
20:59
toalexsmail
Рет қаралды 156 М.
"Uncle" Bob Martin
1:23:35
Program on Entrepreneurship
Рет қаралды 167 М.
ESTOICISMO ROMANO- Epicteto, Séneca y Marco Aurelio. VERITAS DEI
40:28
VOZPENSANTE - THINKINGVOICE
Рет қаралды 507
Frederick Brooks' The Mythical Man Month
44:32
gnbitcom
Рет қаралды 26 М.
LOL SHOPPING IN THE TERMINAL
TJ DeVries
Рет қаралды 69
"Uncle" Bob Martin - "The Future of Programming"
1:18:21
Paul Stringer's Mobile Tech
Рет қаралды 1,7 МЛН
Concurrency is not Parallelism by Rob Pike
31:22
gnbitcom
Рет қаралды 115 М.
ONE MORE SUBSCRIBER FOR 4 MILLION!
00:28
Horror Skunx
Рет қаралды 49 МЛН