-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST-ifying existing model layers (ie. %ZEN.DataModel.ObjectDataModel) #21
Comments
@copperschnack one immediate challenge here: are the field names used when querying in the |
@isc-tleavitt IMHO "model terms". They should be determined in the model by a class query which sets the required column aliases. EDIT: The class query parameters would determine the filtering options available. |
@copperschnack just to throw another option out there, could use a property parameter - e.g., SQLALIASOF. Motivating example:
How does that approach sound? |
@isc-tleavitt What do you think about that? |
We'd allow SQLALIASOF to be an expression - I think that should generally work. To be clear, the main purpose of this is filtering query results. The model representation will be based on loading the model from the source object by ID, where the query returns the IDs in question. |
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.The text was updated successfully, but these errors were encountered: