It’s been out for a while so I am wondering if people are using the p XML namespace within their Spring configuration files. Is it a helpful shortcut? Is it a good idea that ended up in the trash can?
Where does the Java community largely stand?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I use it in every single Spring project I’ve ever touched. I’d guess my current team has a codebase with at least 50 different Spring files and every one uses the
pnamespace. It’s a lot less typing, and arguably more readable. For instance:Can much more easily be written as
The only drawback is that you lose the ability to use the
localsemantic, though honestly I don’t use it that often.The Eclipse’s Spring IDE supports the p-namespace and will autocomplete property names for beans. You can even modifier-click the property names to jump to their declarations and I believe the refactoring tools support changing property names too (even if they’re in p-namespace notation).
Teammates may take a while to get used to it, but after they learn it they’ll be thanking you for making the files that much more concise.