jade.onto
Interface RoleEntityFactory


public abstract interface RoleEntityFactory

Abstract interface to create user defined ontological entities. Implementations of this interface must be able to create an object and to provide its class (or a superclass) on demand.

Author:
Giovanni Rimassa - Universita` di Parma

Method Summary
 java.lang.Object create(Frame f)
          Creates an object, starting from a given frame.
 java.lang.Class getClassForRole()
          Provides the Java class associated with this ontological role.
 

Method Detail

create

public java.lang.Object create(Frame f)
Creates an object, starting from a given frame. This method can just create the object ignoring its argument, or it can use the frame to select the concrete class to instantiate.
Parameters:
f - A frame containing initialization data for the object.
Returns:
A Java object, instance of the proper class (either the class returned by getClassForRole(), or one of its subclasses).

getClassForRole

public java.lang.Class getClassForRole()
Provides the Java class associated with this ontological role. This class is usually the class used by the create() method to instantiate objects. A useful technique is returning an interface or an abstract class, while using concrete subclasses to create objects.