Common Java Skill : Multiple Return Values like Go 🚀 |

  Рет қаралды 20,621

Java Techie

Java Techie

Күн бұрын

Пікірлер: 73
@ascar66
@ascar66 2 ай бұрын
We used to create our own pair classes to use in project. Now it's cool to have ready to use libs. Thank Techie
@gopisambasivarao5282
@gopisambasivarao5282 2 ай бұрын
Appreciate your efforts Basant! God Bless you!🙏👍
@manoganesan7618
@manoganesan7618 2 ай бұрын
I have implemented this concept in one of our existing methods after watching your video. You are awesome!
@soto5987
@soto5987 2 ай бұрын
Please do not use this, the readability is so much lower. Multiple return values are a sign of too much responsibility or a lack of domain understanding. We create on purpose objects that hold values to communicate intend or coupling. In Go we use them to return value, error that is a totally different approach.
@abhiroopghatak9442
@abhiroopghatak9442 2 ай бұрын
*it is very useful but not for domain object ........but think it returns domainObject and possible exception object... and receiver will have either successful response from service or its internal exception which it need to refine more before showing to user. Pair
@smacdonald2012
@smacdonald2012 2 ай бұрын
Return a list of POJOs. Another way to implement this. Like in all languages, different ways to perform such tasks.
@jaganathanmurthy6861
@jaganathanmurthy6861 2 ай бұрын
Thanks buddy. Every time i got a notification from you , got curious to learn new thing to build my carrier growth.
@devaamujuri5998
@devaamujuri5998 2 ай бұрын
Hi Basant, I need some suggestion regarding one of the requirement. I need to reterieve the data one of the database table, it has morethan 3 lakhs records (for first time), 1. I need to call some 3rd party API for each rows and get some relavent details from API resonse and then I need to update same row with other 2 fields. So how we can handle entire thing in same request and wtih in same end point. (bascially retreive data, do same change in row, update same row for those many records). 2. This can be run on weekly batch. ( may be first time 3lakh records, later batch run it might be less), based on flag in DB column we can identify allread processed or not processed rows.
@Javatechie
@Javatechie 2 ай бұрын
Please drop an email to javatechie4u@gmail.com and elaborate your usecase little bit
@gouravkumar-or6jy
@gouravkumar-or6jy 2 ай бұрын
Thanks sir to share this knowledge 🙏, even though i used Pair class many times in my code.
@maheshwer007
@maheshwer007 2 ай бұрын
We can use pojo class instead, which would be more cleaner and easy to understand approach, this approach creates confusion for new devs
@samsneera
@samsneera 2 ай бұрын
How will this be useful if the number of objects to be returned are more than three? Considering readability and convenience, this feature looks good. As per my understanding, we can come up with our custom class containing these multiple records to be returned.
@saim7281
@saim7281 2 ай бұрын
Please do the video on remove duplicates in custom objects by using key using java stream api. Your videos are so boosting up my skills a lot.Thank you so much
@El_Espada
@El_Espada 2 ай бұрын
Kotlin has this feature and I find it awesome.
@MrKKPA
@MrKKPA 2 ай бұрын
What might be the benefits of adding a library to do that when you can achieve the same by creating a object that contains the others nested objects?
@raghavanaliassaravananm1546
@raghavanaliassaravananm1546 2 ай бұрын
Good Q. But you may not have a consistency of marking the objects as Left, Right or Middle. Of course Apache Commons Lang made the trend with this I suppose. In your custom classes, it would be more obvious to think of using a Map but that has its own variants.
@jrdillip
@jrdillip 2 ай бұрын
Thank You Basant Bhai, I was not aware about these fantastic classes. Thank you for sharing it, now I will try to use this in my project.
@Nilcha-2
@Nilcha-2 2 ай бұрын
Though this makes it more object oriented, in the old days I use pass such object by reference to the method arguments. You can send back more than 3. Only it is mutable and open to side effects.
@saravanasathish423
@saravanasathish423 2 ай бұрын
This common lang3 will reduce writing multiple methods, thanks for the info ❤
@raghavanaliassaravananm1546
@raghavanaliassaravananm1546 2 ай бұрын
Interesting Video. Thanks for sharing Basant.
@abhijitprusty
@abhijitprusty 2 ай бұрын
Awesome contents....
@phoenixjones0804
@phoenixjones0804 2 ай бұрын
Great content Basant bhai, next video tike kafka connect upare kara. Searched a lot but couldn't find anything useful with real life implementation. Jay Jagannath
@Javatechie
@Javatechie 2 ай бұрын
Okay noted Sritam ✅️.
@shankarraojujjuri9408
@shankarraojujjuri9408 2 ай бұрын
nice information, I created custom pair class in my project, we will use this feature next onwards in my project
@rudrajitgupta3688
@rudrajitgupta3688 2 ай бұрын
This was awesome Basant..thank you for the learnings
@MurariKumar-wp6td
@MurariKumar-wp6td 2 ай бұрын
Thanks.. it is very useful for developers ❤👍
@abhuzaifa
@abhuzaifa 2 ай бұрын
@java techie please make a playlist on java 9,11 features
@phanimc11211
@phanimc11211 2 ай бұрын
thanks as always very resourceful
@mohammadtoficmohammad3594
@mohammadtoficmohammad3594 2 ай бұрын
Thank you
@kanaillaurent526
@kanaillaurent526 2 ай бұрын
Why not just return a record?
@inzi27
@inzi27 2 ай бұрын
what if you need to return multiple records?
@kanaillaurent526
@kanaillaurent526 2 ай бұрын
@@inzi27 put your records into a single record. and return this single record.
@darogajee3286
@darogajee3286 2 ай бұрын
Can you explain with code
@magdel1940
@magdel1940 2 ай бұрын
Same question.
@NaveenMovva
@NaveenMovva 2 ай бұрын
Nested records pattern is supported from java 21
@harichebrolu2817
@harichebrolu2817 2 ай бұрын
Useful concept
@BaluKompalli
@BaluKompalli 2 ай бұрын
Wow.... 🎉🎉🎉🎉🎉
@MilsonDev
@MilsonDev 2 ай бұрын
Nice feature.
@kachoutmohamed9492
@kachoutmohamed9492 2 ай бұрын
Can use RECORD !?
@mohanlal8692
@mohanlal8692 2 ай бұрын
It's a nice tutorial and great explanation. But instead of using this libraries we can achieve this using Generics by creating our own DTOs. just my thoughts....
@Javatechie
@Javatechie 2 ай бұрын
Yes we can create custom pojo but when library itself giving an easy option then why can't we choose that 😄
@sushant6815
@sushant6815 2 ай бұрын
Great
@manishkeshari5096
@manishkeshari5096 2 ай бұрын
Thank you it's helpful ❤
@abhinetrakumar
@abhinetrakumar 2 ай бұрын
Thank You Sir ❤❤
@rajkumarwinc9372
@rajkumarwinc9372 2 ай бұрын
Can we return more than 3 different objects..
@girishanker3796
@girishanker3796 2 ай бұрын
Great to know
@ErfanHossainShoaib
@ErfanHossainShoaib 2 ай бұрын
why use external lib for this public record Pair(X left, Y right){ public static Pair of(X x,Y y){ return new Pair(x,y); } }
@saichaithanyasaraf7634
@saichaithanyasaraf7634 2 ай бұрын
Why we need this when we have hashmap? @Javatechie
@MsPrettyg00d
@MsPrettyg00d 2 ай бұрын
@ornelfranck
@ornelfranck 2 ай бұрын
Nice
@theritesh973
@theritesh973 2 ай бұрын
❤❤❤
@rogerdinhelm4671
@rogerdinhelm4671 2 ай бұрын
I think y-glide is something that American comedians would add, imitating russian mobsters. Russians are more likely to just pronounce "ee" sound harder.
@sgr7ss
@sgr7ss Ай бұрын
But it will create a tight coupling Not good for communication in Microservices!
@luisdanielmesa
@luisdanielmesa 2 ай бұрын
Bad idea... return a record instead, or fix your design flaws. Or create a sealed interface and allow only the types you need. I have worked for Novell, IBM, Amazon and I'm currently at Oracle... don't do this unless you want to suffer trying to figure out what type you're returning.
@Javatechie
@Javatechie 2 ай бұрын
Why what complexity did you find In this approach. Just a simple example brother you have multiple upi payment method which one are you using? Just asking to help your question
@pardeepsaini3844
@pardeepsaini3844 2 ай бұрын
🎉🎉🎉Yes Great Explanation.....
@saidineshbobbadhi8384
@saidineshbobbadhi8384 2 ай бұрын
Our wallpapers are same
@rishiraj2548
@rishiraj2548 2 ай бұрын
🙂🙏🏻
@bhasoor
@bhasoor 2 ай бұрын
Some obsessive moron wants to give name to list....pair is logically a simple list with limitation on size... These methods are not for developers who are born and bought up in java.... These methods are specifically for people shifting to java from, i dont know which language... Honestly....These should not be part of standard java interview....if some interviewer asks this in interview.... understand that he is satisfying his ego...
@foddiebyage9696
@foddiebyage9696 2 ай бұрын
You have a great experience knowledge but lack of continuity in uploading leads to less reach
@Javatechie
@Javatechie 2 ай бұрын
Not getting you brother.
@2RAJ21
@2RAJ21 2 ай бұрын
Thank you
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 23 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 1,3 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 44 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 68 М.
А зачем ему рабочий ноутбук?..
0:12
Новостной Гусь
Рет қаралды 660 М.
Улучшил свой айфон!
0:17
По ту сторону Гугла
Рет қаралды 2,8 МЛН
Как подключить магнитолу?
0:51
KS Customs
Рет қаралды 1,8 МЛН
APPLE WATCH 10 - ЧАСЫ ЗАГАДКА
14:50
ЗЕ МАККЕРС
Рет қаралды 48 М.
Máy báo động cho gia đình mãi đỉnh
0:31
SaboMall
Рет қаралды 28 МЛН