博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2008年11月26日

摘要: 单件模式(Singleton) 适用于下面的情况:逻辑上仅仅只有一个实例才可以保证逻辑的正确性。 通过共享减少内存的使用,作为应用中一些集中的统一数据机制存在。 减少因为频繁的构造过程带来应用上的性能损失 using System; namespace VisionLogic.DesignPattern.Practice ...{ public class Singleton ...{ priva... 阅读全文

posted @ 2008-11-26 15:33 yuanws 阅读(171) 评论(0) 推荐(0) 编辑

摘要: 1。 Controllers/HomeController.cs//基本数据获取public ActionResult Index() { ViewData["Title"] = "Home Page"; ViewData["Message"] = "Welcome to ASP.NET MVC!"; ViewData["users"] = Models.home.GetUserList(); /... 阅读全文

posted @ 2008-11-26 11:33 yuanws 阅读(223) 评论(0) 推荐(0) 编辑

摘要: namespace ReflectionFactoryTest { public interface IFruit { void Product(); } public class Apples:IFruit { #region IFruit 成员 public void Product() { ... 阅读全文

posted @ 2008-11-26 11:04 yuanws 阅读(380) 评论(0) 推荐(0) 编辑