摘要: 1. The following are some of the most important constitutions of patterns(architecture)[1]:1.1 Abstraction1.2 Encapsulation1.3 Information Hiding1.4 Modularization 1.4.1 Modularization is concerned wi... 阅读全文
posted @ 2009-06-14 20:25 Tyrael 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1. 架构最基本最简单的思想就是分层, 也有人说是责任分离.2. 适应软件变化就是引入中间层.Chapter 2摘要 PⅠ:- The Layers architectural pattern helps to structure applications that can be decomposed into groups of subtasks in which each grou... 阅读全文
posted @ 2009-06-10 01:29 Tyrael 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 今天随意翻看了下POSA vol1 chapter 1, 这章并没有什么具体讲述patterns, 但仍有几点论述还不错, 当然最主要的是抽象与总起: 1. Each pattern is a three-part rule, which expresses a relation between a certain context, a problem(forces), and a solutio... 阅读全文
posted @ 2009-06-09 02:13 Tyrael 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 我记得在大学时期我们老师唯一推荐过的书就是<Inside the c++ model>, 可见了解对象布局的重要性. 下面这图是我在阅读<Essential .net>时随手画的, 可能会有所出入, 希望可以斧正..Net 2.0内存对象布局: .Net 2.0之后加入了很多元素, 比如Extend method, 所以虽然大体上相似, 但并不能完全反映. 阅读全文
posted @ 2009-06-08 22:23 Tyrael 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Q: 我们知道各种排序算法的时间复杂度, 他们为什么会有不同.A: 1. 计算机从某种程度上来说就是-快,所以能轻松胜任重复|既定的任务.2. 由于1, 算法或则其他计算任务总能找到一个途径, 那就是穷举,尽管不那么优美或则在某种程度上是不能接受的. 3. 冒泡是建立在2的基础上, 每次确定一个数据的位置都是穷举比较其余的所有数据, 或则说一次遍历所有的数据只能确定一个位置, 所以复杂度最高. 4... 阅读全文
posted @ 2009-06-08 19:19 Tyrael 阅读(171) 评论(1) 推荐(0) 编辑
摘要: Part Ⅰ-Universal principles in beautiful architectures:- One fact in one placeDuplication leads to error, so it should be avoided. Each fact must be a single, nondecomposable unit, and each fact... 阅读全文
posted @ 2009-06-08 18:50 Tyrael 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 核心原则1.同方向运行到底假设电梯在5楼正向上运行, 那么它会一直上升到电梯内外的最高楼层请求.(内请求必定是向上; 若外请求楼层低于内请求最高楼, 则只响应此楼层向上请求; 若外请求楼层高于内请求最高楼, 则任何请求都会响应.)2.中间不同方向请求忽略(乘客不做往返运动) 阅读全文
posted @ 2009-06-03 04:35 Tyrael 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 本文部分源自[1].1. 背景, 放回与不放回抽样 1.1 问题描述: M个数中随机抽取N次(N<=M), 取到M(K)(0<=K<M)的概率? 1.2 分析:A,B为互斥事件, 则P(A+B) = P(A) + P(B). 1.2.1, 对于放回抽样, N次抽样后抽到任一数的概率是(1 - N次皆未取到的概率), 即: [1 - (m-1)/m]n. 因为是放回抽样, 所以有可... 阅读全文
posted @ 2009-06-03 04:17 Tyrael 阅读(824) 评论(0) 推荐(0) 编辑
摘要: 下面是一些关于阅读<Essential .Net, CLR>的体会, 当时记录在Txt文本中, 现在直接copy上来, 格式可能会有所不适:1. CLR types are uniquely identified by their assembly name/type name pair, but it does not help the programmer to distincti... 阅读全文
posted @ 2009-06-02 14:31 Tyrael 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1. Problem: 软件设计的变化可以归于2类: 1.1, 改变某方法行为. 1.2, 增加新方法(不改变已有类).2. Solution: @1.1,OO中的继承和多态, DP中众多模式都是解决此问题, virtual method, 通过新增类来override出新行为. @1.2, DP中的Visitor pattern提供了一个比较trick的方案. Visitor pattern本质... 阅读全文
posted @ 2009-06-02 14:24 Tyrael 阅读(104) 评论(0) 推荐(0) 编辑