什么是鬼设计模式? [英] What is the Ghost Design Pattern?

查看:95
本文介绍了什么是鬼设计模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人最近问了一个关于鬼设计模式的问题 - 我以前没看过。



什么是鬼设计模式,它如何实现?我只能在网页上找到代码片段。

解决方案

我曾经听过的唯一的参考设计模式Ghost位于 Lazy-Loading



由于Lazy加载仅涉及在实际需要时加载对象,所以您可以将其视为Ghost。您可以看到它的大纲,但在加载之前无法真正使用它。


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.

这篇关于什么是鬼设计模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆