JEXP                       Spring
Java /

Historie von Java.Spring

Einfache Korrekturen ausblenden - Änderungen im Wiki Quelltext

22.01.2006 02:38 Uhr von hunger -
Zeilen 119-120 bearbeitet:
  • default propertyEditors: ByteArray, Class, CustomBoolean, CustomNumber(String to any Number), File, InputStream, Locale, Resource, ResoureArray(wildcards), StringArray, URL, CustomDate, StringTrimmed(also emtpy to null)
geändert zu:
  • default propertyEditors: ByteArray, Class, CustomBoolean, CustomNumber(String to any Number), File, InputStream, Locale, Resource, ResoureArray(wildcards), StringArray, URL, CustomDate(must register manually), StringTrimmed(also emtpy to null), CustomCollectionEditor(new)
18.01.2006 15:03 Uhr von hunger -
Zeilen 1-6 hinzugefügt:
08.01.2006 02:43 Uhr von 212.80.224.243 -
Zeilen 152-155 bearbeitet:
  • or use, EasyMock p.105 or jMock
geändert zu:
  • or use, EasyMock p.105 or jMock

  • Bean aliasing
    • <alias name="fromName" alias="toName"/>
08.01.2006 02:42 Uhr von 212.80.224.243 -
Zeile 109 bearbeitet:
  • PropertyEditor
geändert zu:
  • PropertyEditor p.102
Zeilen 113-114 bearbeitet:
  • default propertyEditors: ByteArray, Class, CustomBoolean, CustomNumber(String to any Number), File, InputStream, Locale, Resource, ResoureArray(wildcards),
geändert zu:
  • default propertyEditors: ByteArray, Class, CustomBoolean, CustomNumber(String to any Number), File, InputStream, Locale, Resource, ResoureArray(wildcards), StringArray, URL, CustomDate, StringTrimmed(also emtpy to null)
Zeilen 143-144 hinzugefügt:
  • use direct test code injections via setter or constructor
Zeilen 146-147 bearbeitet:
  • AbstractDependenc
geändert zu:
  • AbstractDependency
  • cactus for in Container Tests (ant like remote tests)
  • webtest.canoo.com
Zeile 152 bearbeitet:
  • or use, EasyMock or jMock
geändert zu:
  • or use, EasyMock p.105 or jMock
07.01.2006 00:00 Uhr von 212.80.224.243 -
Zeilen 76-93 bearbeitet:
geändert zu:
  • PropertyPathFB
    • gets the value of an Property(-path) of any bean
    • different notations
    • either via targetBean=,propertyPath=
    • or using the bean id as complete property Path (e.g. id="person.address.city")

  • FieldRetrievingFB
    • especially for static Fields (also other)
    • notations: property name="staticField" <value>java.lang.Long.MAX_VALUE</value>
    • or via id=java.lang.Long.MAX_VALUE
    • non static via targetObject, targetField

  • MethodInvokingFB
    • use factory-method when creation of beans needed
    • call to other (also static methods) possible via
    • staticMethod, value package.Class.methodName; parameters= value or list or sth.

Zeilen 113-114 bearbeitet:
geändert zu:
  • default propertyEditors: ByteArray, Class, CustomBoolean, CustomNumber(String to any Number), File, InputStream, Locale, Resource, ResoureArray(wildcards),
Zeilen 132-148 hinzugefügt:
  • Component Handling p.97
    • not satisfying
    • supply xml-descriptor with component jars, use namespaces for bean-ids (eg. component- or : ) I'd prefer package names
    • use bean aliasing for supplying the same bean to different components (e.g. DataSource)

  • Singletons for accessing the Container (todo)
    • SingletonBeanFactoryLocator
    • in ejb context

  • Unit Testing
    • from spring-mock.jar
    • AbstractDependenc

  • Mock Objects for Testing
    • either static versions
    • or use, EasyMock or jMock
06.01.2006 03:48 Uhr von hunger -
Zeilen 108-113 bearbeitet:
  • MessageSourceAccessor for simpler locale handling
geändert zu:
  • MessageSourceAccessor for simpler locale handling

  • Timer, Scheduling facilities
    • TimerTask.run()
    • schedule with ScheduledTimerTask, property for period (ms)
    • TimerFactoryBean configured with any number of scheduledTimerTasks
06.01.2006 03:10 Uhr von hunger -
Zeile 33 bearbeitet:
  • method injection
geändert zu:
  • method injection (p.44)
Zeile 77 bearbeitet:
  • Template definition
geändert zu:
  • Template definition (p.73)
Zeile 85 bearbeitet:
  • PropertyPlaceHolderConfigurer
geändert zu:
  • PropertyPlaceHolderConfigurer (p.77)
Zeile 87 bearbeitet:
  • PropertyOverrideConfigurer
geändert zu:
  • PropertyOverrideConfigurer (p.78)
06.01.2006 03:08 Uhr von hunger -
Zeilen 34-38 hinzugefügt:
  • when a singleton,stateless objects needs to use a non-singleton,stateful, not threadsafe object
  • abstract Method in bean
  • implemented by lookup-method element with method name= and bean= name, which is or is no singleton (depending on necessity)

  • TODO inteface injection (from Manning,Spring in Action)
Zeilen 40-43 bearbeitet:
  • invocation-handler, intefaces
geändert zu:
  • invocation-handler, interfaces

06.01.2006 02:58 Uhr von hunger -
Zeile 3 hinzugefügt:
  1. small footprint spring-core.jar only 265k, spring-context.jar (276k), etc.
Zeilen 6-7 bearbeitet:
geändert zu:
  1. always use minimum interfaces for dependend objects e.g RessourceLoader instead of ApplicationContext (stubbing)
Zeilen 10-44 bearbeitet:
  • inner beans for single use beans that are unessecary outside, never singletons (even with flag)
geändert zu:
  • IoC
    • Mixing of autowire, constructor-arg, property elements (latter have precedence)
    • factory method of other beans for creating beans: attributes: factory-method=methodName, factory-bean=beanName

  • Context instatiation (p.51)
    • multiple XML-files possible,also equally named xml files spread over the classpath

  • Bean lookup
    • ctx.getBean()
    • ctx.getBeansOfType(Class)

  • bean identification
    • id for xml-id conform names
    • other names via name=
    • comma separated list
    • different names for different using beans (substitution of only some of the usages possible)

  • pre instatiation of singletons
    • overriden by default-lazy-init (global), lazy-init (bean)
    • ApplicationContext default
    • BeanFactory manually

  • method injection
    • inject new interface into existing bean
    • invocation-handler, intefaces
  • property values
    • (bean (inner bean)|ref (beanName)|idref|list(value)|set(value)|map(entry key=|value)|props|value|null)
    • special Collection Classes via FactoryBeans eg. ListFactoryBean
    • idref: beanName, automatic check for existence
    • ref bean= spring validation ; local= xml parser verification if in the same xml file; parent= from parent xml file (in case of name-conflicts)

  • inner beans for single use beans that are unessecary outside
    • never singletons (even with flag)
Zeilen 87-88 bearbeitet:
geändert zu:
  • if placed in the same package as the type with the same name and Editor appended, it is automatically installed by the JavaBeans PropertyEditor mechanisms
06.01.2006 02:40 Uhr von hunger -
Zeilen 8-19 hinzugefügt:
  • inner beans for single use beans that are unessecary outside, never singletons (even with flag)
  • outer bean singleton-only one inner bean, outer bean prototype then every inner prototype as well, if singleton needed via outer bean declaration/name

  • manual dependency - depends-on="beanName", for non property dependencies (e.g. JdbcDriver)

  • autowiring - use with care
    • globally default-autowire
    • error check unset,mandatory propertise via dependency-check=objects

  • constructor argument matching
    • always use index= or type= when using constructor arguments
Zeile 22 hinzugefügt:
Zeile 25 hinzugefügt:
Zeile 27 hinzugefügt:
06.01.2006 02:32 Uhr von hunger -
Zeilen 3-5 hinzugefügt:
  1. abstraction of dependend beans/services/data to interfaces and therefore totally replaceable implementations
  2. PropertyEditor, implicit object creation
Zeilen 8-17 hinzugefügt:
  • Validating dependencies - dependency-check (which properties must be completely set)
    • none, simple (primitive,collections), objects (!simple), all
  • callback methods
    • init-method, InitializingBean (IF) destroy-method, DisposableBean (IF)
  • factory method for creating objects
  • Factory Beans (FB) create/deliver beans when being accessed via getBean()
    • access of the factory bean via "&beanName"
    • examples JndiObjectFB, ProxyFB, TransactionProxyFB, RmiProxyFB (and several other remoting FBs), LocalSessionFB (Hibernate and other ORM/iBATIS), LocalStatelessSessionPropxyFB (JNDI local session beans), MethodInvokingFB, FieldRetrievingFB (delivers Method Results/Field Values as beans)

Zeile 19 bearbeitet:
  • define template with abstract=true property (mostly)
geändert zu:
  • define template with abstract=true property (mostly; abstract beans can't bean instatiated)
06.01.2006 02:22 Uhr von hunger -
Zeilen 5-12 bearbeitet:
geändert zu:
  • Template definition
    • define template with abstract=true property (mostly)
    • and use parent="templateBeanName" in concrete child configurations, save all definitions from the parent and replace/add necessary properties for the child
    • properties/constructor arg are only 'added
    • depends-on, autowire, dependency-check, singleton, lazy-init are never inherited
  • BeanFactoryPostProcessor/BeanPostProcessor
    • run manually in pure BeanFactories
06.01.2006 02:19 Uhr von hunger -
Zeilen 6-20 hinzugefügt:
  • PropertyPlaceHolderConfigurer
    • replace ${propname} properties in config file with values from an *.properties file
  • PropertyOverrideConfigurer
    • implicitely replace properties from the *.properties file(s)
      e.g. beanName.proprertyName=propertyValue
    • in the beans/proeprties listed in the properties file - use with caution and document

  • PropertyEditor
    • maps String values to Java Objects
    • via PropertyEditorSupport (configure by CustomEditorConfigurer)

  • AutoProxying
    • BeanNameAutoProxyCreator

Zeile 26 hinzugefügt:
  • automatic Hierarchy via the ApplicationContext hierarchy
06.01.2006 02:13 Uhr von hunger -
Zeilen 1-12 hinzugefügt:

Information regarding the spring framework

interesting stuff collected while reading the Wrox Book

  • Resource
    • transparent lookup in FileSystem,ClassPath,WebContext depending on ApplicationContext-Type or prefix
    • set Resources directly via text value and PropertyEditor setMyResource(Resourse myRes)

  • MessageSource
    • set directly in bean without MessageSourceAware
    • MessageSourceAccessor for simpler locale handling
edit SideBar
Page last modified on 22.01.2006 02:38 Uhr
Bearbeiten - Historie - Druckansicht