<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_HeroBeast_分类_05.设计模式</title><id>http://feed.cnblogs.com/blog/u/15568/category/121161/rss</id><updated>2012-05-27T14:09:18Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/HeroBeast/category/121161.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/15568/category/121161/rss"/><entry><id>http://www.cnblogs.com/HeroBeast/archive/2011/07/29/2121576.html</id><title type="text">生成18位不重复的ID</title><summary type="text">思路：前15位是有时间串组成,后三位是由3位随机数组成：yyyyMMddHHmmssf+xxx生成随机数的类如下：using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;using System.Collections;namespace WindowsFormsApplication5{public class IDTest{private static readonly object SequenceLock = new object</summary><published>2011-07-29T15:23:00Z</published><updated>2011-07-29T15:23:00Z</updated><author><name>HeroBeast</name><uri>http://www.cnblogs.com/HeroBeast/</uri></author><link rel="alternate" href="http://www.cnblogs.com/HeroBeast/archive/2011/07/29/2121576.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/HeroBeast/archive/2011/07/29/2121576.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/HeroBeast/archive/2009/04/07/1431253.html</id><title type="text">SOA快速指南 1 2 3，第 3 部分: 服务实现及架构设计</title><summary type="text"/><published>2009-04-07T14:42:00Z</published><updated>2009-04-07T14:42:00Z</updated><author><name>HeroBeast</name><uri>http://www.cnblogs.com/HeroBeast/</uri></author><link rel="alternate" href="http://www.cnblogs.com/HeroBeast/archive/2009/04/07/1431253.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/HeroBeast/archive/2009/04/07/1431253.html"/><content type="text"/></entry><entry><id>http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050982.html</id><title type="text">单件模式（Singleton Pattern）</title><summary type="text">Singleton模式要求一个类有且仅有一个实例，并且提供了一个全局的访问点。这就提出了一个问题：如何绕过常规的构造器，提供一种机制来保证一个类只有一个实例？客户程序在调用某一个类时，它是不会考虑这个类是否只能有一个实例等问题的，所以，这应该是类设计者的责任，而不是类使用者的责任。 从另一个角度来说，Singleton模式其实也是一种职责型模式。因为我们创建了一个对象，这个对象扮演了独一无二的角色，在这个单独的对象实例中，它集中了它所属类的所有权力，同时它也肩负了行使这种权力的职责！ </summary><published>2008-01-24T01:24:00Z</published><updated>2008-01-24T01:24:00Z</updated><author><name>HeroBeast</name><uri>http://www.cnblogs.com/HeroBeast/</uri></author><link rel="alternate" href="http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050982.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050982.html"/><content type="text">Singleton模式要求一个类有且仅有一个实例，并且提供了一个全局的访问点。这就提出了一个问题：如何绕过常规的构造器，提供一种机制来保证一个类只有一个实例？客户程序在调用某一个类时，它是不会考虑这个类是否只能有一个实例等问题的，所以，这应该是类设计者的责任，而不是类使用者的责任。 从另一个角度来说，Singleton模式其实也是一种职责型模式。因为我们创建了一个对象，这个对象扮演了独一无二的角色，在这个单独的对象实例中，它集中了它所属类的所有权力，同时它也肩负了行使这种权力的职责！ </content></entry><entry><id>http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050975.html</id><title type="text">观察者模式（Observer Pattern） </title><summary type="text">在软件构建过程中，我们需要为某些对象建立一种“通知依赖关系” ——一个对象（目标对象）的状态发生改变，所有的依赖对象（观察者对象）都将得到通知。如果这样的依赖关系过于紧密，将使软件不能很好地抵御变化。使用面向对象技术，可以将这种依赖关系弱化，并形成一种稳定的依赖关系。从而实现软件体系结构的松耦合</summary><published>2008-01-24T01:21:00Z</published><updated>2008-01-24T01:21:00Z</updated><author><name>HeroBeast</name><uri>http://www.cnblogs.com/HeroBeast/</uri></author><link rel="alternate" href="http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050975.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/HeroBeast/archive/2008/01/24/1050975.html"/><content type="text">在软件构建过程中，我们需要为某些对象建立一种“通知依赖关系” ——一个对象（目标对象）的状态发生改变，所有的依赖对象（观察者对象）都将得到通知。如果这样的依赖关系过于紧密，将使软件不能很好地抵御变化。使用面向对象技术，可以将这种依赖关系弱化，并形成一种稳定的依赖关系。从而实现软件体系结构的松耦合</content></entry></feed>
