CRUD actions: create and update in 1 save-method or not?

Posted by peggycole on 20-Nov-2015 06:58

In our back end we have business entities that are accessed via both an OpenEdge desktop application (Telerikforms/controls using PDSOE) and a Kendo UI mobile application (using REST web service).

In the desktop application, the controller on client side requests the dataset of the business entity (readCustomer) and the viewer shows the content of the dataset. The user can create/modify/delete records and save the dataset. The controller asks the business entity to save the changes of the dataset (saveCustomer). The actual saving happens in the business entity with the built-in save-changes-method of the dataset. Because of the before-table and row-state of the temp-table-records, the save-changes method does everything we want it to do. So we do not need a seperate method voor createCustomer and updateCustomer.

On the other hand when our mobile application invokes the saveCustomer method, there is no before-table available in the temp-table, the row-state is not set for created/updated records. So we added the createCustomer and updateCustomer methods in the business entity to make creating and updating possible from the REST web service.

This is working but it just feels not good having 2 different ways of dealing with CRUD-actions: 1 via saveCustomer and 1 via the separated methods createCustomer and UpdateCustomer.

Has anyone experience with this problem? What is the "best practice"? One of the above or even something else (e.g. is it possible to receive the before-table from within the Kendo UI?)

Tnx,

Peggy

All Replies

Posted by Mike Fechner on 20-Nov-2015 07:52

You're not using a more recent version of the JSDO? That supports before-tables. And works nicely with Kendo UI.

This thread is closed