JEP Explained. JEP 482: Flexible Constructor Bodies

  Рет қаралды 3,745

IntelliJ IDEA, a JetBrains IDE

IntelliJ IDEA, a JetBrains IDE

Күн бұрын

Пікірлер: 15
@wandacode
@wandacode 2 ай бұрын
Dr Venkat is the only one that can give a video for IntelliJ Idea using VIM.
@nagamohank2244
@nagamohank2244 2 ай бұрын
❤ the great explanation of the features by Venkat. As usual enthusiastic and fun filled Venkat along with Mala.
@ITV-ITV-
@ITV-ITV- 2 ай бұрын
So... this allows for breaking SRP in class constructors and defeating the need for Factory pattern in exchange for the extra job for compiler engineers (extra checks for the call to super())? 🤔
@Poisonedyouth79
@Poisonedyouth79 2 ай бұрын
Perfect explanation ❤
@wazeeharaa8100
@wazeeharaa8100 2 ай бұрын
This is awesome!
@ahmedurmiteahmedurmite3711
@ahmedurmiteahmedurmite3711 2 ай бұрын
Subramaniam the best 🏆thank you
@iscjorgerg
@iscjorgerg 2 ай бұрын
Great interview Congratulations Mala
@sphesihlemanuel2933
@sphesihlemanuel2933 2 ай бұрын
How does my legend use vim, without any syntax highlighting needs to be investigated😭
@Quillraven
@Quillraven 2 ай бұрын
most likely it is faster for demonstration purposes and not so "bloated". I personally liked his way of presentation a lot and was not hard to follow the code (coming from a JetBrains fanboy ;) ).
@JPilsonSumbo
@JPilsonSumbo 2 ай бұрын
Well explained
@Quillraven
@Quillraven 2 ай бұрын
Just watched the first 10 minutes but isn't it anyway a bad practice to throw exceptions in your constructor? Just add a factory method, do the validations first and only if successful create a valid instance of your object. At least that is how I (and many others out there) solve it. edit: presentation was excellent though for this part ❤
@benfowlie5147
@benfowlie5147 2 ай бұрын
Short answer, it depends. If there is no object hierarchy, then that is the way to go according to Effective Java. But when there is a hierarchy with validation at every level, then this way leads to duplication of the validation logic, a static factory method cannot call another static factory method to initialize the parent objects. It's better to throw from a constructor than to initiate an invalid state.
@Quillraven
@Quillraven 2 ай бұрын
@@benfowlie5147 hm okay, I guess I never faced this scenario because I try to avoid extending classes if possible. I have seen too many codebases where a class inherits from an abstract class which again inherits from an abstract class, etc., etc. and you end up with 3+ levels of a hierarchy where noone understands anymore what is happening where and what happens when you touch a function of one of the "middle" classes. However, I get your point but still I personally find it confusing that a "new ObjectXYZ()" will throw an exception. Anyway, there are so many different scenarios out there and I can imagine that in some of them this might be the best solution. So, thanks for the input :)
@pavelpetrashov2975
@pavelpetrashov2975 2 ай бұрын
What is going on with Java? Please, stop doing it! I am sure an army of smart developers are going to use this doomy "feature" and this "relaxing" is going to turn many projects into a garbage. Please, don't do have logic in yhe constructor! Just duplicate you validation method if you need it will be even better (not it will be still wrong) than this "feature"
@Alperic27
@Alperic27 Ай бұрын
geez his speach pattern is soooo painful to listen to… 🤦‍♂️🤦‍♂️🤦‍♂️
JEP Explained. JEP 455: Primitive Types in Patterns, instanceof, and switch
47:37
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 2,5 М.
JEP Explained. JEP 469: Vector API
36:02
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 1,5 М.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 98 МЛН
Бенчик, пора купаться! 🛁 #бенчик #арти #симбочка
00:34
Симбочка Пимпочка
Рет қаралды 4 МЛН
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 14 МЛН
JEP Explained. JEP 476: Module Import Declarations
30:57
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 1 М.
JEP Explained. JEP 474 - ZGC: Generational Mode by Default
42:45
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 924
JEP Explained. JEP 473: Stream Gatherers
1:10:49
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 1,1 М.
Valhalla - Where Are We? #JVMLS
51:07
Java
Рет қаралды 24 М.
Know your Java? by Venkat Subramaniam
37:41
Devoxx
Рет қаралды 18 М.
Someone improved my code by 40,832,277,770%
28:47
Stand-up Maths
Рет қаралды 2,6 МЛН
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Reacting to Controversial Opinions of Software Engineers
9:18
Fireship
Рет қаралды 2,1 МЛН