Re: [swiz-framework] How to create a Map bean in swiz ioc?

26 views
Skip to first unread message

Brian Kotek

unread,
Aug 30, 2012, 10:06:58 PM8/30/12
to swiz-fr...@googlegroups.com
Can't you just create your own class with the properties you want and declare it as a bean?

On Thu, Aug 30, 2012 at 6:04 PM, Taras Beletskyy <ama...@gmail.com> wrote:
Hi all,

I need a Map instance, e.g var map:Object = {fooProperty:"fooValue", barProperty:"barValue"};
So how to create such bean and make it available for [Inject]?

also "fooValue" can be an instance of other bean (bean reference), see below

<bean name="foo" />
<bean name="map">
  <property name="prop1" value="someValue" />
  <property name="prop2" ref="foo" />
</bean>

I mean how to express such configuration in terms of SWIZ?

Thank you

--
You received this message because you are subscribed to the Google Groups "Swiz Framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/swiz-framework/-/RWtQjnDF1IwJ.
To post to this group, send email to swiz-fr...@googlegroups.com.
To unsubscribe from this group, send email to swiz-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swiz-framework?hl=en.

Taras Beletskyy

unread,
Aug 31, 2012, 5:36:09 AM8/31/12
to swiz-fr...@googlegroups.com
Hi,

no it's awkward

I may have arbitrary number of properties and I don't want to create a field for each one.

I need someth like this
<bean name="map" class="flash.utils.Dictionary (or Object)">
  <property name="prop1" value="someValue" />
  <property name="prop2" ref="foo" />
   ...
  <property name="prop999" ref="someth" /> 
</bean>

Is this possible in Swiz?

Brian Kotek

unread,
Aug 31, 2012, 9:47:19 AM8/31/12
to swiz-fr...@googlegroups.com
I've never tried it so I'm really not sure. If it were me, I'd just create a dynamic class and use that.


--
You received this message because you are subscribed to the Google Groups "Swiz Framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/swiz-framework/-/BAz-On2GLF4J.

Carlos Rovira

unread,
Aug 31, 2012, 10:03:44 AM8/31/12
to swiz-fr...@googlegroups.com
Maybe In this page could hopefully find what you need?

http://swizframework.jira.com/wiki/display/SWIZ/IoC+Container

See:

-Prototype Beans
-Externalizing Configuration Values



2012/8/31 Brian Kotek <bria...@gmail.com>:
--
Carlos Rovira
Director de Tecnología
M: +34 607 22 60 05
F: +34 912 35 57 77
CODEOSCOPIC S.A.
Avd. del General Perón, 32
Planta 10, Puertas P-Q
28020 Madrid
Reply all
Reply to author
Forward
0 new messages