KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 JavaBean means "A Java Bean is a reusable software component that can be manipulated visually in a builder tool." not Data storage, violates certain patters, and is more complex. Now I can agree with the last one, but in my eyes JavaBeans in a list makes a lot more sense than nested Maps. The article claims that database mapping frameworks should call constructors, not set* methods, and the object should be immutable. In my mind however, calling set* methods when trying to build an object is easier to read than new MappedObject("column1", "column2", "yet another column", "this is stupid"); I also use the JavaBean style class for other things besides database mapping, eg for an IRC bot, having an object per user that gets updated with various things. I don't want to create a new object every time new information is given, I want to add it to an existing one. So my question: Is using JavaBeans for data storage a bad practice and should be avoided, or is it perfectly safe?
Tags (comma-separated)
Save Edits
Cancel