If you wanted to use getters and setters, you could. It's largely a matter
of preference except in the most rare of cases where Object A needs Object
B and Object B needs Object A. ( A circular dependency ).

In this case, the solution is to use getters and setters. However, as far
as a personal choice, I almost never do. I favor injecting into the init
method because it is much clearer and easier to understand where things
come from, rather than using a getter that mysteriously gets an object out
of seemingly thin air.


DW



On Mon, Nov 21, 2011 at 11:18 AM, marc <[email protected]> wrote:

> Ok, I solved it by not using getters/setters as in
> getApplicationConfiguration()
>
> but by adding it as an argument to my init handler:
>
>
> <bean id="CMSGateway" class="Application.model.Gateways.CMSGateway">
>  <constructor-arg name="ApplicationConfiguration">
>         <ref bean="ApplicationConfiguration" />
>     </constructor-arg>
> </bean>
>
> Now arguments.ApplicationConfiguration" is known.
>
> Marc
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>



-- 
Plutarch - "The mind is not a vessel to be filled but a fire to be kindled."

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to