Tim Kettering wrote:

So if my understanding is correct, the object instance is created first,
meaning the internal classes are initially created w/ the default strings,
before any getter/setters are called by Spring.  So what I was likely
missing before was the need to set 'init-method="initDao"' in the spring
configuration to make sure that the initDao() method was called after spring
was finished, to re-initialize the internal sql mapping objects after the
new sql query strings are set by spring.  So if this init method is not
called, then attempting to use it will result in the class ignoring the set
query strings, and using the default ones.  So this should probably be
explicitly documented in the JavaDoc that if you are setting the query
strings, you need to call 'initDao()' as well.  Or a different mechanism
used to detect changes and remove the dependency on 'initDao'.
The init-method="initDao" is not required. JdbcDaoImpl extends JdbcDaoSupport which in turn extends DaoSupport. DaoSupport implements InitializingBean and marks as final the afterPropertiesSet(), which provides a hook to protected void initDao() throws Exception. This is the hook we are using.

The other thing I wanted to bring up, was that JdbcExtendedDaoImpl
introduces a new method:

String convertAclObjectIdentityToString(AclObjectIdentity aclObjectIdentity)

Which converts the aclObjectIdentity argment to a string that it can use to
query the database.  If you look at JdbcDaoImpl, in the
'getAcls(AclObjectIdentity aclObjectIdentity)' method, you'll find that
theres a section of code that does virtually the same thing.  So I would
think it'd be cleaner code-wise and consistency  for the
'convertAclObjectIdentityToString' method to be moved to JdbcDaoImpl, and
used to implement the conversion to string in 'getAcls' as well.
This would also make it easier to extend the class and still invoke the
superclass 'getAcls' when working with ACLs that need to be converted to
different string formats than the standard used in Acegi.

Agreed. Changes made in CVS.

Cheers
Ben



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Home: http://acegisecurity.sourceforge.net
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to