TypeScript Templates Cloud_Service - samchon/framework GitHub Wiki

Cloud Service

A template module for Cloud Service.

References

Class Diagram

Protocol - Cloud Service

API Documents

Source Codes

Basic Classes

Server

A cloud server.

The Server is an abstract server class, who can build a real-time cloud server, that is following the web-socket protocol. Extends this Server and related classes and overrides abstract methods under below. After the overridings, open this cloud server using the open() method.

User

An user.

The User is an abstract class groupping Client objects, who communicates with remote client, with same session id. This User represents a remote user literally. Within framework of remote system, an User corresponds to a web-browser and a Client represents a window in the web-browser.

Extends this User class and override the createClient method, a factory method creating a child Client object. I repeat, the User class represents a remote user, groupping Client objects with same session id. If your cloud server has some processes to be handled in the user level, then defines method in this User class. Methods managing account under below are some of them:

The children Client objects, they're contained with their key, the sequence number. If you {@link User.erase erase} the children Client object by yourself, then their connection with the remote clients will be closed and their destruction method will be called. If you remove all children, then this User object will be also destructed and erased from the parent Server object.

Client

A driver of remote client.

The Client is an abstract class representing and interacting with a remote client. It deals the network communication with the remote client and shifts Invoke message to related User and Service objects.

Extends this Client class and override the createService method, a factory method creating a child Service object. Note that, Client represents a remote client, not an user, a specific web page or service. Do not define logics about user or account information. It must be declared in the parent User class. Also, don't define processes of a specific a web page or service. Defines them in the child Service class.

Service

A service.

The Service is an abstract class who represents a service, that is providing functions a specific page.

Extends the Service class and defines its own service, which to be provided for the specific weg page, by overriding the replyData() method. Note that, the service, functions for the specific page should be defined in this Service class, not its parent Client class who represents a remote client and takes communication responsibility.

Example Project

Chatting