[Java] What is JavaBeans?

Programming study diary

January 6, 2021 Now that I've learned about JavaBeans for the first time today, I'll briefly summarize what JavaBeans are.

What is JavaBeans?

Simply put, it's like a warehouse for storing data. A reusable software component written in Java, its technical specifications. Software components are classes, and JavaBeans are often used when manipulating data in web applications.

JavaBeans specification

--Specify the class as public --Specify the property as private --Define a constructor with no arguments by specifying public --Prepare getter and setter methods to access properties --Packaging --The end of the class name is customarily a Bean --Implementing the java.io.Serializable interface, although not required


Benefits of using JavaBeans

It is possible to prevent rewriting to Mr. Ito of the data. Since each data attribute is private, it cannot be accessed from the outside, and the data attribute cannot be rewritten unless the setter is called after creating an instance. (Protecting data attributes from the outside in this way is called encapsulation)

JavaBeans notes

Misuse of the setter can easily break the encapsulation. Therefore, when using a setter, it is necessary to be careful that the correct value is set.


What are JavaBeans? Explanation of specifications, usage, and persistence Active engineers explain how to use JavaBeans [for beginners]

Recommended Posts

[Java] What is JavaBeans?
What is java
What is Java <>?
What is Java Encapsulation?
What is Java technology?
[Java] What is flatMap?
[Java] What is ArrayList?
What is Java Assertion? Summary.
What is a Java collection?
[Java] What is jaee j2ee?
[Java] What is class inheritance?
[Java basics] What is Class?
What is java escape analysis?
What is JVM (Java Virtual Machine)?
What is thread safe (with Java)
What is a lambda expression (Java)
What is Docker?
What is null? ]
What is Keycloak
What is Jackson?
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is Gradle?
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
What is a class in Java language (3 /?)
What is the best file reading (Java)
What is a class in Java language (1 /?)
What is Java and Development Environment (MAC)
What is a class in Java language (2 /?)
What is the main method in Java?
What is `docker-compose up`?
What is a constructor?
What is the Java Servlet / JSP MVC model?
What is hard coding?
What is a stream
What is permission denied?
What is instance control?
What is Spring Tools 4
What is an operator?
What is object orientation?
What is the volatile modifier for Java variables?
What is Guava's @VisibleForTesting?
What is MVC model?
What is an annotation?
What is @ (instance variable)?
What is Gradle's Artifact?
What is JPA Auditing?
[Swift] What is dismiss?
What is a Servlet?