Are Java Beans as data storage classes bad design?

后端 未结 6 1522
挽巷
挽巷 2021-02-14 11:49

Usually JavaPractices.com is a good site with good idea\'s, but this one troubles me: JavaBeans are bad.

The article cites several reasons, mainly that the term JavaBea

6条回答
  •  时光说笑
    2021-02-14 12:13

    Its perfectly safe, and far more preferable than endlessly nested java.util.Map. You gain type safety, easier to understand code, and avoid your code ending up on The Daily WTF. Note that the implementation should be segregated - don't mix too much logic (beyond simple validation) into your data storage classes. You should read about POJOs

提交回复
热议问题