Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: Interplatform (interprocess, interlanguage) communication Date: Wed, 08 Feb 2012 19:50:19 -0700 Organization: albasani.net Lines: 69 Message-ID: References: <4f332c6d$0$288$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net 2yNG9zXwI7SxcEINPyFAuAI2CKnOSLV5xArRzI01YvXmLWj5y00RKflrp8M2yXb7Rzn3Q2MrWrWcU2rkQ35sqw== NNTP-Posting-Date: Thu, 9 Feb 2012 02:51:22 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="xP+7U+lpA6A8O+0etSkb8aPTP8V0tYu+zdCd5wPSonjceok0CsKqhNnF48XPMUR2tEbUqR3LuH6eHRseXMoovUaTFEBDqnL5xUeKST9ri+boBJzHjUSFIeKKISEkmDzZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 In-Reply-To: <4f332c6d$0$288$14726298@news.sunsite.dk> Cancel-Lock: sha1:8BsoKJ8PgXR8P35cQWxcbrTpJiw= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11865 On 2/8/2012 7:16 PM, Arne Vajhøj wrote: > On 2/8/2012 2:07 PM, BGB wrote: >> On 2/8/2012 4:19 AM, Arved Sandstrom wrote: >>> On 12-02-08 04:41 AM, BGB wrote: >>>> note: my main way of working with XML is typically via DOM-style >>>> interfaces (if I am using it, it is typically because I am directly >>>> working with the data structure, and not as the result of some dumb-ass >>>> "data binding" crud...). >>> >>> I haven't been able to completely avoid using the DOM, but I loathe the >>> API. If I'm using XML at all, and JAXB suits, I'll use JAXB. More >>> generally I'll use SAX or StAX. >>> >> >> I have rarely done things for which SAX has made sense... >> usually in cases where SAX would make sense, I end up using >> line-oriented text formats instead (because there is often little >> obvious reason for why XML syntax would make much sense). > > Non flat structure and validation comes to mind. > fair enough. often, one can implement non-flat structures with line-oriented formats, for example: ... groupDef { ... groupDef { itemDef { ... } ... } ... } a lot of time this may be combined with cosmetic indentation, but this does not change if it is a line-oriented format, for example, writing: groupDef { ... } could very-well break the parser. typically, I have not used validation: if there is anything to validate, typically this logic will be placed in the logic to parse the text. a lot of times, code operates under the assumption that nearly anything which can be reasonably done is valid de-facto (the code is written, however, to ideally not do anything compromising). granted, typically I don't deal a whole lot with anything "security critical" or where there is much need to worry about "trust" or "authorization" or similar (or if privacy or money or similar was involved...). maybe if security were more of a concern, then added layers of pedantics and validation would make a lot more sense. in my typical use-cases, the theoretical worst case would probably be if a 3rd party could somehow break the app and get control of the users' OS or similar and cause damage, but again, modern Windows is itself partly designed to try to defend against this (running applications by default with constrained privileges, ...).