[jdom-interest] Request -- please allow all XML 1.1 conformant text in Element.se tText()

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Mar 7 06:40:28 PST 2004


At 8:05 PM +1100 3/7/04, Chris B. wrote:
>When you inherit and dive into the internals, you say goodbye to 
>backwards compatibility. So what? If you choose to do that, it is 
>your choice. Are you my nanny?

Yes, we are. That's why you're using an API rather than rolling your 
own code. You're assigning us the responsibility of properly handling 
XML so you don't have to. A good API does not require the users to be 
subject domain experts (though the API designers had better be.)

And it's not backwards compatibility that's the point. It's forwards 
compatibility. Once we've exposed anything as either protected or 
public, we can't change it in the future or existing code will break.

Even if we were prepared to pay the cost of designing and maintaining 
a protected API, that API should be exposed through methods, not 
through fields. Methods allow flexibility in future implementation. 
Fields do not. Data encapsulation and implementation hiding is no 
less important a principle for the protected API than the public one.
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA



More information about the jdom-interest mailing list