Question

I know EF use Proxy Pattern to implement lazy loading.

1.Stand Proxy Pattern:

enter image description here

In the proxy pattern,[Proxy] will not be inherited from [RealSubject].

2.EF

In lazy loading,[Proxy] class will be inherited from [RealSubject].

So this is not exact the same as stand Proxy Pattern.

But why they called it Proxy Pattern?

Était-ce utile?

La solution

The reason is in the name: it is a pattern, not a rigid rule. It is a concept, which it is described by a known name, so people who know the pattern will understand it although the implementation differs in the details.

This is valid for patterns in any domain.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top