Chapter 5. MISC

Table of Contents

5.1. Functional comparison of S2Container-1.2 and S2Container-2.0
5.2. Using S2Container in component
5.3. Log setup of S2Container
5.3.1. S2Logger
5.3.2. SimpleLogger
5.4. Annotation API Reference
5.5. ClassLoader API Reference
5.6. Database access using PDO
5.6.1. Using a class which inherits PDO
5.6.2. PDO setup by DICON
5.7. Database access using PdoInterceptor
5.7.1. About Example
5.7.2. Summary of PdoInterceptor
5.7.3. Aspect to Class
5.7.4. Setup Bind value By Method result
5.7.5. Aspect to Interface
5.7.6. Setup Bind value by Method argument
5.7.7. Using @DTO Annotation
5.7.8. Using PDO in Dao
5.7.9. Paging by Paginate class
5.8. StrictInterceptor
5.8.1. About Example
5.8.2. Summary of StrictInterceptor
5.8.3. Aspect StrictInterceptor
5.9. Using S2Container with Zend_Controller
5.9.1. Environment
5.9.2. Creation of the project
5.9.3. Setup of S2Container
5.9.4. Using S2Container in the Action method
5.9.5. UnitTest of The Component
5.10. Using S2Erd with ERD design tools
5.10.1. Environment
5.10.2. Creation of a sample project
5.10.3. Installation of S2Erd
5.10.4. Setup of S2Erd
5.10.5. Autoload Setting
5.10.6. Zend_Tool command
5.10.7. UnitTest of Table Model
5.10.8. Using Table Model in Service class
5.11. Using S2Container with Symfony
5.11.1. Startup of Symfony
5.11.2. S2Container Setup
5.11.3. Creation of action
5.11.4. Using Mock

5.1. Functional comparison of S2Container-1.2 and S2Container-2.0

Table 5.1. Functional comparison table of S2Container-1.2 and S2Container-2.0

FunctionS2Container-1.2S2Container-2.0
Property Injectionnoneavilable
Setter Injectionavailableavailable
Constructor Injectionavailableavailable
Method InjectionInitMethod, DestroyMethodInitMethod
Instance Typesingleton, prototype, outer, request, sessionsingleton, prototype
Binding Typeauto, constructor, property, noneauto, none
Annotationextension Annotation, annotation function of S2ContainerApplicationContextclassunifies to seasar\util\Annotation class
Attached Interceptor S2Container_TraceInterceptor
S2Container_MockInterceptor
S2Container_DelegateInterceptor
S2Container_PrototypeDelegateInterceptor
S2Container_ThrowsInterceptor
S2Container_TraceThrowsInterceptor
S2Container_InterceptorChain
seasar\aop\interceptor\TraceInterceptor
seasar\aop\interceptor\MockInterceptor
seasar\aop\interceptor\InterceptorChain
Default Pointcut All the public methods of implemented Interface. Nothing when Interceptor is not implemented at all. All the public methods of implemented Interface. If Interface is not implemented at all, they are all the methods which the class implements. However, the method from which a name begins in set, get, and is is excepted.
Setup of Pointcut More than one can be specified by comma separated values. (example .+Dao,.+Service) Single specification (example /.+Dao$/ )
ClassLoaderS2ContainerClassLoader, S2ContainerApplicationContext classseasar\util\ClassLoader class
Singleton S2Container functionS2Container_SingletonS2containerFactory classSingleton S2Cotainer function of S2ApplicationContext class
Log functionavailableavailable
Cache function of S2Containeravailavlenone
Cache function of S2AOPavailavleavailavle
Automatic registration function of component Automatic registration function of component as expanded functions, import function of S2ContainerApplicationContextunifies to import function of S2ApplicationContext class
Automatic registration function of Aspect Automatic registration function of Aspect as expanded functions, registerAspect function of S2ContainerApplicationContextunifies to registerAspect function of S2ApplicationContext class
The registration name of componentcomponent name, class namecomponent name, class name with namespace, class name, class name which first letter is lowercased
Setup of Environmentavailavlenone
S2ApplicationContext::registerAspect method arguments
  • 1st : component pattern
  • 2nd : Interceptor
  • 3rd : Pointcut
  • 1nd : Interceptor
  • 2st : component pattern (optional)
  • 3rd : Pointcut (optional)
And return value is a instance of AspectInfoDef class.



© Copyright The Seasar Foundation and the others 2005-2010, all rights reserved.