自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 收藏
  • 关注

原创 策略

封装可以替换的行为,并使用委托来决定要使用哪一个。策略:组合模板方法:继承

2012-12-28 15:58:32 174

原创 状态模式

允许对象基于内部不同状态而有不同的行为,将每个状态封装成一个类状态模式:Context将行为委托给当前的状态对象,状态改变可以由Context或ConcreteState控制

2012-12-28 15:50:30 167

原创 模板方法模式

将算法定义成一组步骤,其中的步骤都可以是抽象的,由子类负责实现,这样保持算法结构不变.

2012-12-28 14:49:08 185

原创 命令模式

将请求封装成对象,使发出请求的对象和执行请求的对象解耦,命令对象封装了接收者和一个或一组动作,可以支持撤销宏命令是命令的一种简单的延伸,允许调用多个命令,宏方法也可以支持撤销.例子:日志和事务处理

2012-12-28 14:38:17 158

原创 Singleton模式

public class Singleton {    private volatile static Singleton uniqueInstance;     private Singleton() {}     public static Singleton getInstance() {        if (uniqueInstance == null) {

2012-12-28 11:14:39 161

原创 工厂方法模式

定义了一个创建对象的接口,让类把实例化推迟到子类

2012-12-28 11:06:18 158

原创 外观模式

统一和简化接口,用来访问子系统的一组接口

2012-12-28 10:52:32 142

原创 适配器模式

转换接口,使不兼容的类可以有效工作

2012-12-28 10:50:22 135

原创 代理模式

让代理对象控制对某对象的访问有远程代理,虚拟代理,保护代理

2012-12-28 10:12:34 145

原创 装饰者模式

动态的将责任附加到对象上,若要扩展功能,装饰者提供了比继承更有的弹性的替代方案。Decorator既继承于Component【IS A关系】,又维护一个指向Component实例的引用【HAS A关系】.组合【HAS A】Component的目的是让ConcreteDecorator可以在运行时动态给ConcreteComponent增加职责.继承的目的是可以统一装饰者和被装饰者的

2012-12-27 09:15:11 172

原创 观察者模式

在对象之间定义一对多的依赖,一个对象改变状态,依赖它的对象都会收到通知并自动更新

2012-12-26 10:44:51 162

原创 OO原则

封装变化多用组合,少用继承针对借口编程,不针对实现编程对扩展开放,对修改关闭

2012-12-26 10:39:00 264

原创 context:property-placeholder

2012-12-17 12:57:34 326

原创 profile

a profile instructs Spring to configure only the ApplicationContext that was defined when the specified profile was active.xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation

2012-12-17 12:51:19 219

原创 publishEvent

ApplicationContext.publishEvent

2012-12-17 12:14:49 1206 1

原创 messageSource

messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">                                    buttons                labels                            ctx.

2012-12-17 12:06:44 169

原创 Executing a Method When a Bean Is Destroyed

Using JSR-250 @PreDestroy AnnotationImplementing the DisposableBean Interfacespecify the name of the methodin the destroy-method attribute of the bean’s tag.Spring calls it just before it des

2012-12-16 23:35:09 175

原创 Execute a Method When a Bean Is Created

The order of executationUsing JSR-250 @PostConstruct AnnotationImplementing the InitializingBean Interfaceinit-method="init"

2012-12-16 23:30:58 176

原创 Resolving Dependencies

depends-on="beanB"

2012-12-16 21:23:11 2381 1

原创 Bean Inheritance

you   don’t want a parent bean definition to become available for lookup from the ApplicationContext, you canadd the attribute abstract="true" in the tag when declaring the parent bean.abstract="tr

2012-12-16 21:03:44 222

原创 Dependency Injection

Dependency Injection also has two common flavors: Constructor Dependency Injectionand Setter Dependency Injection.

2012-12-15 22:26:14 198

原创 Pointcut

JdkRegexpMethodPointcut       JdkRegexpMethodPointcut pc = new JdkRegexpMethodPointcut();       pc.setPattern(".*foo1");NameMatchMethodPointcut        NameMatchMethodPointcut pc = new NameMatc

2012-12-15 20:20:18 290

原创 advice

A before advice can modify the arguments passed to a method and can prevent the method from executing by raising an exception.after-returning advice cannot modify the return value of a Method Invoca

2012-12-15 19:04:09 209

原创 Advice

2012-12-15 18:13:59 184

原创 two kind of proxy for Spring AOP

The CGLIB proxy       proxy both classes and  interfaces,     To  use the CGLIB proxy when proxying an interface, you must set the value of the optimize flag in theProxyFactory to true using t

2012-12-15 15:08:16 209

原创 Aop

AspectJ  Aop:      compile-time weaving     modify the actual bytecode of your application     good performance     complex and flexibleSpring AOP:       runtime weaving    a subse

2012-12-13 17:20:29 177

原创 Spring in Action 3 - passing parameters to advice

expression="execution(*com.springinaction.springidol.Thinker.thinkOfSomething(String))and args(thoughts)"/>pointcut-ref="thinking"method="interceptThoughts"arg-names="thoughts" />The

2012-12-10 22:15:37 439

原创 Spring in Action 3 - pointcut

Defines an AOP advisor. Defines an AOP after advice (regardless of whether the advised method returns successfully). Defines an AOP after-returning advice. Defines an AOP after-throwing advice.

2012-12-10 22:11:02 272

原创 Spring in Action 3 - pointcut

we used the && operator to combine the execution() and within() designators in an “and” relationshipwe could’ve used the || operator to indicate an “or” relationshipthe ! operator can be used to n

2012-12-10 22:09:30 246

原创 <context:annotation-config />

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans      http://ww

2012-12-08 21:11:09 174

原创 Spring in Action 3 -The four kinds of autowiring

 byName—Attempts to match all properties of the autowired bean with beansthat have the same name (or ID) as the properties. Properties for which there’sno matching bean will remain unwired. by

2012-12-08 20:55:42 252

原创 Spring in Action 3 -Spring Expression Language (SpEL)

 The ability to reference beans by their ID Invoking methods and accessing properties on objects Mathematical, relational, and logical operations on values Regular expression matching Col

2012-12-08 20:43:22 341

原创 Spring in Action 3 - Spring’s p namespace

Wiring properties with Spring’s p namespacexmlns:p="http://www.springframework.org/schema/p"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.

2012-12-08 20:20:42 238

原创 Spring in Action 3 - Spring’s bean scopes

2012-12-08 19:34:13 212

原创 Spring in Action 3 - the startup lifecycle of a typical bean

the startup lifecycle of a typical bean1 Spring instantiates the bean.2 Spring injects values and bean references into the bean’s properties.3 If the bean implements BeanNameAware, Spring passes

2012-12-08 19:06:00 1596

原创 Spring in Action 3 - application context

ClassPathXmlApplicationContext—Loads a context definition from an XMLfile located in the classpath。--ApplicationContextcontext=new ClassPathXmlApplicationContext("foo.xml");FileSystemXmlApplicat

2012-12-08 19:02:37 281

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除