Home › Per Nystrom (Service Locator), the Service Locat…
Per Nystrom (Service Locator), the Service Locator pattern provides which feature?
AReflection-only RTTI dispatch always
BCompile-time IoC injection mechanism only
CStrict singleton enforcement at all times
DGlobal access with swappable implementation
Answer & Solution
Correct answer: D. Global access with swappable implementation
Nystrom Ch. Service Locator: a global registry lookup returns a service (e.g. audio). Implementation can be swapped (real, null, log).
Related questions
Per Nystrom (Singleton chapter), Nystrom's view of the Singleton pattern in games is best Per Nystrom (Spatial Partition), structures like quadtrees / BVH speed up which game operaPer Nystrom (Event Queue), queueing events between producer and consumer DECOUPLES them inPer Nystrom (Double Buffer), separating current vs next-frame state prevents which artifacPer Nystrom (Object Pool), reusing pre-allocated objects instead of new/delete each frame Per Nystrom (State pattern), modelling a character with 'standing', 'jumping', 'ducking' bPer Nystrom (Command pattern), a 'Command' object typically does which?Per Nystrom (Observer), the Observer pattern is also commonly known by which other name?