[java] What is java pojo class, java bean, normal class?

Possible Duplicate:
Difference between DTO, VO, POJO, JavaBeans?

Hi please don't say my question is duplicate :-) I saw all questions but didn't understand the exact difference.

Can someone explain what is POJO, Bean, Normal Class in easy language?

This question is related to java class javabeans pojo

The answer is


POJO = Plain Old Java Object. It has properties, getters and setters for respective properties. It may also override Object.toString() and Object.equals().

Java Beans : See Wiki link.

Normal Class : Any java Class.


POJO stands for Plain Old Java Object, and would be used to describe the same things as a "Normal Class" whereas a JavaBean follows a set of rules. Most commonly Beans use getters and setters to protect their member variables, which are typically set to private and have a no-argument public constructor. Wikipedia has a pretty good rundown of JavaBeans: http://en.wikipedia.org/wiki/JavaBeans

POJO is usually used to describe a class that doesn't need to be a subclass of anything, or implement specific interfaces, or follow a specific pattern.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to class

String method cannot be found in a main class method Class constructor type in typescript? ReactJS - Call One Component Method From Another Component How do I declare a model class in my Angular 2 component using TypeScript? When to use Interface and Model in TypeScript / Angular Swift Error: Editor placeholder in source file Declaring static constants in ES6 classes? Creating a static class with no instances In R, dealing with Error: ggplot2 doesn't know how to deal with data of class numeric Static vs class functions/variables in Swift classes?

Examples related to javabeans

DTO and DAO concepts and MVC Spring cannot find bean xml configuration file when it does exist What is java pojo class, java bean, normal class? org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'customerService' is defined javax.el.PropertyNotFoundException: Property 'foo' not found on type com.example.Bean For a boolean field, what is the naming convention for its getter/setter? What is a JavaBean exactly? Difference between DTO, VO, POJO, JavaBeans? How to convert a Java object (bean) to key-value pairs (and vice versa)?

Examples related to pojo

Spring Data JPA map the native query result to Non-Entity POJO Convert a Map<String, String> to a POJO What is java pojo class, java bean, normal class? Date format Mapping to JSON Jackson What is the difference between field, variable, attribute, and property in Java POJOs? ArrayList - How to modify a member of an object? How to convert POJO to JSON and vice versa? How to create a POJO? Difference between DTO, VO, POJO, JavaBeans? What is the difference between a JavaBean and a POJO?