WebMAPService
to perform the following actions:Changed
models to be synchronized with the back-end's observable models.WebMAPService
creates the following json and send it to the back-end.Changed
array: since there is no models that were modified, the array is empty.Actions
array: contains the list of actions that should be processed on the back-end.ExpiredSessionMiddleware
to verify if the session has already expired, then RequestQueueMiddleware
to enqueue the request if the server is already processing some other requests coming from the same session; if no requests are in the queue, then it will proceed to the next middleware. The CoreServicesMiddleware
initializes all the services required to process a request. And finally,InboundMiddleware
will process the request and create the response for the request.InboundMiddleware
is the key responsible for processing any kind of request coming from the client side, so let's expand in detail about this middleware.FormattingService
InboundMiddleware
gets the information of the request, decodes this information and creates a Request
object that contains the list of list of Changed
DTO models and the list of Action
. Then, this Request
will be used by the EntranceService
.EntranceService
EntranceService
will process the list of Changed
DTO models and the list of Action
. An is an action sent to the server in a request to be executed. Each Action
contains a ReceiverId
(the Identifier of the sender), Name
(the Event Name) and Arguments
(the arguments of the event).Changed
DTO models: In order to synchronize the list of Changed
DTO models with the corresponding observable models, the service use MapperService
to invoke ApplyChanges
of each Mapper
associated with the Changed
model.Action
: In this case of clicking a button, the ReceiverId
is the id of the Button
, the Name
is "Click" and with no arguments. Given this Click Action
, the service will invoke the following user code:TrackingService
is tracking all the Observable Models. If an observable's property has been modified, the TrackingService
will register the observable into the trackable array. In this example code above, the label1
will be registered.DeliveryService
DeliveryService
creates the response back to the client side by means of the next steps:TrackingService
retrieves all the tracked observable models.MappingService
takes those models and instantiates the corresponding Mapper
to start calling one by one the Map
method. For example, in this case, since label1
has been modified. The MappingService
instantiates LabelMapper
, calls the Map
method and returns the Mobilize.Web.DataTransfer.Label
.DeliveryService
will finally, create the Response
object. And populates the objects Added
, Changed
, Removed
properties array. For example, the label1
's new modified text should be inside the Changed
array.FormattingService
will format the Response
into a JSON object.WebMAPService
will process the json above, and synchronize the front-end observable models with each of the models in the Changed
array. And finally, the components should be refreshed and show the new Hello World text.