DataServer 1st Version

This commit is contained in:
Michael Schimmel
2025-06-06 12:43:51 +02:00
parent f70cfe0ec1
commit 98de7176c3
9 changed files with 271 additions and 50 deletions
+48
View File
@@ -0,0 +1,48 @@
unit Myc.Trade.Node;
interface
uses
System.SysUtils;
type
// Base interface for all objects created by an INode factory.
ITradeObject = interface
['{B8A29A67-272E-456A-A816-A19A76E43213}']
end;
// Represents a node in the trading graph, acting as a factory for a trade object.
INode = interface
['{E879B5E4-3A4E-434A-8A4F-A9F71B0B7E1C}']
function GetCaption: string;
// Factory method to create the runtime object.
function CreateObject: ITradeObject;
property Caption: string read GetCaption;
end;
// Abstract base class for all node implementations.
TNodeBase = class abstract(TInterfacedObject, INode)
protected
fCaption: string;
function GetCaption: string;
public
constructor Create(const Caption: string);
function CreateObject: ITradeObject; virtual; abstract;
end;
implementation
{ TNodeBase }
constructor TNodeBase.Create(const Caption: string);
begin
fCaption := Caption;
end;
function TNodeBase.GetCaption: string;
begin
result := fCaption;
end;
end.