Thanks 4 the clarification. That also applies if one was accessing java through from C++ via JNI. Aside from this, I don't see the need to have the s/getters private.

 


--- On Mon, 5/25/09, Ashok Hariharan <ashok@parliaments.info> wrote:

From: Ashok Hariharan <ashok@parliaments.info>
Subject: Re: [Skunkworks] Spring DI and OOP inheritance:
To: "Skunkworks forum" <skunkworks@lists.my.co.ke>
Date: Monday, May 25, 2009, 11:50 AM

On Mon, May 25, 2009 at 11:24 AM, wesley kiriinya
<kiriinya2000@yahoo.com> wrote:
> Another solution:
>
> You don't have to make the setters and getters private (i.e. setCustomerDao,
> getCustomer because the references they return are also private). Therefore
> the s/getters would be either protected or public allowing you to do the
> spring wiring as follows:
>
> <bean id="customerServiceImpl" class="ke.co.x.x.CustomerServiceImpl">
>              <property name="customerDao" ref="customerDao"/>
> </bean>
>

You would think that is the logical way.... but  with direct injection
frameworks like Spring method encapsulation is ignored ... you can
have a private setter method which is settable by an external object !
it uses the reflection api to call setter / getter methods
irrespective of encapsulation rules
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
Other services @ http://my.co.ke
Other lists
-------------
Skunkworks announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science - http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi - http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general