Skip to content

REST-ifying existing model layers (ie. %ZEN.DataModel.ObjectDataModel) #21

@copperschnack

Description

@copperschnack

In our application, we stripped out a model layer for accessing our %Persistent classes. The model classes inherit from %ZEN.DataModel.ObjectDataModel. They include business logic as triggers on loading or data manipulation, as well as in dedicated methods. We would like to reuse our model layer in a RESTful API. This would enable an evolutionary migration to alternative web frontend frameworks, while the current UI stays fully functional.

CRUD operations could work as follows, distinguishing (R)eading one (R-1) and querying many (R-n) entities. The latter should be realized via %Persistent classes, bypassing the model's initialization logic invoked when loading a dedicated entity for viewing and/or editing.

%ZEN.DataModel.ObjectDataModel

  • R-1: HTTP GET, (single ID) via %OnLoadModel
  • C, U: HTTP POST/PUT, via %OnStoreModel
  • D: HTTP DELETE, via %OnDeleteSource

%Persistent

  • R-n: HTTP GET, query "%pkg.isc.rest.model.adaptor flavour"

With isc-rest being a brilliant approach for REST-ifying existing %Persistent classes, extending its functionality for architectures with model layers could be beneficial for many applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions