Tip:
Highlight text to annotate it
X
Okay, majority voting is for proxy I believe but
let's talk through each one of these one at a time. What kind of
a design pattern is being represented when the fake web is used
to stub and external service API? Regarding adapter and facade,
adapter is, I need to change the way the� remote thing looks but
of course, we're not doing that, right? Fake web is almost the
opposite, it's actually making it look the same as the remote
thing looks but allowing you to give� a canned reply� so it's
not an adapter. And if it's not an adapter, it certainly can't
be a facade which is like an adapter but also simplifying the
API but this is really like� a� one for one� replacement.� Given
that it's a one for a one replacement, is it more like a null
object or is it more like a proxy? Remember the goal of a null
object is to essentially give you a way to avoid having separate
code paths when the object you wanted doesn't actually exist,
right? So a null object would be, you're trying to call an
external service but there are some cases where the actual
service you're calling is not a service or doesn't exist, then
you could create a null object stand- in so that you could have
the same code path in all cases. But what's� actually happening�
with� fake web is really more like a proxy because you're hiding
the fact that normally this would be a remote call, you are
going to intercept that remote call and do something different,
right? You are providing the same APIs but you provided a
different behavior and in this case, the reason is to facilitate
testing so you don't have to go over the network.� The use of
fake web for stubbing an external request is most like a proxy
given the patterns we've seen, this is the one that it's most
like. I hope everybody believes me.