简体   繁体   中英

Where to look to understand spring?

My real question is about how to look up the expectations on the methods (the 'contract' for a method) in Spring. I keep hitting questions, where unless I find some blogger or a stack-overflow that addresses that specific issue, there seems to be no informative documentation. Am I looking the wrong places? Do I need to buy some book?

In the current specific case: I have working looking up a user/password by making my SQL table map to Spring's defaults, but when a user is absent it's hitting a null pointer exception. I see JdbcUserDetailsManager 's " void setUserExistsSql( anSQLString) ", and I want to know if that sql-string should return a boolean? a null? and what it should be 'named.' Googling is not turning up any usage examples, nor any documentation. The javadocs I'm finding are uncommented. I can guess-and-test, but it seems there should be a better way to look-it-up?

Ok, I've been working with spring since version 1, and many other open-source projects follow the same pattern. Documentation is hard and expensive to produce, and programmers donating their time for free often don't want to write it. Spring though is one of the better projects as far as documentation is concerned.

However, I've always found it necessary to link spring's source code into my project. If you're using maven you can download the sources along with the jars, and tools like IntelliJ (and probably eclipse) will allow you to drill down into the source and to trace its execution with their debuggers.

With these types of projects it is almost always necessary at some point to drill down and read the source, and that's a good thing because the source is always up to date and always exactly describes the behaviour you're trying to use. Documentation on the other hand is often badly written using an informal language (eg English) and it can never accurately describe anything, especially if it's being written or read by someone who isn't a native speaker, which is often the case.

So, to answer your question -- look to the source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM