Someone recently asked a question about the Ghost Design Pattern - I have not seen this before.
What is the Ghost Design Pattern and how is it implemented? I can only find snippets on the web in reference to it.
The only reference I've ever heard to a Design Pattern and 'Ghost' is in Lazy-Loading.
Since Lazy-loading involves only loading the object when it's actually needed, you can think of it as a 'Ghost' until then. You can see its outline, but can't really use it until it's loaded.
Ghosts are mentioned in PoEAA, pp 202, 206-14. A ghost is a lazy loaded object that contains just enough info to instantiate itself on demand. They can be useful because they can trigger a bulk load of similar ghosts on the first access if they register themselves with a loader (dunno if Fowler mentions that bit though).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With