commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34353] - [configuration] Provide support for declaring and creating objects
Date Wed, 15 Feb 2006 20:42:13 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34353>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34353





------- Additional Comments From oliver.heger@t-online.de  2006-02-15 21:42 -------
Some new code related to the features described in this ticket has been
committed. Two new interfaces were introduced:

- BeanFactory is responsible for creating new instances of specified classes.
- BeanDeclaration specifies how a bean and its properties are defined in a
configuration.

Default implementations for these interfaces are provided. For creating a bean
from a Configuration object the following steps are necessary:

- A BeanDeclaration object must be created that can deal with the Configuration
and the layout of the bean declaration.
- With this object an utility method of the BeanHelper class (a class with
static helper methods) can be called, which creates the object. In code (using
the default implementation of the BeanDeclaration interface), this looks as follows:

XMLConfiguration config = new XMLConfiguration("bean.xml");
XMLBeanDeclaration decl = new XMLBeanDeclaration(config, "personBean");
PersonBean person = (PersonBean) BeanHelper.createBean(decl);

With bean.xml looking like that:

<config>
    <personBean config-class="my.model.PersonBean"
      lastName="Doe" firstName="John">
      <address config-class="my.model.AddressBean"
          street="21st street 11" zip="1234"
          city="TestCity"/>
    </personBean>
</config>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message