ITeye博客

caoguanling的博客

caoguanling · 共 6 篇文章

Design Patterns used in Java JDK

You can find an overview of a lot of design patterns in Wikipedia . It also mentions which patterns are mentioned by GoF. I'll sum them up here and try to assign as much as possible pattern implementations found in both the Java SE and Java EE API's. Creational patterns Abstract factory (recognizea…

2013-09-26 09:06 · Design Pattern · 评论(0)

What is the difference between Transaction-scoped Persistence context and Extend

The difference is clearly explained in the JSR-220 Enterprise JavaBeans 3.0 specification: 5.6 Container-managed Persistence Contexts (...) A container-managed persistence context may be defined to have either a lifetime that is scoped to a single transaction or an extended lifetime that spans mult…

2013-09-25 14:53 · Java · 评论(0)

Observer Pattern in Java

import java.util.Observable; import java.util.Observer; class MessageBoard extends Observable { private String message; public String getMessage() { return message; } public void changeMessage(String message) { this.message = message; setChanged(); notifyObservers(message); } public static void mai…

2013-06-28 18:22 · Java · 评论(0)

JVM的内存结构

JVM的内存结构:

2013-05-22 10:48 · Java · 评论(0)

what is difference between sleep method and yield method of multi threading?

Excerpt from http://stackoverflow.com/questions/9700871/what-is-difference-between-sleep-method-and-yield-method-of-multi-threading We can prevent a thread from execution by using any of the 3 methods of Thread class: yield() join() sleep() yield() method pauses the currently executing thread tempo…

2012-06-01 15:00 · Java · 评论(0)

摘抄自别人的人生感悟

我们身处不平静的环境,需要保持平静的内心 人无论在哪个时代似乎在心理上的需求是一样的,想得到些什么,或者不想失去自己所拥有的。爱情、事业等等最后转变成内心的幸福感,才觉得这辈子没有白活。而死亡最终来临的时候,才明白什么都带不走。其实,古人解决不了的问题,我们现在还是没有解决。人类社会的发展从表面上看,是物质技术不断更新突破的过程。但是对待自己的内心,人类似乎并没有往前迈进多少。各种各样的心理疾病折磨人的心灵,普遍的忧郁与失落似乎是现代人的通病,这因为什么?因为“那些不注意他们自己内心活动的人必然是不幸的”。 “灵魂先于身体早衰是让人羞愧之事”。如果我们觉得空虚与失望,不应该再怨天尤人,首先我…

2011-11-30 17:30 · 人生感悟 · 评论(0)