Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is POGO in groovy

Can somebody explain me what is POGO in groovy and is there any difference between POGO and POJO in java ?

like image 213
AmirhosseinAbd93 Avatar asked Sep 18 '16 09:09

AmirhosseinAbd93


People also ask

What is a Java Pogo?

POJO stands for Plain Old Java Object. It is an ordinary Java object, not bound by any special restriction other than those forced by the Java Language Specification and not requiring any classpath. POJOs are used for increasing the readability and re-usability of a program.

How do you make a POJO on Groovy?

To do this, go to the context menu of a table (or several tables) and press Scripted Extension → Generate POJO. groovy. Choose a destination folder, and that's it!

What is groovy class?

A Groovy class is a collection of data and the methods that operate on that data. Together, the data and methods of a class are used to represent some real world object from the problem domain. A class in Groovy declares the state (data) and the behavior of objects defined by that class.


1 Answers

A Groovy POGO does have different behaviour to a Java POJO, namely:

  1. Implicit getters and setters for all properties
  2. Which are public irrespective of typed access modifier
  3. They include more sophisticated metaprogramming features than Java
  4. And named map based default constructors
like image 189
William Greenly Avatar answered Sep 19 '22 22:09

William Greenly