Design Patterns Revisited in Modern Java by Venkat Subramaniam
Вставка
- Опубліковано 11 жов 2022
- Design Patterns are common ways to solve problems that developers have discovered over time. They often fill the gaps between the language capabilities and the design goals. When languages mature, sometimes patterns become natural features of languages and blend in to the natural way of writing code instead of a special effort. Java has evolved significantly over the years. In this session we'll revisit some common design problems and see how patterns are realized to solve those problems with the modern capabilities in Java.
VENKAT SUBRAMANIAM
Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and an instructional professor at the University of Houston. He has mentored tens of thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences. Venkat helps his clients effectively apply and succeed with agile practices on their software projects.
Venkat is a (co)author of multiple books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer. His latest book is Programming Kotlin: Create Elegant, Expressive, and Performant JVM and Android Applications. Venkat is a well-recognized person in the software communities. He was once a recipient of the MicroSoft MVP award.
He has received JavaOne RockStar award three years in a row and was inducted into the Java Champions program in 2013 for his efforts in motivating and inspiring software developers around the world.
Venkat has been in the training, consulting, and mentoring business since 1996. He is recognized for his pragmatic approach, dislike for accidental complexity, continuous effort to seek minimalistic design, and simpler solutions.
------------------------------------------------------------
INTRO
* visuals & editing by @Mercator
* music : Avocado by Ephixa - Наука та технологія
The boss is back!
Yeah the Master
@@mehmoodrehman6336 😢lææpp
O
0:00 design and design patterns
9:45 Optional - patterns and anti patterns
29:20 Iterator
53:01 Lightweight pattern
1:13:57 Factory method using default methods
1:31:11 laziness using lambda expressions
1:51:31 decorator using lambda expressions
2:10:18 creating fluent interfaces
2:19:16 execute around method
2:30:00 using sealed
Bless your heart
Goated
I have almost 20 years of coding experience, but this talk makes me feel i'm a rookie. Very inspiring!!!
"If I'm stupid I'm gonna find it anyway that I'm stupid. I would rather find it out sonner than later"
- Venkat
18:20
This conference is a gem! I highly recommend watching it from start to finish.
Thank you for the kind words ❤️
When you ask a scrum master to write a piece of code, he will write it like a story😀. Awesome presentation by Venkat.
This is pure stand-up java
And I love ❤ it
Venkat the beast!
What a talk.. as usual very informative. All these topics are mindset shift when it comes to design
This talk is pure awesomeness! That Decorator pattern with lambda was something I really needed in my current project. Thank you so much for explaining it so wonderfully. 😊
As always a gorgeous essence of wisdom seasoned with a bit of humor.
This conference has inspired and influenced me on so many levels. From his overwhelming knowledge (which smells like thousands of experiences) to the elegant use of a text editor without the support of an ide
Spectacular
Yeah and inaccurate typing with constant going back with delete and retype.
If you can't type fast and accurate, type slower.
Old developers are actually Quite comfortable in Writing code in notepads.
This guys is simply amazing. More I listen to him more I understand the programming.
Dr. Venkat is awesome! I always enjoy watching his presentations! 🙂
Thank you. Always love his lectures.
What a storyteller ❤️❤️❤️
This was very helpful Venkat. Thank you. It's gonna take me a while to get comfortable with the patterns described here. The decorator pattern and the way you use consumer are very interesting. Also, now I finally understand Lazy loading a little better.
I liked before and after I can watch !
This is the first educational video where I haven't felt sleepy
Venkat The rising star ⭐⭐⭐⭐
All your examples are so relatable to my curr project that applying ruby code style in java
that Execute around method is really something cool to use. Also loved the decorator example. great talk
You're just amazing sir, especially for the one with low financial situation like me.
Found this extremely helpful to understand what and why we use design patterns ! Well explained
Great session..thanks for uploading
Arrive to the meaningful patterns via gradual refactoring.
Build mindset as thinking of patterns as `a communication tool rather than a design tool`.
Think in pattern.
Evolve with pattern.
Do not try to patch code with patterns.
Patterns should be a part of a well designed programming language.
We are already using it in frameworks.
Well designed code should read like a story.
It should not be a puzzle.
Patterns should help write a good story that should be easy to read.
Code should convey the intention clearly and easily.
Code should revel what it's doing simply without making readers think twice.
Code should be empathetic to the readers.
Null is smell. Return a value.
Fail at compile time, not at runtime.
Understand mutability.
Practice Pure Function.
Do NOT mutate data.
Return a value.
A function must be idempotent.
Idempotent: A property of some operations such that no matter how many times you execute them, you achieve the same result.
Pure functions are the core of Functional Programming.
Object-oriented Programming when done correctly, strictly, exercises pure function in a Class method.
Minimize verbosity.
Manage the level of verbosity.
Too verbose is not good because it take more time read, think about it and understand.
Never trust feature called "Management". 😂
Subramaniam has a unique talent for explaining difficult subtleties with very simple examples.
I thought I would never use the decorator pattern. But after seeing this new approach, who knows :)
what a great "hand on" session. it is way better than a powerpoint presentation. thank you very much. ( NOT: Levent Kırca'dan Java dersi almadım da demem şu hayatta. )
I love the opening. Just because you have the recipe doesn't mean the outcome is automatically good.
great presentation! I always wondering what Venkat does use as checklist presentation?, it looks pretty geek to get a check list in plain-text :).
Well talk
Final preparation
Universal Java boss
Great presentation. Does any know details about his dev setup?
I love it ❣️
21:00, The method name is `orElseThrow()`.
I like this guy
he's my favorite java talking guy
Coding on vim without treesitter and lsp, is such a chad way to flex!!! Great talk BTW.
🙏🙏🙏🙏🙏 Enlightened🙏🙏🙏🙏
very good session
Thanks, great talk. Though not really sure about labeling code verbosity as a disadvantage.
Really nice
Awesome........😀
15:18 Not sure if iam thinking rit!. Whats the difference checking an object for null and checking optional.isPresent() ??
great perspectives and awesome jokes!!
I wonder if there is a similar talk with Javascript/Typescript?
Which Laptop he is using Macbook Pro 14 or 16" ?
good job!
Thanks for the awesome and informative presentation.
I am trying to understand one of the points mentioned in the presentation though. Would be great if someone can help me understand that.
"If the Language is powerless design patterns help to fill in the gap" - What does this statement mean? On the contrary, I have always seen Java use a lot of design patterns internally in their implementation for making the developer's life easy. So if I understand Venkat's statement correctly, may be it means that the language should take the responsibility of implementing design patterns wherever necessary to make the Dev's life easy?
it just means that there is an "intended/optimal" use for every programming language which should be intuitive to developers based on how the programming language usage and syntax. However, sometimes the "optimal" way is not obvious at first glance. Design patterns are just tools to nudge programmers in the correct direction in this regard.
The programming language obviously used design patterns internally, but these are often abstracted away when the developer uses it. Most developers don't need to sit and ponder on why constructors work the way they do or what design principle was used to implement the collections framework. Hence, Venkat has probably made the separation between programming language and collections.
Regarding Optional, I like having getters and finders. findName searches for name and will return Optional. getName will fetch it and return the name, thowing a clear exception if name is not available.
I use same approach 👍
Thank you for sharing this, I was not able to attend.
Execute around method sounds very similar to Context manager in python
19:24 or read Alexsi Kings's article: Parse, don’t validate
An optional collection does make sense., 'I don't know' is different from 'I know there are zero items'. Arguably better to return a tuple of a success status and a collection, but in functional terms this is a status (might be fail or 'don't know at the moment') OR a collection, and pattern match on the type (or enum variant).
True true
My frienddddd
2:08:03 He should have used reduce(BinaryOperator) instead. Every invocation of snap(Color) passes through the useless identity function.
Awesome:
compute(value) // do it now, (eager)
() -> compute(value) // do it later (lazy using supplier)
The Weapon of Devoxx
Can we get a C++ version of this guy?
What kind of IDE he are using?
he uses TextMate with scripts, refer his website.
Me hearing "you really want to avoid null" looking at my code, 90% of my fields have null at some point practially any none native field to say. :< ...should I be concerned about that?
Once you hear Christopher Walken, you can't unhear it.
50:00
The only purpose of Stream.forEach is side effects. That's why we lint it out of our codebases.
13:38 - Typo Option, It should be Optional. Other than this, the importance of Optional types very well explained.
was here
Defensive Design is cheap for the organization in short term perspective but expensive and counterintuitive in long term perspective ⇒ Architect 📛
Defensive Programming is cheap for the organization in short term perspective but expensive in long term perspective ⇒ Developer 📛
Offensive Design is expensive for the organization in short term perspective but cheap in long term perspective ⇒ Architect ✅
Offensive Programming is expensive for the organization in short term perspective but cheap in long term perspective ⇒ Developer ✅
Boss
get on optional should have been private😅
2.5 hours?!
Strange, like every other talk by VS in you tube, no one asked here in comments,
WHICH EDITOR VS IS USING.
😂😂😂😂😂
I’ve missed his grammatically incorrect “isn’t it”
Great information. But with a small gripe. A lot of chatter/ too verbose. Could’ve avoided all that typing and miss typing if came prepared with a slide. Also it’s not hard to simulate a shared mutability scenario. Why not jus demonstrate it and show the problem. It’s some pain to go thru these long videos. Could’ve have been half of it!!
26:00 Heavily disagree with overloading for optional parameters. Don't do this.
what's your suggestion?
@Arsenal K Is my comment from 8 days ago not visible?
@@31redorange08 nope.
Some people can never be helped 😅🤣
moustache is lazily evaluated on his face seems
Having coded Java for 9+ years (and some JS as well) and recently started learning Kotlin, all I can say is more devs should start using Kotlin instead of Java, at least for new apps. Java feels too bloated, and sorry to say that there is nothing modern about the recent Java versions.
you should listen to a few talks about java architects. java does not want to be "latest and coolest", it wants to be stable and _good_. I've been coding in java for the past 15 years, am an active open source contributor and somehow I still find Kotlin "not my language". perspective matters .
Another boring Vim. What do those people find in Vim... no colors, distracting background, no automcomplete
Clearly you are not the audience.. nor are you going to learn Java. You want colors, go to some art class.
many many words and the complete lack of new ideas for 2023. it's a boring video 🙄
Really ??????? Are you serious ?
@@springboot-devops Yes, unfortunately. 😉
My ears bleed listening to that ascent!
The fact that he writes notes and code in Nano text editor amazed me
I think its vim
A zip? Dude we need GitHub repo
I have a similar time bomb example, we have a treemap used somewhere in the code(10-12 years before written) and the place is not guarded for concurrency and randomly cpu spikes up, now i am finding hard time to convince the developer that it is this piece of code that is causing issue, - verified with visualvm, dynatrace. sample place