What are pre-specified classes?

3

Reading the wikipedia publication on POJO (Plain Old Java Objects), I came across the term pre-specified classes. I understood very superficially that perhaps it is the classes of the specification, but it was not very clear.

Could you explain it better?

link

  

Definition

     

Ideally speaking, a POJO is a Java object not limited by   some constraint other than those forced by Java Language   Specification. In other words, a POJO should:

     

Do not extend pre-specified classes, as in public class Foo   extends javax.servlet.http.HttpServlet {... Do not implement   pre-specified interfaces, such as in public class Bar implements   javax.ejb.EntityBean {... Do not contain pre-specified annotations,   as in @ javax.persistence.Entity public class Baz {...

    
asked by anonymous 21.11.2018 / 17:17

1 answer

3

In this case, this term is a little weird or no context, but it's simple. Is it easier if it were written "pre-declared" or "already created"? The latter even flirts with the error, but it seems to make it more obvious what it is. That is, it is just talking about classes already in the code.

But one caveat: every Java class inherits from at least the Object class, it is not counted in this restriction. This occurs because of language specification forcing all classes to have a common root. The text is a bit poorly written and does not make it so clear.

POJO classes are simple, and run away from what is conventionally used in object orientation, they have no inheritance, sophisticated mechanisms, or even behaviors beyond the trivial of the object, but nothing that creates extra mechanism for manipulating the object, as is common.

    
21.11.2018 / 17:45