-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Design Notes
The intention to is allow clients to connect to a wide range of exchanges offering trade opportunities. This is not limited to Bitcoin, although the first exchange happens to use the BTC currency.
There are 2 main approaches: fully self-contained, or extensible. Existing APIs addressing similar problems (such as JDBC for relational databases) prefer the extensible approach. This implies that XChange will provide a collection of interfaces that an upstream provider will implement for their exchange. Clearly, XChange will initially create basic versions of these providers, but eventually it is hoped that exchange owners will contribute them.
The entry point to the overall API Requires various options (authentication, token support etc) so consider SessionOptions parameter object. Has a transport type (asynchronous, synchronous, streaming). Has a lifecycle (start, stop). Runs in own thread pool. Supports multiple services from the exchange.
The entry point to an exchange service (e.g. listing prices against a particular index etc). Has a lifecycle (start, stop). Sends/receives messages to exchange/listeners.
The DTO for encoding a message to and from the exchange. Probably defined internally as a Map<String,String> for field and resource with appropriate getEntryAsXXX() methods to support different expected internal representations (e.g. JSON, double, text, etc). Treat as immutable. Could consider providing an Enum for standard key lookup.
div
{
color: white;
background-color: 009900;
margin: 2px;
font-size: 25px;
}
span
{
color: black;
background-color: gray;
margin: 5px;
font-size: 25px;
}
</style>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
<span>span-tag</span>
<span>span-tag</span>
<span>span-tag</span>
<span>span-tag</span>