Difference between model, javabean and POJO

I started learning MVC with spring. I heard a lot of Bean time containing setter and getter. Model is basically what the data wraps around, and Pojo , which matches Bean . But I am really confused about the whole term, and it all looks the same as you, please explain the exact difference between the two.

Javabean

POJO

MODEL

+8
java javabeans model pojo
source share
2 answers

If you use the MVC architecture, the model represents your domain: means your entities, and this is not a java-related term.
Your models are presented in Java as Java Beans (best practice in Java EE).
The Java Bean is a regular Java class that implements the Serializable interface and has a constructor without parameters and has getters and setters for each field.

However, POJO is simply a denomination for objects that are not bound by any restriction other than those caused by the Java language specification ( Wikipeadia ). This is just for conventions, and it is not related to MVC architecture.
Note that Java Beans are POJOs that implement the Serializable interface.

+11
source share

Only the difference bean can be serialized.

From Java docs - http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html

The serializability of the class is activated by the class that implements the java.io.Serializable interface. Classes that do not implement this interface will not have their serialized or deserialized state. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of serialization.

So far, the model is different from your business logic.

you can link below to the link

The difference in programming between POJO and Bean

+1
source share

All Articles