Your explanation about not passing list as a parameter to the rest endpoint was golden! You are goldmine of knowledge
@eimaisklhros5 жыл бұрын
8:07 in the pop up window, go down-> Select None -> there's your empty constructor!! Kushik I want you to know that I got a job and 5th day on the job, I just study from this playlist to learn microservices bro! When you come to Greece for vacations I'll definitely buy you a beer! Thank you very much!!!
@PiyushShandilya5 жыл бұрын
Koushik: "Isn't there a way to create a no argument constructor in intellij these days?" The de-select fields option: "Am I a joke to you?"
@stevend10705 жыл бұрын
Piyush Shandilya there’s also select none lol
@sivarajamani67095 жыл бұрын
r u 9gager?
@rinkeshrohan4 жыл бұрын
Ctrl + left click on selected object to deselect the object. ✌️
@vsk02083 жыл бұрын
8:06 Click on Class name on top of field name and click Ok to create empty param constructor.
@bazar90003 жыл бұрын
You can use Lombok and anottate your class with @NoArgsConstructor
@explorerfl0075 жыл бұрын
@Koushik: You can use lombok api to have constructor/getter/setter/builder all done with annotations.
@StyleTrick5 жыл бұрын
Hey Koushik, great tutorials on Spring! By the way, to create an empty constructor, choose the "Select None" option =)
@SMN_n15 жыл бұрын
U'r course ist the very best! Thanks again!!!
@rajugm95045 жыл бұрын
Teaching is like a spoon feeding thank you boss !! kudos to you :-)
@TheRickTuber5 жыл бұрын
You can use Rating[].class and then wrap your method in a Arrays.asList() instead of using ParameterizedTypes.
@SasidaranRajaram5 жыл бұрын
Any limitations in using this approach? Does this work for complex object structures as well? Thanks in advance!
@sharanrai46034 жыл бұрын
@@SasidaranRajaram yes it does
@AshutoshSharma315 жыл бұрын
8:08 select the option "Select none" to create an empty constructor.
@akhilkapoor51275 жыл бұрын
yup
@sagarshekhar62965 жыл бұрын
Koushik, ur videos are crystal clear and excellent...excellent.....excellent....:)
@aqibishaq3084 жыл бұрын
after watching level 1 15 videos lemme tell u i am your fan
@vsk02083 жыл бұрын
8:06 Click on Class name on top of field name and click Ok to create empty param constructor.
@ronishpanjwani92413 жыл бұрын
Why do we need the empty Constructor
@haimmichalashvili82514 жыл бұрын
Hey Koushik, you can generate empty constructor with intellij by not choosing any of thr feilds in the window.
@KolomiecSergeyK4 жыл бұрын
To create empty constructor go to class line (first line in popup) and just hit `enter+ctrl`
@cryptoeric244 жыл бұрын
I used the UserRating wrapper but when it comes back from the api call the movie field is null but all the other fields are present. What is going on??? ex: coming back from rating service: RatingsList: [Rating{id=16, movie='sneakers', rating=5}, Rating{id=17, movie='nickolas nickleby', rating=5}], showing up in movie-catlog service: [Rating{id=16, movie='null', rating=5}, Rating{id=17, movie='null', rating=5}]
@letsrock73544 жыл бұрын
make sure all services are running, looks like somewhere you are getting null objects, for more send me the code at kuldeepdixit96@gmail.com . Dont forget to reply here when u send me the code.
@asheeshverma3305 Жыл бұрын
How to create empty constructor? Goto class where need to create empty constructor. below the class Cmd + N in MacBook then choose Constructor -> then Select class name instead of any properties.
@testcase22993 жыл бұрын
sir i have a question we can call get api by restTemplate but what about post api.i need to call a api that expecting a object for example sav.how to pass object to api in different service
@adancastroharos94082 жыл бұрын
Thank you very much, this is very helpful
@hansmbua43432 жыл бұрын
To create an empty constructor, I usually go to generate > constructor > unselect the parameters and click on "OK"
@hyperborean723 жыл бұрын
Very useful chapter, thank you
@anupamkumartejaswi92104 жыл бұрын
not sure why i got this at top of my search result for search saying "can not deserialize instance of out of start_array token" but when i watched till the end i got my answer.
@baibhavghimire38274 жыл бұрын
I think if you guys understand Video-11 and this Video(15) nicely , Micro-services is a piece of cake..
@tiagovieira66533 жыл бұрын
Can't you send an array with ids as param... And only do a call to the database in service layer? Because that way there will Be a lot of calls to database, passing one id each time
@surbhigupta63672 жыл бұрын
Hi sir, In RatingService, where you have created a wrapper class (UserRating), will it be okay if we pass list in the userRatingconstructor and return the UserRating Object instead of calling the Set method and then return.
@rik21019865 жыл бұрын
Hi I am getting error: com.fasterxml.jackson.exc.MismatchedException: Cannot deserialize instance of com.xyz.models.UserRating out of START_ARRAY token ar [Source: (PushbackInputStream);line:1,column:1] Please help.
@weitanglau1624 жыл бұрын
Should we have a class or an interface as the return type?
@contactdi84262 жыл бұрын
Kuch nahi samjha,, but majjaa aaya :) Abhi bhut mehnat karne ki jarurat hai apun ko :)
@sambhajikale73382 жыл бұрын
How user additional field impact List return type not clear. If anyone is clear please clarify.
@anantsaxena68494 жыл бұрын
You are amazing sir ... Can you please post a video on stream apis.
@BanuKones4 жыл бұрын
Hi Koushik, I think you want to avoid using mouse and select none on the popup for empty constructor. You can use Up Arrow and Enter. (up arrow highlights class name and deselect the field)
@ilhammammadli45602 жыл бұрын
event best way, just go on the class name with cursor(up or down), press ctrl+W(chose the class name-> alt+insert -> constructor ->TABx2->enter it creates empty constructor
@ilhammammadli45602 жыл бұрын
to bring back project sidePanel - ALT+1 to create new class -> close right folder first -> up down arrows -> ALT+Insert
@potatosheep4 жыл бұрын
How do you test this?
@amritraj23035 жыл бұрын
Koushik..Thanks a lot for the video..But could not find the video no. 13 and 14. Could you please update them as well.
@Java.Brains5 жыл бұрын
Try accessing the playlist. I've collected all the videos there in the right order for convenience.
can you do a post method calling stored procedure using callable statement
@johncerpa37824 жыл бұрын
Great lesson!
@wiliamferraciolli53804 жыл бұрын
Very interesting this topic , thank you
@manivannanpandi23645 жыл бұрын
Sir, Could you explain in usage of difference in preferring node js frameworks Vs Spring boot framework??
@MegaMohit924 жыл бұрын
I have one question here: Question: In the micro services architecture, we are internally calling other service to complete our task. So don't you think its making our application slow as compared to Monolithic application?
@arkzbh4 жыл бұрын
Yes, a single monolith doesn't have the overhead of network calls (other than making a db call or something like that which might reside in someplace else) hence should theoretically work faster and little more reliable. However, there are several other factors that can act against a monolith, for example memory use or cpu usage. Once you have a monolith, all of the application, all the threads are running on a same memory space and using the same cpus. Whereas in a distributed system, you deploy all the different microservices on different machines/vm/container, thus minimizing any potential slowness due to memory issue for starter. Also, while designing an application, you need to consider several other aspects like reusability, less downtime, scalling etc. The minimal performance benefit that a monolith may provide, most of the the gets outwaighted by the other benefits that a microservices based architecture provides.
@MegaMohit924 жыл бұрын
@@arkzbh First of all thank you for the reply. Just one more question, as we know that microservices isn't suitable for all types of web application. So what are factor we should consider before developing our projects into microservices?
@arkzbh4 жыл бұрын
@@MegaMohit92 there is no straight forward answer for this one IMO. it all depends on the "need". Let's take an example, let's say I have a simple application doing some database search and returned data is displayed on ui. I'll say build a single application having html/js and java code together and deploy in tomcat as a war. But now what if I get a request from client to change the ui too frequently. Everytime I need to redeploy the whole application and any other project that may be using my api to search, that also needs to wait. In that case I'll suggest a microservices based approach, a react/angular based ui app and a separate spring boot java app. The ui app can call the java apis using api url. But if I don't have all these kind of requirements, then I'll go for monolith to avoid all the extra complexities. In a nutshell, if an application can logically be splitted into 2 or more either technical or functional module, you can "start thinking" about microservices. Whether or not it's actually needed, that depends on case by case basis. Hope that clarifies something 🙂 keep learning
@commentsonly43415 жыл бұрын
I tried wrapping list in object and returning json parse exception ..
@dhayanithi20205 жыл бұрын
How to avoid hard coding of Rest URL ?
@sivaganesh44894 жыл бұрын
Alt + insert select constructor and then click on select None or use lombook and use @NoArgsConstructor
@sethuramanramaiah11325 жыл бұрын
I am still not clear why should we return a newly created object instead of list. Can any one kindly brief...
@10xtenx10xtenx10xten5 жыл бұрын
I think this is what he means. In the video: [{"movieId:"1234", "rating":4}, {"movieId":"5678", "rating":3}] If we wanted to add a new attribute to the response. For example he mentions adding a full name. We'll we can't add a full name property to a list. We can add it to the Ratings object. [{"movieId:"1234", "rating":4", fullName":"John Doe"}, {"movieId":"5678", "rating":3, "fullName":"John Doe"}] But now we're repeating John Doe multiple times. If we returned an object we could put the full name property on the object instead. { "fullName":"John Doe", "ratingsList": [{"movieId:"1234", "rating":4}, {"movieId":"5678", "rating":3}] } Hopefully the formatting is ok.
@peoplethesedaysberetarded5 жыл бұрын
10xtenx10xtenx10xten AWESOME. Thank you! Yeah, validation and documentation will be a PITA unless you can just say, “it’s this object.” That way, you throw your docs/JSR303/383 at that class, and you’re done.
@mehdis9482 жыл бұрын
@@10xtenx10xtenx10xten Why we cannot return a list anymore? we can have an API response like this: [{"movieId":5870,"rating":5},{"movieId":1234,"rating":3},"John Doe"] and it is its code: @GetMapping("-sth-") public List foo() { List finalList = new ArrayList(); finalList.add(new Rating(5870L, 5)); finalList.add(new Rating(1234L, 3)); finalList.add("John Doe"); return finalList; }
@10xtenx10xtenx10xten2 жыл бұрын
@@mehdis948 To be clear, there's nothing stopping you from returning your list like that. But how are you going to explain to the client where the name is? Are you going to promise that it will always be in index 2? What happens when you add another rating.
@mehdis9482 жыл бұрын
@@10xtenx10xtenx10xten I got it. thank you so much
@mucyomiller_5 жыл бұрын
create empty constructor you have to click on select none on that window :)
@VictorMartinez-gn5fk3 жыл бұрын
¿Isn't that a DTO?
@siddharthslayer15624 жыл бұрын
Thanks a lot.
@mohammedyassinhamdaoui86344 жыл бұрын
Useful tip
@mihaelvinkovic39295 жыл бұрын
Be a lazy programer use Lombok :D
@HabilNaqati2 жыл бұрын
@Setter & @Getter 😌
@mandarnaik99012 жыл бұрын
I didn't understood your explanation quit well? can someone please elaborate to me?
@cmdrshepard5 жыл бұрын
ALT + INS; Enter; ALT+N
@ravideviceregunta57944 жыл бұрын
Awesome
@aninjamnky3 жыл бұрын
If I'm needing to purely return a list of objects, I don't really think the worry for backward compatibility really applies there. If you're returning more than that list (like the name of someone, as his example), I can see the need for a wrapper object. But, the worry about new additional fields in an object is really taken care of by Jackson's annotations, specially @JsonIgnoreProperties(ignoreUnknown = true). Any downstream processes should be ignoring unknown properties anyways. I was looking at this video to see if sending a list was a bad practice or potentially slower when deserializing, I can't say I really got my answer here lol.
@dazelmann65894 жыл бұрын
Its always easy to remove code than to add some. ~Koushik 2k20
@NotNotNithin5 жыл бұрын
I love your tuts, but please take good care of your eyes though man. They might pop out some day🙈
@ambaragrawal91345 жыл бұрын
Lolzzz...
@nicko2745 жыл бұрын
Hey Koushik... I know how to create an empty constructor in Intelli-J! Type "public", then type, "Rating", then "()", then "{", then "}" Whaalaah!!
@mehdis9482 жыл бұрын
Why we cannot return a list anymore? we can have an API response like this: [{"movieId":5870,"rating":5},{"movieId":1234,"rating":3},"John Doe"] and it is its code: @GetMapping("-sth-") public List foo() { List finalList = new ArrayList(); finalList.add(new Rating(5870L, 5)); finalList.add(new Rating(1234L, 3)); finalList.add("John Doe"); return finalList; }
@mehdis9482 жыл бұрын
Why we cannot return a list anymore? we can have an API response like this: [{"movieId":5870,"rating":5},{"movieId":1234,"rating":3},"John Doe"] and it is its code: @GetMapping("-sth-") public List foo() { List finalList = new ArrayList(); finalList.add(new Rating(5870L, 5)); finalList.add(new Rating(1234L, 3)); finalList.add("John Doe"); return finalList; }