# 從IoC的角度來看Observable ,Observer 與 Rx

```
public interface IObservable<T>
{
    IDisposable Subscribe(IObserver<T> observer);
}
```

這是Observable 與 Observer 所定義的關係

所以

From Some IObservable\<T> maybe return oo.oo.oo.IObservable\<T>;

IObservable\<T>.xx.xx.xx.Subscribe(IObserver\<T>)

其實就是

```
public class MyClass<T> : IObservable<T>
{
    private IObservable<T> observable;
    public Observable(IObservable<T> observable)
    {
        this.observable = observable;
    }

    IDisposable Subscribe(IObserver<T> observer)
    {
        observable.xx.xx.xx.Subscribe(observer);
    }
}

new MyClass<T>(oo.oo.oo.IObservable<T>);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dcvsling.gitbook.io/tech-book/md/topic/reactive-programming/observer-and-observable-1/ioc-point.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
