Video není dostupné.
Omlouváme se.

Difference between Component Service Repository Controller & RestController annotation | Code Decode

Sdílet
Vložit
  • čas přidán 27. 11. 2023
  • Spring boot Interview Question @Service @Repository @Component @Controller and @RestController differences
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/udemycourse
    Course Description Video :
    yt.openinapp.co/dmjvd
    What is spring annotations
    Spring Annotations are a form of metadata that provides data about a program.
    Annotations are used to provide supplemental information about a program.
    It does not have a direct effect on the operation of the code they annotate. It does not change the action of the compiled program.
    @Component, @Service, @Repository, @Controller all these are stereotype annotations
    What are stereotype annotation ?
    A "stereotype annotation" is a special label or tag that developers put on classes to tell Spring something about the role or purpose of that class.
    These annotations help the program understand how to treat and use these classes.
    They're like quick notes attached to classes, providing information on what each class is meant to do in the application.
    How Spring treats these stereotype annotations
    Spring treats stereotype annotations differently from other annotations primarily in the context of component scanning and bean registration.
    Here's how Spring treats stereotype annotations differently:
    Automatic Bean Registration:
    Classes annotated with stereotype annotations (e.g., @Component, @Service, @Repository, @Controller) are automatically registered as Spring beans during the component scanning process.
    Other non-stereotype annotations or custom annotations generally don't trigger automatic bean registration.
    How Spring treats these stereotype annotations
    Component Scanning:
    Stereotype annotations are explicitly considered during component scanning.
    Spring looks for classes with these annotations and treats them differently based on their roles.
    Other annotations might be used for specific purposes, but they might not trigger the same automatic bean registration and special treatment.
    How Spring treats these stereotype annotations
    Convention-Over-Configuration:
    Stereotype annotations align with the convention-over-configuration principle in Spring. By using these annotations, developers adhere to a set of conventions that Spring can understand without requiring extensive configuration.
    Other annotations might still require manual configuration to achieve similar results.
    In summary, Spring treats stereotype annotations differently by providing them with special roles in the framework.
    These annotations are designed to make development more straightforward by relying on conventions and minimizing the need for explicit configuration. They play a key role in the automatic discovery and management of beans within the Spring container.
    How Spring treats these stereotype annotations
    Example of non stereotype annotations :
    @RequestMapping is not a stereotype annotation but is used for handling the mapping of requests.
    @Autowired is not a stereotype annotation but rather an annotation for dependency injection.
    Thus When Spring sees these annotations, it doesnt create beans automatically in container
    @Component
    We can use @Component annotation in our application to declare any class as the Spring’s managed components.
    The classes under the @ComponentScan path annotated with @Component annotation will be registered as a Bean in Spring ApplicationContext.
    You can use the instance of such bean using the @Autowired annotations.
    Most Asked Core Java Interview Questions and Answers: • Core Java frequently a...
    Advance Java Interview Questions and Answers: • Advance Java Interview...
    Java 8 Interview Questions and Answers:
    • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers:
    • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers:
    • Advance Java Interview...
    Angular Playlist:
    • Angular Course Introdu...
    SQL Playlist: • SQL Interview Question...
    GIT: • GIT
    Subscriber and Follow Code Decode
    Subscriber Code Decode: czcams.com/users/CodeDecode?...
    LinkedIn : / codedecodeyoutube
    Instagram: / codedecode25
    #pathvariable #codedecode #requestparam

Komentáře • 34

  • @trailblazer555
    @trailblazer555 Před 8 měsíci +2

    Learnt a lot in One video. Thank you so much from the heart.

  • @amarthyaseshu683
    @amarthyaseshu683 Před 8 měsíci +2

    thanks, waiting for this from long time

  • @geethak6163
    @geethak6163 Před 7 měsíci

    Mam truely helpfulled ur explanation try to do more videos mam

  • @unemployedcse3514
    @unemployedcse3514 Před 4 měsíci +1

    awesome ❤

  • @pramodpawar6237
    @pramodpawar6237 Před 8 měsíci +1

    Thanks for covering such topics as well...Please create video for difference between @bean & @component...

  • @SigmaMindFuel
    @SigmaMindFuel Před 8 měsíci +1

    📈❤️‍🔥

  • @sidhanshuraghuvanshi1
    @sidhanshuraghuvanshi1 Před 8 měsíci +5

    No offence. Just a positive feedback: you could have wrap up this topic in 5min video. Felt like same thing is repeated in the video. Hoping to get these type of great content from you but in a time limited good content. Thanks😊

    • @CodeDecode
      @CodeDecode  Před 8 měsíci +6

      Hi Sidhanshu. Yeah we can wrap it quickly but we have covered a lot in this video. Starting from what are spring annotations, what are stereotype annotations, how they are different. Why these are stereotype and which annotations are not stereotypes. How to differentiate Between them. Then at end we came to differences.
      You can directly skip to these stereotype annotations difference if you need.
      Still you need to cut this video short by removing these initial imp interview questions, you can let us know. We will trim that part if that's not important.
      Thanks for your feedback. Will be waiting for your response 👍👍

  • @samahmahdi5511
    @samahmahdi5511 Před 4 měsíci

    You said, until now no differences between @Component and @Service, please specify the Spring version so if a change happen we can which version you talk about. Thanks a lot

  • @pk333
    @pk333 Před 2 měsíci

    Are @Configuration and @Bean stereotype annotations ?

  • @Atul_Shegokar
    @Atul_Shegokar Před 8 měsíci

    Hi Madam, could you please share the link of slides

  • @_ravi_kumar_gupta
    @_ravi_kumar_gupta Před 8 měsíci +1

    Could you please make video on oauth2.0 with scope and jwt creation along permission management, in short a security video which will be helpful

  • @gyaanbhandaar1622
    @gyaanbhandaar1622 Před 2 měsíci +1

    Hi mam I want to go for mock interview. Kindly let me know the process

    • @CodeDecode
      @CodeDecode  Před 2 měsíci

      Please fill the google form given in the description

  • @ShubhamPatil-ig9qe
    @ShubhamPatil-ig9qe Před 8 měsíci +1

    Can you please make a udemy course by compiling all these spring boot and java question?

  • @saurabhparashar3310
    @saurabhparashar3310 Před 8 měsíci +1

    Plz provide discount coupon for ur udemy course.... Right now its about 2k make it affordable plz

    • @CodeDecode
      @CodeDecode  Před 8 měsíci

      Hi Sale is going on you can check now using link giving in the description

  • @harshbaghel6546
    @harshbaghel6546 Před 8 měsíci +1

    Ohh now you also came with paid course one 😢

    • @vinayuddagiri
      @vinayuddagiri Před 8 měsíci +1

      All those aws cloud things are not open source bro. They had to spend some dollars on that to even prepare the course.

    • @sayanbiswas8847
      @sayanbiswas8847 Před 8 měsíci +2

      Even your parents paid during your delivery, to get you into this world. Nothing comes for free bro. The sooner you accept this, the happier you will be. Cheers.

    • @CodeDecode
      @CodeDecode  Před 8 měsíci

      ❤️❤️

    • @CodeDecode
      @CodeDecode  Před 8 měsíci +2

      It's true that even we have to pay a lot to aws to prepare this course. It takes a lot to create an end to end working project, which covers every thing a developer face in real world. And just to let you know, the tutor , the girl teaching this was 8 month pregnant when she was shooting this course. 399 is a small amount for you we feel Harsh. Please feel the pain required to create content for community.

    • @sayanbiswas8847
      @sayanbiswas8847 Před 8 měsíci +3

      @@CodeDecode Thanks for all the help guys, I have cracked a lot of interviews watching your content, have been following you since a long time. And congrats and all the best to ma'am for her pregnancy and delivery. Her child will be proud to have such a mother who helps unknown people to crack interviews and have a good career. Cheers to the team!

  • @vinayuddagiri
    @vinayuddagiri Před 8 měsíci +2

    Can you do udemy course for aws certifications also... It's much easier to understand your content than any others.