摘要:
A Memoization Pattern is a kind of JavaScript Pattern you can use to cache the result of a function with the arguments of the function as the key of the cache. 阅读全文
阅读排行榜
JavaScript Patterns 2.10 Naming Conventions
2014-05-25 17:29 by 小郝(Kaibo Hao), 346 阅读, 收藏,
摘要:
This post introduces how to name the functions, constructors and properties correctly. 阅读全文
JavaScript Patterns 6.1 Classical Versus Modern Inheritance Patterns
2014-07-06 23:23 by 小郝(Kaibo Hao), 344 阅读, 收藏,
摘要:
When it comes to adopting an inheritance pattern for your project, you have quite a few options. You should always strive for picking a modern pattern, unless the team is really uncomfortable if there are no classes involved. 阅读全文
JavaScript Patterns 2.2 Minimizing Globals
2014-05-15 23:14 by 小郝(Kaibo Hao), 342 阅读, 收藏,
摘要:
This blog post introduces the problem with Globals, Side Effect when Forgetting var, Access the Global Object, Single var Pattern and Hoisting: A problem with Scattered vars. 阅读全文
JavaScript Patterns 3.8 Error Objects
2014-06-05 23:56 by 小郝(Kaibo Hao), 341 阅读, 收藏,
摘要:
The post introduces how to customize the error object. 阅读全文
Effective C# 学习笔记(基础篇).NET 资源管理基础
2011-07-04 23:05 by 小郝(Kaibo Hao), 339 阅读, 收藏,
摘要:
.net 框架中的GC回收机制是这样的,首先GC会通过一个应用对象树形结构来管理所有被应用引用的对象,对于没有被应用引用的对象将被垃圾回收,而其垃圾回收对象的顺序是没有被控制的。GC跑在自己的线程上,其每次运行都会整理堆空间,使未使用的堆空间变得连续。基于以上机制,对于Finalizers析构来说,其析构执行的时间也是不确定的,所以尽量不要在托管代码中使用Finalize处理析构事宜,但可以析构非托管对象。Generation标记由上一垃圾回收后产生的新对象其 Generation 值为0 (收集初始值:256K)由上一垃圾回收后第一次存活下来的对象其Generation的值为1 (收集初始值 阅读全文
JavaScript Patterns 2.4 For-in loop
2014-05-19 11:06 by 小郝(Kaibo Hao), 336 阅读, 收藏,
摘要:
Enumeration should be used to iterate over nonarray objects. It's important to use the method hasOwnProperty()when iterating over object properties to filter out properties that come down the prototype chain. 阅读全文
NHibernate Tips
2011-08-28 23:15 by 小郝(Kaibo Hao), 336 阅读, 收藏,
摘要:
This article is about the tips of NHibernate which includes:
1. Nhibernate mapping config file build action
2. Avoid redundant mappings
3. Use natural key to present the identification in real world
4. Use surrogate key for Identification of the physical record in the database.
5. Lazy Loading requirements 阅读全文
Effective C# 学习笔记(二十五)以事件机制来实现通知
2011-07-15 19:35 by 小郝(Kaibo Hao), 333 阅读, 收藏,
摘要:
事件是用来通知观察者来进行相应的操作,其经常被用来在事件的发送者和接受者间进行解耦,事件的机制也是用观察者模式来实现的。 阅读全文
Effective Java 47 Know and use the libraries
2014-04-10 07:25 by 小郝(Kaibo Hao), 332 阅读, 收藏,
摘要:
Don't reinvent the wheel. If you need to do something that seems like it should be reasonably common, there may already be a class in the libraries that does what you want. If there is, use it; if you don't know, check. Economies of scale dictate that library code receives far more attention than most developers could afford to devote to the same functionality. 阅读全文
浙公网安备 33010602011771号