Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
常に1人の被写体を観察しているオブザーバーが1人だけの場合でも、オブザーバーパターンを使用しますか?
または、上記のシナリオにより適した別のパターンはありますか?
オブザーバー パターンは引き続き適しています。ただし、パターンは決まったものではありません。オブザーバーのコレクションが必要ない場合は、少し単純化できます: オブザーバー-->サブジェクトの関連付けを 1:1 として実装します。