一个简单的 POJO factory 实现

很简单,看看代码就明白了,不比 “hello,world” 复杂 。 主入口类 ServiceFactory 类似于 spring 的 BeanFactory:
/**
*
* @author javafuns
*/
public class ServiceFactory {

private static Map beansMap = Configuration.getInstance().getAllServices();

private ServiceFactory() {
}

public static T getService(Class superClaz) throws XxxException {
[...]

By javafuns on September 25, 2009 at 14:07 · Views: 194 · Permalink · Leave a comment
Categorized in: Design Patterns, Java · Tagged with: , ,

Spring notes(二) – Ioc container

IOC container, in spring framework is BeanFactory, contains the following functions:

controls the lifecycle (creation, init, destroy)
controls the scope (like singleton, prototype, request, session, applicationcontext, new in spring)
maintains beans’ dependence

BeanFactory is the base of the other modules in springframework.
Collection type for bean’s property:

list
set
map
props

Lazy init for bean:  <bean id=”xxx” class=”xxx” lazy-init=”true”>
ApplicationContext: a more useful Ioc container [...]

By javafuns on March 9, 2008 at 20:27 · Views: 613 · Permalink · Leave a comment
Categorized in: Java, Scripts · Tagged with: , , ,

Spring notes(一) – Overview

Spring contains following modules:

Core: the core(beanfactory) of springframework providing bean management
Context: based on BeanFactory, but supports more functions, such as i18n, event-broadcasting, resource-loading, mail, validation, etc.
DAO: series of interfaces that you can choose to implement DAOs.
ORM: corresponding classes for integrating many ORM utilities to springframework.
Web/Web MVC
AOP: AOP function you can use to log or do [...]

By javafuns on March 9, 2008 at 10:22 · Views: 677 · Permalink · Leave a comment
Categorized in: Java · Tagged with: , , ,
  • Highest Rated

  • My PicasaPhotos

    IMG_0550.JPG

    86e91643951a780073f05d85.jpg

    IMG_0871.JPG

  • RSS My del.icio.us

  • My RSS