What is POJO & DOJO in JAVA? [closed]

2019-01-17 17:07发布

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

标签: java pojo
3条回答
等我变得足够好
2楼-- · 2019-01-17 17:41

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

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

查看更多
Anthone
3楼-- · 2019-01-17 17:58

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. :)

查看更多
▲ chillily
4楼-- · 2019-01-17 18:04

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;
  }
}
查看更多
登录 后发表回答