5 replies
This seems to me a solution looking for a problem. When did using the simple dot notation become such a cumbersome way of accessing a bean's attributes?
The article gives a great example of how to use XPath with a bean but fails to give any definitive or life-changing reason as to WHY you would want to do this.
Confused,
Calvin.
XPath comes from XML and is used all over XSL. It is a more powerful syntax than the dotted-bean notation which leads to much better searches.
For example, address/person|pet/name is correct XPath syntax, as is: books[position() < 4].
It's true that the tip didn't show why XPath is so much powerful, and thus why JXPath is useful beyond bean-notation.
by mikecoughlin
/ vs . Now we need to track when to use which ?
Let's make (Java) life MORE complicated ... preferably as complicated as possible. That way more folks can make a living filling 1,000 page tomes and giving $2,000 seminars to tell us when to use slash notation, rather than dot notation.
A whole new way to detract from value to clients. Brilliant idea! This adds great value to lower the cost of delivering systems to customers. No wonder so many Java developers can't find clientsto pay them!
This is NOT meant to, in any way, criticize Mark's well-done article. I'm more disturbed by the non-standard approach taken by this Xpath implementation.
XPath is an XML standard. It's more powerful than the dotted notation, which is one reason to consider using it. [cf my reply to the first post].
The dotted-notation on the other hand is simply a de-facto standard, something which I don't believe is mentioned fully in the Java Bean spec and is not implemented the same in differing implementations.
by phlogistic
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending