Remoting Architecture

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
Line 41: Line 41:
* Remote proxies should always use the connection object to send JSON packets
* Remote proxies should always use the connection object to send JSON packets
* The connection is singleton it'll be probably attached to the global ''Firebug'' object
* The connection is singleton it'll be probably attached to the global ''Firebug'' object
 +
 +
== BTI ==
 +
This section describes the current BTI (Browser Tools Interface) concepts. These concepts should be reviewed and refactored as necessary.
 +
 +
=== Browser ===
 +
Proxy to a debuggable web browser. A browser may be remote and contain one or more JavaScript execution contexts. Each JavaScript execution context may contain one or more compilation units. A browser provides notification to registered listeners describing events that occur in the browser.
 +
 +
[[Image:Bti-browser.png‎]]
 +
 +
 +
=== JavaScriptTool ===
 +
JavaScriptTool implements API related to script debugging. It serves similar purpose as a ''proxy'' object. It's currently placed between the Script panel and ''Firebug.Debugger'' module.

Revision as of 13:25, 15 August 2012

This page is intended to summarize basic architecture concepts for Firebug (and Firebug extensions) remote capabilities (such as remote debugging or remote HTTP monitoring).

Contents

Resources

Proxy

The proxy object represents a connection between a panel (front end) and a module (back end).

The proxy has essentially two implementations:

  • Local - direct API calls
  • Remote - communication over TCP/IP protocol

Panel-proxy-module.png

  • Panel (a view) should never use Module (a service) directly
  • The communication should always be done through the current proxy
  • Each Panel should have its own proxy that implements API of the remote module (service)
  • There can be also proxy objects used by non-panel objects, e.g. the Profiler

Here is a more detailed diagram with local and remote proxies.

Local-and-remote-proxies.png

  • Panel object at the top is referencing its proxy object
  • The proxy implementation can be local or remote
  • Local proxy uses direct API calls (in process) and asynchronous callbacks
  • Remote proxy uses TCP/IP connection to communicate with the back-end using JSON packets
  • The remote communication is based on RDP
  • The server side implements Actor, which is responsible for communication with specific proxy
  • The actor is finally consuming back-end Module (service) API


Connection

Connection object is responsible for sending properly setup packets to the server and handling all response packets. This object is also responsible for handling any errors (or error packets) that can occur during the communication.

Proxy-connection.png

  • Remote proxies should always use the connection object to send JSON packets
  • The connection is singleton it'll be probably attached to the global Firebug object

BTI

This section describes the current BTI (Browser Tools Interface) concepts. These concepts should be reviewed and refactored as necessary.

Browser

Proxy to a debuggable web browser. A browser may be remote and contain one or more JavaScript execution contexts. Each JavaScript execution context may contain one or more compilation units. A browser provides notification to registered listeners describing events that occur in the browser.

Bti-browser.png


JavaScriptTool

JavaScriptTool implements API related to script debugging. It serves similar purpose as a proxy object. It's currently placed between the Script panel and Firebug.Debugger module.

Personal tools