惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
腾讯CDC
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security
博客园 - Franky
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
B
Blog RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Simon Willison's Weblog
Simon Willison's Weblog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
S
Schneier on Security
MyScale Blog
MyScale Blog
The Last Watchdog
The Last Watchdog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Troy Hunt's Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
K
Kaspersky official blog
F
Fortinet All Blogs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
B
Blog
有赞技术团队
有赞技术团队
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Latest news
Latest news
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Help Net Security
Help Net Security
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
J
Java Code Geeks

博客园 - gyhanonline

Function Point in Vbscript Window API in QTP Simulate click event using widows API. Static Constructor A Go Set program A Go Set program About Inherit Code for Inter-process communicate Integrity Level Test for publish blog by word 2007 托管为什么安全 The usage of intellisense in Vs .net 2005 我的面试(七) 我的面试(六) 我的面试(五) 我的面试(四)补充1 我的面试(四) 我的面试(三) 我的面试(二)
关于singlton的一些问题
gyhanonline · 2007-11-01 · via 博客园 - gyhanonline

用C#写一个符合singlton的类应该是很容易的。singlton的基本思想就是限制对象个数只能有一个,这样的好处是1.防止实例化多个对象从而减少系统开销。2.对于要求唯一对象的情况,可以减少多对象的错误和冲突。
而在.net中似乎静态类也是不允许实例化对象的,那么我将静态类当作一个对象来使用岂不就满足了singlton的要求了?!
[b]我的问题:[/b]
符合singlton的类同静态类的区别是啥?换句话说,静态类是否符合singlton?

我找到了一个区别是:符合singlton的类是可以继承的,而静态类则不能继承。

那么在使用上,它们之间还有啥区别呢?最好能举例说明。