[seam-issues] [JBoss JIRA] Created: (SEAMXML-12) Support complex initial values

Jozef Hartinger (JIRA) jira-events at lists.jboss.org
Wed Jun 30 11:21:46 EDT 2010


Support complex initial values
------------------------------

                 Key: SEAMXML-12
                 URL: https://jira.jboss.org/browse/SEAMXML-12
             Project: Seam XML Bean Config
          Issue Type: Feature Request
    Affects Versions: 3.0.0.Alpha2
            Reporter: Jozef Hartinger
            Assignee: Stuart Douglas


Currently, setting the value of a field is limited to the following basic types: {primitives, Date, Calendar, Enum, Class}. This is not enough for complex cases.
It would be great if any class instance could be configured via XML extension and injected into a field.

Here is an example

public class Car {
	private String color;
	// getters and setters
}

@ApplicationScoped
public class Garage {
	private Set<Car> cars
	// getters and setters
}

The garage bean could be configured the following way:

<p:Garage>
	<s:overrides />
	<p:cars>
		<s:value>
			<p:Car color="blue" />
		</s:value>
		<s:value>
			<p:Car color="red" />
		</s:value>
	</p:cars>
</p:Garage>

or maybe even:

<p:Garage>
	<s:overrides />
	<p:cars>
		<p:Car color="blue" />
		<p:Car color="red" />
	</p:cars>
</p:Garage>

I can see the execution steps as:
1) Check that Car is a dependent-scoped component
2) For each element inside p:cars
	a) obtain a (dependent) Car instance from BeanManager
	b) set properties of the Car instance
	c) garage.add(car)

This is a different approach to configuration compared what the XML extension provides so far. While it is currently possible to configure beans, if this feature request is implemented, it will be possible to configure bean instances separately and use these instances to configure a bean.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list