Pattern
文章平均质量分 89
albertliangyg
这个作者很懒,什么都没留下…
展开
-
Facade , Adapter, Mediator, Gateway
· While Facadesimplifies a more complex API, it's usually done by the writer of the servicefor general use. A Gateway is written bythe client for its particular use. In addition, a Facade always原创 2011-12-23 14:24:19 · 744 阅读 · 0 评论 -
Fake Objects
Spring的创始人Rod Johnson关于伪对象:Fake Objects: objects in appearance, but which don’t exhibit some of the characteristics of objects:identity, state, and behavior。Let’s look at some common fake object转载 2016-05-31 11:11:36 · 409 阅读 · 3 评论 -
关于软件重用的思考
微观上遵循这样的路径:Inheritance->object composition->Generic;Pattern: 通过模式的重用解决各种各样的问题。宏观上: 1) 基于容器Container方式: 例如Servlet Container. 系统开发商已经构建了对象之间的关系,这些关系是设计的核心。应用开发人员在使用时采用继承的方原创 2016-05-05 17:33:02 · 909 阅读 · 8 评论 -
深入理解Interpreter模式
1)Interpreter模式是一个能给人留下深刻印象的模式。The Interpreter pattern describes how to define a grammar for simple languages, represent sentences in the language, and interpret these sentences.GoF书中的这句话是点睛之笔。1原创 2016-05-25 10:07:04 · 942 阅读 · 0 评论 -
关联类及如何在语言级别实现多元关联
An association class is used to model an association as a class. Association classes often occur in many-to-one and many-to-many associations where the association itself has attributes.As an ex原创 2015-01-26 16:20:54 · 1150 阅读 · 8 评论 -
系统分析中的决策问题
例如你设计一个图书馆系统原创 2014-11-21 14:31:12 · 518 阅读 · 2 评论 -
深入理解Composite模式
本文章的代码摘自Bishop的《C# 3.0 Design Patterns》1.Composite模式的UML图原创 2014-07-07 15:45:39 · 691 阅读 · 4 评论 -
The Container Comparison of C++ with C#
对于Container类来说,除了一般的CRUD操作以及容器类自身的特点以外,最重要的是理解其如何实现traverse(遍历), sort(排序),search(查找)等操作。1) C++采用generic algorithm。即将container看作是变化的,例如array, list, vector, queue等。2) C# 采用了纯粹的OO方式。对象本身实现IComparable原创 2013-01-16 10:30:19 · 337 阅读 · 2 评论 -
对于模式的思考
一是确定那些知识是需要掌握的,第二则是如何掌握。Pattern无疑是需要学习的,但事实是它很容易被遗忘,却很难在实际工作中熟练地运用。方法就是将解决问题的模式与实际中某个重要的应用match起来。1)Structural Pattern: Decorator, Proxy, Bridge 它们有一个共同特点,就是采用这些模式的客户端都以间接方式来访问原创 2012-12-30 15:09:40 · 376 阅读 · 2 评论 -
IComparable VS IComparer
1. IComparable public interface IComparable { int CompareTo(Object obj) } Return value: A value that indicates the relative order of the objects being compared. The re原创 2013-01-25 17:25:30 · 368 阅读 · 0 评论 -
Presentation Layer
Model2: ASP.NET MVC Framework和Struts Framework所使用的模式同ASP.NET Web Form的区别:1)FC会拦截用户的http请求,根据url来初始化相应的controller. 这是如何做到的?2)用户出发的事件不是由view来处理的而是由controller来处理的;3)The MVC framework不支持 postba原创 2013-01-05 18:24:23 · 1462 阅读 · 0 评论 -
IEnumerable vs IEnumerator
对对象的存储对每一种语言都很重要,例如C++中的Iterator, C#中的IEnumerator, Java中的Iterator等。C++:所有的集合类都定义了一个叫iterator的数据成员。可以通过此对象实现对集合的traverse.vector ivec(10,42);// loop using iterators to reset all the elements in iv原创 2012-11-01 15:48:13 · 436 阅读 · 0 评论 -
基于.NET的企业级软件开发
企业级开发最好基于一些成熟的框架,从而将主要精力集中到领域模型的设计上。1. UI与业务逻辑的隔离:在web领域可以采用ASP.NET MVC框架。2. 业务逻辑与DB的隔离:可以采用Entity Framework框架。3. 业务逻辑中涉及工作流的:可以WF框架。4. 分系统之间需要集成的:可以采用WCF框架。 在UI与业务逻辑的隔离上许多方法可以采用:API方式原创 2012-03-31 16:31:37 · 594 阅读 · 1 评论 -
Stateful Session Bean VS Entity Bean
作为一名更熟悉 .NET的人员来讲对于Bean比较陌生,但认真思考J2EE中讲到的各种规范.NET也应该具备,因为这毕竟是企业级开发共有的要求。1.理解Stateful Session Bean 比较好的一篇文章是http://www.jguru.com/faq/view.jsp?EID=917。方便起见原文拷贝在此以便学习。 Richard Monson-Haefel原创 2016-05-23 15:10:17 · 322 阅读 · 0 评论