0

(C# で .net 環境に取り組んでいます)

複数のデータ提供エージェントを管理する適切なサーバーを作成しています。ここでは、いくつかの擬似コードを使用して説明を簡単にします。

class Server
{
  ServerManagementGUI server_gui; // a GUI to display all sort of Server related data

  MonitorAgent m_agnt;
  DataAgent    d_agnt;
  // will not be allocated or init at C'tor

  public write_data1();
  public write_data2();

  public get_data5();

  // etc
}

class Agent
{
// handles generic communication and threading issues

// a reference to Server is required to write 
// the data to it's private data structures. 
// please note that a delegate to one or more function will not suffice here.

Agent(Server server); 

}

class MonitorAgent : Agent
{
 // handles task spesific issues

}

class DataAgent : Agent
{
 // handles task spesific issues
}

エージェントがデータを非同期的に収集し、通信とスレッドの問題を処理し、Serverのメソッドを使用してデータ構造を埋めるという考え方です。上記が「良い習慣」の設計であるかどうかはわかりません。

私たちのデザインについて他にアイデアや洞察があればお知らせください。

更新: Serverいくつかの情報に権利を与える GUI オブジェクトもあります。エージェントは実際にデータを生成する (Web から取得する、またはハードウェア センサーから取得する) ため、 のメソッドに直接アクセスできる必要がありますServerManagementGUI。各エージェントは と の異なるメソッドとプロパティを使用ServerServerManagementGUI考えました。

4

1 に答える 1