What is a POJO in Java? Almost EVERYONE Gets This Wrong

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 190

  • @bissen
    @bissen 3 роки тому +18

    Awesome, clear and simple explanation of something I've been scratching my head over trying to understand DTOs and Entities in relation to adding new data to a database. Thank you, truly.

  • @bwprogrammers874
    @bwprogrammers874 3 роки тому +7

    i am learning java the easy way, but i wonder how come you dont have so much subscribers!!! Anyway keep giving good content. Love u from Botswana, Africa.

  • @roldanreal2534
    @roldanreal2534 2 роки тому +21

    Thank you so much. I’m a new subscriber and every video you post is like a refresher to me in a way. You are a great help to everyone in the community, whatever experience and programming level they are right now.

  • @Aryabarta-ghxy
    @Aryabarta-ghxy 2 роки тому +4

    Thank you so much for the short precise and clear elaboration with example.
    Could you please provide the difference between ValueObject and POJO?

    • @jarlfenrir
      @jarlfenrir 2 роки тому +1

      Value object should be immutable and in your code two value objects with same values set to their fields should be treated as equal.

  • @cesarlopes-h1m
    @cesarlopes-h1m 5 місяців тому

    John you are amazing man. Was learning from you when I started programming 2 and a half years ago. Got a job. Programming for a year and a half now and still come back here when I need something properly clarified. Beauty.

  • @ShaileshDagar
    @ShaileshDagar 2 роки тому +1

    Your explanantions are quite elegant. Thanks for doing these. Would love to know more about Serializable.

  • @johnkeck
    @johnkeck 2 роки тому +3

    Great video, very clear. Thank you, John! A couple questions:
    Is a Java bean a POJO? It implements another class. Or would it cease to be one only if it implemented an *outside* class? (Since Serializable is a "built-in" Java class, a bean can still count as a POJO.)
    Also, what if one of the fields of the class has a data type that depends on (or is) another class? Would that still be a POJO?

  • @DannyJulian77
    @DannyJulian77 3 роки тому +48

    Can you talk about DTO (Data transfer object classes). I see that people has many definitions for that

    • @CodingWithJohn
      @CodingWithJohn  3 роки тому +48

      In my experience a DTO is basically a simple class, usually a POJO, whose job is to work as a middle-man between two representations. For example, you might have a web service request with a certain class structure, and also a database entity with a similar, but separate class structure. To avoid tightly coupling those two classes together, we typically will have a DTO (data transfer object) class that essentially holds the same data, and create mappings from the request to the DTO, and from the DTO to the database entity. And perhaps mappings for the other way around too, if you also want to be able to return those database entries to the user.
      So a DTO is more of a name for the purpose of the class, rather than aspects of what the class has or doesn't have like a pojo or javabean.

    • @TheJynx2011
      @TheJynx2011 2 роки тому +3

      Good example of a DTO that I currently use is using one to store data in the database, and using the other to pull data via the API. The DTO is used to pull data so I don't potentially expose unnecessary information to the end user. The Entity, however, can store more information in the DB, without potentially exposing that information to the end user.

    • @vignesh3184
      @vignesh3184 2 роки тому

      Can you explain why entity class need to be serializable?

    • @TheJynx2011
      @TheJynx2011 2 роки тому +1

      @@vignesh3184 I believe its so the object is recreated the same, regardless of the target. That is, if you serialize a Java object, any other language can deserialize the object and receive the information.
      Could be incorrect or missing info, but that seems to be the application.

    • @pablog5738
      @pablog5738 2 роки тому +2

      @@vignesh3184 entity classes don't need to be serializable

  • @droidlycodes
    @droidlycodes Рік тому

    I searched what is a Java Bean something new I learned even though I self taught myself Java 10 years ago, and still don't know what a Java Bean is lol, I've come across your content before however very well explained.

  • @Vinicius28636
    @Vinicius28636 2 роки тому +6

    Man, your videos are just so good! Congratulations on your work!

  • @hingchongrongphar3385
    @hingchongrongphar3385 3 місяці тому

    thank you for clearing my long awaited doubt.

  • @stephenweber33
    @stephenweber33 2 роки тому

    POJO Plain Old Java Object. Thank you, Started in 1983 programming, no schooling, just hobby. Missed a bunch of history. I remember putting a dot on a blank screen and it was brilliant, amazing, awesome. ;)

  • @dilln2158
    @dilln2158 3 роки тому +3

    I sugguest you do a java sudoku solver tutorial. It’s a common lab assignment in data structures and algorithms from what I’ve been hearing.

    • @CodingWithJohn
      @CodingWithJohn  3 роки тому +3

      I wrote one in Python in college years ago actually, but haven't in Java yet. If I can make it concise enough for UA-cam that's a great idea!

    • @CodingWithJohn
      @CodingWithJohn  3 роки тому +5

      Figured it out, and it's this week's video. Thanks for the suggestion, hope you like it! ua-cam.com/video/mcXc8Mva2bA/v-deo.html

  • @domal5818
    @domal5818 3 роки тому +1

    What a nice video. it was very usual for me, because in the web arent mutch informations availible. Short and onPoint!

  • @munagalavrr
    @munagalavrr 2 роки тому +1

    Two corrections for Java Bean:
    1. Fields don't need to be private
    -2. Getters & Setters are not required for a class/object-
    These requirements are do's and don'ts from some design patterns or recommendations. Not part of bean definition.

    • @drcl7429
      @drcl7429 Рік тому

      as per the Oracle spec there must be getters and setters.
      "Properties are always accessed via method calls on their owning object. For readable properties there will be a getter method to read the property value. For writable properties there will be a setter method to allow the property value to be updated. Thus even when a script writer types in something such as “b.Label = foo” there is still a method call into the target object to set the property, and the target object has full programmatic control."

    • @munagalavrr
      @munagalavrr Рік тому

      @@drcl7429 Following those lines in the spec: "So properties need not just be simple data fields, they can actually be computed values". Irrespective internally how java invokes/compiles, getters & setters are not required to define a bean. From newer Java standards, "record" is perfectly valid Java Bean even though it doesn't have any methods.

    • @drcl7429
      @drcl7429 Рік тому

      @@munagalavrr As far as I know, no further spec beyond 1.01 was published by Oracle, Sun or JavaSoft.

    • @munagalavrr
      @munagalavrr Рік тому

      @@drcl7429 Sorry, you are correct, thanks for correcting me. I have updated my original comment.

  • @MD90X
    @MD90X 2 роки тому

    that guy made a fancy sounding name for a simple java object so prudes would use it more, love it.

  • @mariolamenzaperello3774
    @mariolamenzaperello3774 Рік тому

    Hello John, I would like you to explain why it is necessary to make the attributes private.

  • @rollosroyce6812
    @rollosroyce6812 3 роки тому +1

    Thank you. Its was the best understanding pojo and Serializable. Good luck

  • @chlikhita2531
    @chlikhita2531 Рік тому

    Thanks for putting it in simple words!

  • @johnlee8840
    @johnlee8840 Рік тому

    Finally somebody explains it in layman’s terms for novices like myself. Thank you!

  • @idomoshe6040
    @idomoshe6040 2 роки тому +1

    Your videos are awesome, with clear and concise explanation, thank you! I hope you make a video about beans and inversion of control, just because I think your explanation will be clearer than other's.

  • @zeeshanalam4914
    @zeeshanalam4914 2 роки тому +3

    Clear, precise and straight to the point!

    • @pablog5738
      @pablog5738 2 роки тому

      And wrong.

    • @dronephone9934
      @dronephone9934 2 роки тому

      @@pablog5738 care to correct any points he made ?

    • @pablog5738
      @pablog5738 2 роки тому

      @@dronephone9934 pojo refers to java clases that do not depend on any infrastructure apart from the core java language (string, list, map and such). Any class that has a dependency on, for example, a specific framework (ejb) or specification (a servlet) is not a pojo. If you have a domain in your project you may decide to implement it using pojos. That does not forbid using another class in your domain as a dependency, for example though inheritance. If in your domain there in a concept "animal", you can have a class "Animal" and a class Cat extends Animal, both being pojos. Please read about the origin of the term from Fowler (martinfowler/bliki/POJO.html)

  • @anirbandebroy198
    @anirbandebroy198 3 роки тому +1

    Love your short videos. Thanks

  • @wristdisabledwriter2893
    @wristdisabledwriter2893 3 роки тому +7

    Great video. I was going to ask if a Java bean can be a pojo but you answered that when you typed implements serialize.
    Speaking of which, if you haven’t already, can you do a video on serialize

    • @CodingWithJohn
      @CodingWithJohn  3 роки тому +8

      Yep, the implements Serializable is kind of a gray area because of what you're talking about. Lots of people will say that all Java beans are pojos, but not all pojos are Java beans. But technically the Serializable thing makes that not true. But in this case, Serializable is such a "built-in"Java functionality that many overlook that and still call them pojos, which is definitely understandable.
      You seem to have a keen eye for these types of subtleties in these videos!
      And I'll look into what a video on serialization might be like to see if it'll work.

    • @jarlfenrir
      @jarlfenrir 2 роки тому +1

      I'd say java bean cannot be a pojo. Definition of POJO I learned was that POJO is basically a class that has no other fancy name. So if you can call it a bean, you no longer can call it a pojo.

  • @BroSanch
    @BroSanch 2 роки тому

    Very eloquent and concise! Do you have any advice on how to use JPA with multiple java beans?

  • @amarnathvadivelu
    @amarnathvadivelu 2 роки тому

    John thanks very much.. I misunderstood for many years that POJO and Java Beans are same. May be if i had found your channel earlier i would have even started loving Java earlier than this.

  • @jaimesastre6393
    @jaimesastre6393 2 роки тому +1

    Excellent as always.
    Simple, clean and clear.
    And I clearly learned something.
    Thank you John. 😉

  • @christopherprobst-ranly6284
    @christopherprobst-ranly6284 2 роки тому +4

    Funny, according to your def. a JavaBean cannot be a POJO because a POJO cannot implement an interface but JavaBeans have to implement Serializable. Gotcha :D You just have to love Javas consistency

    • @jarlfenrir
      @jarlfenrir 2 роки тому +1

      Java bean cannot be a pojo, true, where is that 'gotcha' part?

    • @johnkeck
      @johnkeck 2 роки тому

      I noticed that too. My question for @CodingWithJohn: does it cease to be a POJO because it implements another class, or because it implements an *outside* class? Serializable is a built-in Java class.

    • @jarlfenrir
      @jarlfenrir 2 роки тому

      @@johnkeck I would say bean is not a pojo simply because it's a bean.
      Class has to fulfill some requirements to be a bean, while pojo does not follow any requirements of any framework.

    • @drcl7429
      @drcl7429 Рік тому

      @@johnkeck serializable is an interface.

  • @baloney_sandwich
    @baloney_sandwich 2 роки тому

    john can u slam your ad at the end of the vid? thanks. Quality video nevetheless.

  • @dawitadmassu2947
    @dawitadmassu2947 2 роки тому

    My super man bro... do you have anything about Spring ? please please... You are my lifesaver ...

  • @aszriel_
    @aszriel_ 2 роки тому

    Well well, that's funny, I just discovered that I didn't know either what was a POJO. I'm currently in a training session and I asked if POJO and java beans were the same and unfortunately I got the "yes" anwser. But I was, somehow, skeptical, because why would we use 2 differents terms for EXACTLY the same thing ? Well now I know, they are not the same ^^ nice video.

  • @RealRogerFK
    @RealRogerFK 2 роки тому

    Thank god I now have this hidden knowledge critical for an efficient workflow.

  • @ShreyasS-bn9lm
    @ShreyasS-bn9lm 3 місяці тому +1

    Awesome video. Thanks brother

  • @HR-pz7ts
    @HR-pz7ts 10 місяців тому

    You're so good as always John!

  • @siddharth2291
    @siddharth2291 Рік тому +1

    Please make a Spring Boot course.. I'll be the first person to buy it 🙏

  • @oLunatiko
    @oLunatiko 2 роки тому +1

    Thank you, I love watching your videos.

  • @joaopedrorocha5693
    @joaopedrorocha5693 2 роки тому

    Great explanation! But what is a Java Bean and what does it serve?

  • @TheFoxfiend
    @TheFoxfiend 2 роки тому +1

    Thanks, a piece of maybe useful information that I can't bring up in an interview without sounding like a knowitall.

  • @waly3302
    @waly3302 2 місяці тому

    Thanks, this was incredibly helpful

  • @Gandhi_Physique
    @Gandhi_Physique 2 роки тому

    So, if I make a Calculator class and create simple methods for each operation, then it is a POJO?
    An example:
    The class:
    public class Calculator
    A method:
    public static void add(double num1, double num2) {
    System.out.println(num1 + num2);
    }

    • @jarlfenrir
      @jarlfenrir 2 роки тому +1

      Guess technically yes, that's a pojo, but because it has no fields and only a static method, many people would call it a "helper class".

  • @anmjubaer
    @anmjubaer 2 роки тому

    Thanks a lot for all the extra very important infos related to better understand POJO.

  • @srinath.s
    @srinath.s 2 роки тому

    What if class Implements Serialization?? Will we still refer to that class as POJO?

  • @anitaliberatore2272
    @anitaliberatore2272 2 роки тому

    Can you do a video about dependency injection?

  • @ticianofilho16
    @ticianofilho16 2 роки тому

    Very clear explanation. thanks for sharing it.

  • @cynthita93
    @cynthita93 2 роки тому

    Great explanation!!! THANK YOU JOHN!!!!

  • @StickOnLSD
    @StickOnLSD 2 роки тому +2

    thank you i learn so much through your sessions!

  • @venkateshmarneni385
    @venkateshmarneni385 3 роки тому

    Pojo can implement and extend interface or classes of java

  • @shady5063
    @shady5063 2 роки тому

    Can you make a video about Jackson library?

  • @Xim9600
    @Xim9600 2 роки тому

    Nice video, very simple! thanks!

  • @avgSE81
    @avgSE81 Рік тому

    I love your videos. They are really informative. Thanks!

  • @athul03
    @athul03 Рік тому

    What about Jave Bean vs POJO vs Spring Bean?

  • @josbexerra8115
    @josbexerra8115 2 роки тому

    Gracias Mister John....claro y directo al punto.....saludos de los andes peruanos

  • @Coccoutube
    @Coccoutube 2 роки тому

    Hi John, can you please explain a little bit more what do you mean when you said a POJO mustn't use external libraries?
    For instance, if I used CollectionUtils from apache library inside the class, that would make my class NOT a POJO, right?

  • @sanjibeatsan
    @sanjibeatsan 8 місяців тому

    Great explanation

  • @eduardmart1237
    @eduardmart1237 2 роки тому

    Make a video about spring

  • @heartoutloud7498
    @heartoutloud7498 2 роки тому

    Damn man this was awesome. Thank you.

  • @MK_AU
    @MK_AU 2 роки тому

    Short and clear. Thanks.

  • @doekewartena5729
    @doekewartena5729 2 роки тому

    I hate private, to many times I have to rely on reflection to do things to do the things I want. Also I think in most cases something should be protected over private. But what do I know...

  • @joaquimucolore3230
    @joaquimucolore3230 2 роки тому +1

    Love the explanation, now I understand well the difference between javaBeen and Pojo.

    • @pablog5738
      @pablog5738 2 роки тому

      The explanation is wrong.

    • @NilakshMalpotra
      @NilakshMalpotra 2 роки тому

      @@pablog5738 What is wrong?

    • @pablog5738
      @pablog5738 2 роки тому +1

      A pojo can extend other class and a pojo can implement an interface. The fundamental aspect of a pojo is that a pojo does not depend on any external component, in particular framework components like ejb or hibernate. It can depend on other classes that belong to the same domain. Cat extends Animal {} is a pojo if Animal is defined in the same package as Cat. But if you are using a 3rd party library that introduces Animal to your application, then Cat is not a pojo. The idea of pojo is that you can express your domain using classes that only depend on other classes of your domain.
      The idea of pojos appeared after ejb 1, that forced you to extend from ejb classes to implement your domain entities. It made your domain a mess, forcing your domain classes to implement behaviour imposed by a framework. With pojos your domain is cleaner, implementing domain specific behaviour, and the framework related behaviour moved outside the domain.

    • @joaquimucolore3230
      @joaquimucolore3230 2 роки тому

      @@pablog5738 ohh thank you.

  • @shadowcraftersr
    @shadowcraftersr 2 роки тому

    When you were talking about the Cat class not being a Java Bean you said that the String and int were not private. Aren't variables private by default unless specified otherwise?

    • @kupotaro164
      @kupotaro164 2 роки тому

      Default is package-private, so the fields can still be accessed by other classes in the same package.

  • @saikiran3009
    @saikiran3009 2 роки тому

    Great Explanation.

  • @findlestick
    @findlestick 3 роки тому +1

    Nice.

  • @devjena8924
    @devjena8924 2 роки тому

    Please make some videos on spring boot

  • @JavatechWLI
    @JavatechWLI 8 місяців тому

    thanks for this video!

  • @soumyadeepdebnath6623
    @soumyadeepdebnath6623 2 роки тому

    As usual....John is a legend 🙌 👏

  • @Zero-4793
    @Zero-4793 2 роки тому

    I only use POJO so far as i've not learnt the other stuff yet XD. havent had a need to yet with my projects

  • @manojpal8337
    @manojpal8337 2 роки тому

    Nice Explanation !! Can we Modify the POJO Class based on the properties file?
    I am trying to add/inject/remove properties files fields in my POJO class from a property file. Is it possible?

  • @b005t3r
    @b005t3r 2 роки тому

    I've been programming as a profession for over 15 years and never used that term or heard it being used.

    • @jarlfenrir
      @jarlfenrir 2 роки тому +1

      I have similar experience and also must say this term does not come up too often. Generally if you read about some framework or library you are considering using and documentation says it works with POJO, that basically means you can pass any kind object you want to it and it will work.

  • @hajajssss3147
    @hajajssss3147 2 роки тому

    Thanks. Video was good and helpful

  • @sureshmanne7245
    @sureshmanne7245 2 роки тому +1

    Can we implement toString() in POJO or Java Bean ?

    • @RutgerOlthuis
      @RutgerOlthuis 2 роки тому

      Yes

    • @sureshmanne7245
      @sureshmanne7245 2 роки тому

      @@RutgerOlthuis will it not break POJO terminology if we do so?

    • @RutgerOlthuis
      @RutgerOlthuis 2 роки тому

      @@sureshmanne7245 You could even say it makes it more pojo. When you don't write your own toString method, you're inheriting it from java.Object class. The base class of all java classes. So by implementing it yourself, you're taking a bit of this inheritance away.
      And if you look at the rules for a pojo: you're not adding inheritance (no extends), you're not implementing an interface (no implements keyword) and you're not adding some external annotation kung-fu. @Override is no external annotation magic.

  • @slowstarter5720
    @slowstarter5720 2 роки тому

    Or what if we use Lombok getter, setters annotations on a pojo. Can we call it as PoJo..? If we create no args constructor and getters and setters does it still qualify as PoJo?

  • @phoneguy1015
    @phoneguy1015 2 роки тому

    I notice that a java bean is not a POJO at all as it implements serializable, which breaks the rule of a POJO

  • @dejanpavkovic
    @dejanpavkovic 2 роки тому

    Thanks John.👌

  • @slowstarter5720
    @slowstarter5720 2 роки тому

    What about a class has everything else (like private fields, getters and setters and public no args constructor) but. Doesn't implement serializable.. ? Can we call it as PoJo or is it still a Java bean?

  • @Denys.Stoianov
    @Denys.Stoianov 2 роки тому

    Thank you for this video. Clear explanation

  • @sunilkumar-jc5vb
    @sunilkumar-jc5vb 2 роки тому

    What is seariliable? Please make a video

    • @jarlfenrir
      @jarlfenrir 2 роки тому

      Java has many builtin methods to write objects directly. For example you can pass a whole object to some socket or to file. Java checks if the object implements serialziable, and if so, it will convert it to some binary form that can be written to file, send via network or something.
      By writing "implements serializable" you are saying that this object can be safely stored and then reverted.
      For example if there is possibility of a cyclic dependency (A has reference to B, B references C and C references back to A) serialization of that object would get stuck on that so you should not mark that object as serializable.

  • @omegapirat8623
    @omegapirat8623 2 роки тому +1

    How can a java bean be a POJO if a java bean depends on the serializable interface?

  • @Mahmudulhasan-ts5hm
    @Mahmudulhasan-ts5hm 2 роки тому

    Thanks

  • @lieutneautnacer
    @lieutneautnacer 2 роки тому

    but while you written the word implements serializable you had broken the first rule!!! isnt that????

  • @dexterdenmark5988
    @dexterdenmark5988 2 роки тому +1

    Great man you are!

  • @MrWigen
    @MrWigen 2 роки тому

    Well done :) Thank you

  • @ahmedmaatoug1108
    @ahmedmaatoug1108 2 роки тому

    At end when you add implement serializable to make the class a java bean, doesn't this make the class not POJO anymore? Because the class is implementing something now

    • @alessioantinoro5713
      @alessioantinoro5713 2 роки тому +1

      Yeah he answered that from another comment, he said: "serializzable is such a built-in java feature, that even if it is not a pojo, we sometimes call it so"

  • @metrocartao
    @metrocartao 2 роки тому

    Excellent very clear!

  • @powertester5596
    @powertester5596 Рік тому

    Master Shifu, your Java Kung fu is on another level 🙏. Please keep teaching!
    - from one of your many online students!

  • @pecan8470
    @pecan8470 3 роки тому

    thanks!

  • @ALLINONE-ck1ef
    @ALLINONE-ck1ef Рік тому

    Can pojos be serializable?

  • @lavnyaup
    @lavnyaup 3 роки тому +3

    thanks for the explanation. I am confused between POJO and DTO. could you please help me understanding with a video if possible.

    • @iyhan1987
      @iyhan1987 2 роки тому +5

      Since there is still no video here is the answer: POJO may contain not only properties, but also methods and logic, sometimes truly complicated.
      DTO stands for Data Transfer Object. It is used to send data from one module, service, application to another, 4 example via message brokers such as RabbitMQ.
      DTO contains only necessary data, no methods except may be getters and setters. As a very primitive example, you have class Employee, that contains a lot of information about the person: age, name, address, birthday, sex, bank account, salary etc. And also it has methods such as promote(), fire() and so long.
      When it is time to pay your worker you send information to another application, that actually pays the money. It doesn't need age, sex and phone number of employee. The only thing it does is sends money from your account to another one that you provide.
      So BOTH(!!!!) your application and the salary module have the same let call it PaymentDto class. That class only has bankAcconutNumber and salary properties. Otherwise the payment application should have the entire Employee class implemented to be able to receive data from you, automatically map it to own class and process one. PaymentDto is the object that you actually send from one module to another, creating it using only required data from your employee object. So it is an object that is used to transfer the data. Data Transfer Object. DTO.

    • @pt_trainer9244
      @pt_trainer9244 2 роки тому

      @@iyhan1987 thanks for this. Been looking for a concise explanation

    • @iyhan1987
      @iyhan1987 2 роки тому

      @@pt_trainer9244 you are welcome :)

  • @VANTYCSolutions
    @VANTYCSolutions Рік тому

    Where were you all those years of confusion? 👏👏👏

  • @alontalmor6942
    @alontalmor6942 2 роки тому

    Is using an external class possible in a POJO class?
    For example, If the POJO class uses Map or List from the java.url lib or having a field with a with a user defined class type.

    • @CodingWithJohn
      @CodingWithJohn  2 роки тому

      Using standard libraries like that probably doesn't disqualify it from being called a "pojo". It's definitely worth noting though, that it's still a somewhat fuzzy definition. And don't let it stop you from using what you need to use in your class. Even if it might not be called a pojo anymore, having your application function properly and be coded in a clean way is a way bigger priority.

    • @alontalmor6942
      @alontalmor6942 2 роки тому

      Thank you for the answer John!
      And in my comment I wrote java.url, I meant java.util of course.

  • @morrisbirkholz30
    @morrisbirkholz30 2 роки тому +1

    So you say a class that extends a POJO can not be a POJO itself? I do not think that is correct.

  • @alexhu01
    @alexhu01 2 роки тому +4

    If java bean has to implement serializable interface, does it mean it's no longer POJO according to your definition(POJO can't implement interfaces)?

    • @saranram9225
      @saranram9225 2 роки тому

      He said bean class is not a POJO already

    • @alexhu01
      @alexhu01 2 роки тому

      @@saranram9225 I think I missed it. about what time he said that?

    • @christopherprobst-ranly6284
      @christopherprobst-ranly6284 2 роки тому

      @@alexhu01 He did not say it.

  • @ricardo.sander
    @ricardo.sander 2 роки тому

    So Cat class was turned into a Java Bean and it's no more a POJO, since it's implements a interface now
    So It means POJO is never a Java Bean and Java Bean is never a POJO

  • @asifnisarr
    @asifnisarr 2 роки тому

    You forgot to explain what is the usage

  • @damnseagulls2004
    @damnseagulls2004 Рік тому

    AMAZING!!!!👍

  • @19891214ful
    @19891214ful 2 роки тому

    Hey John, can a POJO contain an import statement? As I understand a POJO is a standalone, independent java class. So having an import statement makes it “NOT” POJO?

  • @vimalathithan2007
    @vimalathithan2007 2 роки тому

    I think the class Cat extends java.lang.Object . So cat class is not pojo. 😇

  • @iippari7
    @iippari7 2 роки тому

    Would a class with a member with a non-JDK non-primitive type still be a POJO? Surely, that class couldn't be used by itself: you'd need the other class, as well

  • @eshwarnag
    @eshwarnag Рік тому

    blow my mind always

  • @Alex-mp5bu
    @Alex-mp5bu 2 роки тому

    I think this definition is still made up. POJO, historically, is just an alternative to an Enterprise Java Bean. Not extending or implementing may have referred to EJB specific base classes and interfaces.

  • @thirumalaisriram8623
    @thirumalaisriram8623 2 роки тому

    Great and simple video! Thank you :)