Entity Services

Entity services implement simple business rules upon a single entity. They hide business logic and database access from the visible presentation component, acting as an intermediary component between the entity and the database.

They are used for strategic reasons in distributed deployment environments that require centralized execution of simple business rules and centralized control of data access.

Entity services are useful when you want to separate presentation logic from business logic. Because they are restricted to operations for a single entity, entity services are useful only when several components need access to such single-entity functionality.

Graphical content.

Activating Entity Services

Entity services are activated implicitly by components whose data access path is set to the entity service rather than directly to a DBMS. When such a component is activated, Uniface creates an entity service instance, which can then be used by other component instances that share the same transaction. An entity service that is activated in this way is automatically deleted when the original component instance is deleted.

Like all service components, entity services can also activated explicitly using the newinstance and activate ProcScript statements. An entity service activated this way must be explicitly deleted using the deleteinstance statement. Otherwise, it is not deleted until the application ends.

Entity services use entity parameters to receive requests from the session services to store and retrieve data.