1 / 12

OERA Service Message Requests and Responses

OERA Service Message Requests and Responses. Run. Publish. Interface. service messages, objects. System at rest. Client. Server. service message manager. IServiceProvider. IQueryEventHandler. IModelEventHandler. business component. service_interface.p. IMessageConsumer.

eljah
Download Presentation

OERA Service Message Requests and Responses

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OERA Service Message Requests and Responses

  2. Run Publish Interface service messages, objects System at rest Client Server service message manager IServiceProvider IQueryEventHandler IModelEventHandler business component service_interface.p IMessageConsumer model queries presenter IServiceProvider IMessageConsumer service adapter model service message manager

  3. Run Publish Interface service messages, objects Presenter makes request Client Server • The Model determines what it needs from its table contexts, queries and other data, and builds a request . • The Presenter may ask multiple Models for requests (typical use-case) service message manager IServiceProvider IQueryEventHandler IModelEventHandler business component service_interface.p IMessageConsumer model queries presenter IServiceProvider IMessageConsumer service adapter model • Model can also initiate request just for itself service message manager

  4. Run Publish Interface service messages, objects (detail) model builds a fetch request • One request message per Model • Request message can have multiple table requests IModelEventHandler table context model queries table context table context IFetchRequest TableName PageSize NumPagesLeft NextPos PrevPos LastUpdateTime • Each table in the Model has TableContext, which knows what data is in the Model • TableContextsare updated when response is received • Useful for paging (aka batching), filtering data • Used to create the table request, which is fleeting (request lifecycle only) fetch request msg IMessageConsumer table request model table request table request TableName (table context) where clause Data (eg. off-end) from Model’s queries can also be used to construct table requests (advanced stuff)

  5. Run Publish Interface service messages, objects SMM bundles & executes requests Client Server • The Presenter passes all the requests to the SMM which passes the requests to the service provider – in this case, a Service Adapter. • The SMM groups requests per Service. service message manager IServiceProvider IQueryEventHandler IModelEventHandler business component service_interface.p IMessageConsumer model queries presenter request msg request msg request msg IServiceProvider IMessageConsumer service adapter request msg model • Service adapter also gets non-request context (user context) and sends it along for the ride service message manager

  6. Run Publish Interface service messages, objects Service receives request Client • The ServiceAdapter passes the requests across the AppServer • Each request message is serialized • All messages are passed as an ABL array of memptrs • The data is passed as an array of ProDataSets (typically) • The service interface passes it’s requests to the server-side SMM. Server service message manager IServiceProvider IModelEventHandler IModelEventHandler business component service_interface.p IMessageRequestor model queries presenter request msg request msg request msg request msg request msg request msg IMessageRequestor IServiceProvider IMessageConsumer service adapter model • While typical service is a Business Entity, we may need to call an external service to complete the request service message manager request msg

  7. Run Publish Interface service messages, objects (detail) service builds a fetch response Client Server • Response message is created by business component • Business component pushes the data satisfying the request into the message IServiceProvider IModelEventHandler IModelEventHandler business component IMessageRequestor model queries presenter IMessageRequestor fetch response msg IMessageConsumer data access component table request model table request table response PDS data source TableName HasError ErrorText (table context) • Each table in business entity has data access component, which provides a table response • TableContexthere is same object as that stored in model

  8. Run Publish Interface service messages, objects Service sends response Client Server • The service interface receives the responses and passes them back to the client-side SMM. • Performs similar serialization as for request service message manager IServiceProvider IModelEventHandler IModelEventHandler business component service_interface.p IMessageRequestor model queries presenter IMessageRequestor IServiceProvider IMessageConsumer service adapter model response msg response msg response msg • The business component creates a response message and returns it to server-side SMM. • SMM collects all responses. response msg response msg response msg response msg response msg response msg service message manager response msg

  9. Run Publish Interface service messages, objects Client-side SMM processes responses Client Server • SMM looks up who is the consumer of the response message(s) and passes it on service message manager IServiceProvider IQueryEventHandler IModelEventHandler business component service_interface.p IMessageConsumer model queries response msg presenter • The Presenter decides what to do with the response – normally passes this off to the Model IServiceProvider IMessageConsumer service adapter response msg model The Model publishes an event when it receives a response. The Model’s queries take note and decide whether they need to reopen or not service message manager response msg

  10. Run Publish Interface service messages, objects Model queries reopen & notify Client Server service message manager IServiceProvider IQueryEventHandler IModelEventHandler business component service_interface.p IMessageConsumer model queries presenter IServiceProvider IMessageConsumer service adapter model • The Model reopens any queries it needs to. This publishes the IQuery:QueryOpenedevent. • Presenter listens to this event and notifies the View (and anyone else who might be interested) service message manager response msg

  11. “Opportunities” • [OK] Service message serialization • Default binary protocol; use JSON? • Cost, ease-of-understanding • ModelEventHandler • Separate client (add, save, delete, navigate) and server (fetch, commit) events? • Does presenter need it? • IModelEvents • generalised pattern for events? I<component>EventHandler and I<component>Event • Split server & client? • [NO] Allow response-less requests? • Eg “save”: do we care if everything is OK?

  12. Run Publish Interface service messages, objects DEPR Client-side SMM completes request Client Server Once all response messages have been processed, the message requestor is notified. This is the presenter in this case; it notifies the Models that all requests are done. At this point we’re done with the bundle and it’ll be GC’ed service message manager IServiceProvider IModelEventHandler IModelEventHandler business component service_interface.p IMessageRequestor model queries presenter IServiceProvider IMessageConsumer service adapter model service message manager response msg The Model reopens any queries it needs to.

More Related