Java Design Patterns
郭龙_Jack
这个作者很懒,什么都没留下…
展开
-
Builder Pattern
http://www.oodesign.com/builder-pattern.html MotivationThe more complex an application is the complexity of classes and objects used increases. Complex objects are made of parts produced by othe转载 2013-05-28 23:02:59 · 642 阅读 · 0 评论 -
Proxy Pattern
http://www.oodesign.com/proxy-pattern.htmlMotivationSometimes we need the ability to control the access to an object. For example if we need to use only a few methods of some costly ob转载 2013-07-12 00:20:33 · 661 阅读 · 0 评论 -
Open Close Principle
http://www.oodesign.com/open-close-principle.htmlMotivationA clever application design and the code writing part should take care of the frequent changes that are done during the devel转载 2013-07-11 23:53:49 · 595 阅读 · 0 评论 -
Template Method
http://www.oodesign.com/template-method-pattern.htmlTemplate MethodMotivationIf we take a look at the dictionary definition of a template we can see that a template is a preset forma转载 2013-07-13 07:02:38 · 586 阅读 · 0 评论 -
Adapter Pattern
http://www.oodesign.com/adapter-pattern.htmlAdapter PatternMotivationThe adapter pattern is adapting between classes and objects. Like any adapter in the real world it is use转载 2013-07-20 06:08:46 · 764 阅读 · 0 评论 -
Singleton Pattern
http://www.oodesign.com/singleton-pattern.htmlSingleton PatternTweetMotivationSometimes it's important to have only one instance for a class. For example, in a system the转载 2013-07-20 08:00:57 · 671 阅读 · 0 评论 -
JTA事务总结
记得EJB的部署文件的事务属性RequiresNew的情况,在调用该EJB函数时如果已经存在一个事务进行中,那么要求容器挂起该事务,启动新的事务进行函数调用,直到函数结束后,再恢复原来的事务继续进行。也许你会想到用以下的方式进行:UserTransaction tx = (UserTransaction)ctx.lookup("javax.transaction.UserTransaction")转载 2014-07-27 21:55:48 · 588 阅读 · 0 评论 -
Java设计模式-六大原则
笔记来源---设计模式之禅(秦小波著)六大原则1. 单一职责原则Single Responsibility Principle SRP原则分清职责,接口一定要做到单一职责,方法也要做到,类尽量做到定义:单一职责原则指的是应该有且仅有一个原因引起类的变更。2. 里氏替换原则Liskov Substitution Principle转载 2017-04-09 08:46:56 · 3683 阅读 · 0 评论 -
设计模式总结
设计模式实践中的要点:1.通常由一个模板,定义程序的骨架流程(这需要对业务了解得比较透彻,捕捉到不变的东西,如果流程没定好,后面要变,将是大手术,老板(花钱)和程序员(加班)都会要为此付出惨痛的代价----所以,老板们,多花点钱,找个懂行的技术总管,还是有必要的)。2.骨架流程里具体的步骤,要使用到的组件,都抽象成接口(可以更换具体实现策略)。3.对于组件接口,具体类型的获得,原创 2017-12-05 11:28:36 · 175 阅读 · 0 评论