hdolder.com srl  

Software R&D
 

   hdc Home    |    Content    |    Blog    |    Director    |    Contact    |    mail us   

 

    
Posted on July 11, 2013 by Herman Dolder

The main obje of the M&P plataform is to maximize the adaptability of applications in situations of high complexity and rapidly changing demands.

The schema of Distributed Processing of M&P provides the flexibility and modularity required to achieve this objective.

In M&P different parts of an application can run simultaneously on two or more computers. The parts communicate with each other over peer-to-peer (P2P) Real Time channels mainly on Internet.

The peer-to-peer channels of M&P are based on WebSockets available in a wide range of Operating Systems.

WebSockets


WebSockets provide Real Time full-duplex communications channels over a single TCP connection.

WebSockets are designed to communicate web browsers and web servers, but they can be used even for local inter-process communications.

To establish a WebSocket connection, the client part sends a WebSocket handshake request, and the server part sends a WebSocket handshake response.

Only for the handshake the client and server roles exist, after the handshake both parts are peers and any of them can initiate a conversation.

For a connection the server part must be listening. This stablishes an startup order of precedence that is specially important when creating "networks of peer servers" (servers interconected as peers).

Networks of peer servers

M&P allows to organize networks of peer multiuser servers that communicate among them and with the clients through the P2P channels. As we will see M&P introduces the concept of "Servers as BLOCKS" (SaB).

A client can communicate with several M&P servers simultaneusly.

In the current version of development and for demonstrations we use five "M&P logical servers", two implemented in the Node.js platform and three implemented in the .NET 4.5 platform. These "logical servers" can reside in one or more computers ("physical" servers").

Name Platform Port # Main Putpose
MPWS Node,js

8184

Mini Web Server for serving the M&P Base Page and associated objects.
MPNODE Node,js

8181

Serving Plugins, Files. Notifications and Calculations.
MPNXT .NET

8183

Extends the MPNODE server with .NET functionality.
MPNET .NET

8181

.NET alternative for MPNODE
MPSVR .NET

8182

DB, IMDB, User Authentication and Authorization

The Node.js servers are ultraportable, bein able to reside in mobile devices .

Node.js operation reprpduced in .NET

For simpliciity and efficiency the M&P .NET servers can emulate the full-asynchronous non-blocking single-thread operation of Node.js.

We will describe the function of each of these servers in more detail in future posts.

M&P Runtime and specialized BLOCKS


In M&P the peer parts use the M&P Runtime (MPR) and a set of specialized BLOCKS that implements the interfaces IBChannel, IBSocket and IBSerializer.

A BLOCK that implements the IBSocket interface encapsulates the functionality of a WebSocket. (or of any other socket type).

A BLOCK that implements the IBSerializer interface encapsulates the functions of BSX serialization, data encryption and data compression, and the corresponding inverse operations.

In M&P the remote interoperation is based in the remote evaluation of BScript expressions (BSX). The remote MPR provides the BScript Processor for these evaluations.

A BLOCK that implements the IBChannel interface has the responsability of preparing and sending a BSX for its remote evaluation, and to receive requirements and callbacks (also in form of BSXs) from the associarted remote part.

An IBChannel utilizes the the IBSerializer and the the IBSocket BLOCKS.

In a symmetrical manner the remote part compose a set of BLOCKS that also implements the interfaces IBChannel, IBSocket and IBSerializer.

Servers as BLOCKS (and Clients as BLOCKS)

The IBChannel BLOCKS can be viewed as local proxies of the remote processor that provide a high level of abstraction of the remote processor operation.

In essence, the operation of a IBChannel BLOCK is similar to the operation of the BScript processor, which facilitates the reallocation of functions among clients and servers.

BXml and BXaml are also available in .NET

We have ported the BXml and BXaml processors we developed in Javascript (TypeScript) to the .NET platform and the following code shows the BLOCKS composition in BXaml declared inside the TopBoard of an M&P server. The BXaml code is exactly the same for the Node.js as for the .NET servers.

<mpXaml xmlns:mpx="mpx"
        xmlns:blkx="blkx">
  <blkx:BBoard id="TopBoard">
    <mpx:BuiltinServices id="*BINS"/>
    <mpx:XMPeH5JServerAXT id="*APPS"/>
    <blkx:BRegion Description="channel-set">
      <mpx:BChannelSVR id="*CH">
        <BChannelSVR.Serializer>
          <mpx:BChannelSerializer/>
        </BChannelSVR.Serializer>
        <BChannelSVR.SOCKET>
          <mpx:BSocketSVR port="8182"/>
        </BChannelSVR.SOCKET>
      </mpx:BChannelSVR>
    </blkx:BRegion>
    <mpx:BAzMan id="*AzMan"/>
  </blkx:BBoard>
</mpXaml>    

The corresponding BXaml code in the H5J client is

<mpXaml xmlns:blkx="blkx"
        xmlns:mpx="mpx">
  <blkx:BBoard id="*TopBoard">    
.....    
<mpx:BChannelCLI id="*CHDB">
        <BChannelCLI.Serializer>
          <mpx:BChannelSerializer/>
        </BChannelCLI.Serializer>
        <BChannelCLI.SOCKET>
          <mpx:BSocketCLI/>
        </BChannelCLI.SOCKET>
      </mpx:BChannelCLI>    
.....    
  </blkx:BBoard>
</mpXaml>    
    

Dynamic Loading of Plugins

In an M&P application some (as many as appropriate) BLOCKS can be loaded dinamically on demand from an M&P server.

Conclusion

M&P allows us to distribute the application's functionality among the M&P clients and the M&P servers with great freedom, as well as to redistribute functions quickly in case of changing requirements or of performance issues.

And, in critical processes in regard to security, M&P allows us to run the critical code on the servers, without the need to download it to the clients.

See some BXaml H5J images ...

 

 

TBW The BLOCKS World 2015  hdolder.com srl
C30711
2015-06-26