What is POJI ?
POJI stands for Plain Old Java Interface. POJIs are used to enforce the idea of developing an Application Programming Interface (API). It allows POJO multiple inheritance in Java.
Lets discuss the importance of POJI concept with an example. In a college management portal, “Student” and “Staff” objects are inherited from a “User” Interface. The college management portal has authentication and authorization modules. When a user login to the college management portal the authentication module checks whether the username and password keyed in are valid. Upon successful login the authentication module returns either “Student” or “Staff” object based on username supplied.
The authorization module retrieves this object from authentication module. At this point the authorization module is not sure whether the object is “Student” or “Staff”. Since both objects are implementation of User interfance, authorization module can retrieve the object as User object. Then the authorization module checks whether the object is instance of “Student” or “Staff” using instanceof keyword in Java.
The above design pattern is also popularly known as “Factory Pattern”.
Filed under: Portlet Development | Tagged: Micro Circle, OMNI, Persistence, Portal