13

I have many doubts in POJO. And seek for a clear definition with a tiny example.

Ragunath Jawahar
  • 19,513
  • 22
  • 110
  • 155
JDGuide
  • 6,239
  • 12
  • 46
  • 64
  • 1
    http://stackoverflow.com/tags/pojo/info, http://en.wikipedia.org/wiki/POJO, ... – Nick Jul 30 '12 at 13:09
  • there's a DOJO in java? I'm intrigued – kostja Jul 30 '12 at 13:10
  • 1
    DOJO is a javascript toolkit, which is nothing to do with java – JoseK Jul 30 '12 at 13:10
  • 2
    @Sahal question is always a question . It might be silly and its possible whatever you know I may not know. – JDGuide Feb 15 '15 at 06:49
  • The question being closed I can't post a new answer. However after receiving a dojo challenge, a search for this term brought me here so I thought to update this question for the record. While DOJO is indeed a JS framework, there's also the term **coding dojo**, which means a place for coders to work together on a programming challenge free of the constraints of your typical programming contest. https://codingdojo.org/WhatIsCodingDojo/ – riverhorse Mar 16 '21 at 16:56

3 Answers3

44

POJO Plain Old Java Object. Basically a class with attributes and it's getters and setters.

public class User{
 private String name;
 private int age;

 public void setName(String name){
    this.name = name;
 }

 public String getName(){
    return this.name;
 }

 //same for age

}

DOJO haven't heard of it. A JavaScript framework. :)

Nishant
  • 54,584
  • 13
  • 112
  • 127
  • Its really good.Means the helper methods are inside the POJO. – JDGuide Jul 30 '12 at 13:20
  • Some people do programming exercises together. In other words they practice together in order to get better at coding. Some schools for coding use the term dojo also. Something related are small exercises called Katas. These terms comes from the martial arts arena. – FernandoZ Feb 03 '15 at 22:33
  • @Nishant how POJO is different from a bean. Is POJO serialzable. – Apoorva sahay May 12 '15 at 06:14
  • I could not state it better than this answer: http://stackoverflow.com/a/1394292/298455 – Nishant May 12 '15 at 08:16
6

pojo : plain old java object

dojo : http://dojotoolkit.org/ A javascript ajax framework though has nothing to do with java

EDIT 1:

eg. for pojo class:

public Customer{
  private String name;
  private String surname;

  public String getName(){
    return name;
  }
  public String getSurname(){
    return surname;
  }
  public void setName(String name){
    this.name=name;
  }
  public void setSurname(String surname){
    this.surname=surname;
  }
}
fmucar
  • 14,361
  • 2
  • 45
  • 50
4

POJO = plain old java object == Java object, which has no technological dependence on any framework etc.

DOJO = I know only about this javascript framework...

malejpavouk
  • 4,297
  • 6
  • 41
  • 67
  • 4
    That's wrong. What you describe is a bean. A POJO does not require getters, it does not require a constructor without params. A POJO is basically a java object the way you would write it if you had no framework at all. – Joeri Hendrickx Jul 30 '12 at 13:39
  • thx for correction, I have somehow interchanged these two :-) – malejpavouk Jul 30 '12 at 16:59