cancel
Showing results for 
Search instead for 
Did you mean: 

odata approach for simple business case

Former Member
0 Kudos

Table with measurements

  1. 1) Client reads dataset  “ValueToMeasureSet” :

ID

ValueToMeasure

MeasuredValue

AreValuesInRangeStatus

Id1

ValueToMeasure1

Id2

ValueToMeasure2

  1. 2) Client updates data set to serwer:

ID

ValueToMeasure

MeasuredValue

AreValuesInRangeStatus

Id1

ValueToMeasure1

1300

Id2

ValueToMeasure2

1800

  1. 3) Client wants to know AreValuesInRangeStatus, client reads dataset one more time

ID

ValueToMeasure

MeasuredValue

AreValuesInRangeStatus

Id1

ValueToMeasure1

1300

Ok

Id2

ValueToMeasure2

1800

Not ok

Am I right that there should be Odata CRUDQ operations like below?:

  1. 1) Query
  2. 2) Update
  3. 3) Query

Please comment this approach with pointing good practices. Maybe i should change approach ?

I thought about Function import operation (it could be one call instead of 2) and 3)), but Function import support only simple type as input.



BR

Lucas

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
Active Contributor
0 Kudos

ValueToMeasure is an entity or a property here? What about MeasuredValue

Providing your data model in detail can help you to get useful answers.

AshwinDutt
Active Contributor
0 Kudos

Hello Lucas,

In my opinion the below would be the standard approaches which i will follow based on the use cases u have shared.

I am assuming things here to just share my ideas.

Assuming ID as key.

I will create a single entity to accomplish this which will have all the properties as below.

ID - make it as a Key

ValueToMeasure

MeasuredValue

AreValuesInRangeStatus


1) Client reads dataset  “ValueToMeasureSet” :

For this use case,

a. Implement READ/Get_Entity.


b. Since we may have more than once entries, say


ID1

ID2

...

ID-n


I will operate my READ in BATCH mode and get the results.


2) Client updates data set to serwer:

For this use case,

a. Implement UPDATE/UPDATE_ENTITY.

b. Since we may have multiple entries to be updated, say


ID1 , ValueToMeasure1, MeasuredValue1

ID2 , ValueToMeasure2, MeasuredValue2

...

ID-n , ValueToMeasure-n, MeasuredValue-n

I will operate my Update in BATCH mode and update all the entries.


3) Client wants to know AreValuesInRangeStatus, client reads dataset one more time

For this case,

I will use the approach which i shared in the 1st use case.

Where i will READ all those updated values in a BATCH mode by just passing ID's.

--------------------------------------------------------------------------

I can also think if feasible U can Club ur UPDATE and READ operation in a BATCH mode ( Batch Retrieval & Change Set ).

Where update and read for all the entries will happen in a single request ( i mean multiple operations [update,read] in a single payload )

Regards,

Ashwin