Slashdot Mirror


What is JSON, JSON-RPC and JSON-RPC-Java?

Michael Clark writes "Seen those funky remote scripting techniques employed by Orkut, Gmail and Google Suggests that avoid that oh so 80's page reloading (think IBM 3270 only slower). A fledgling standard is developing to allow this new breed of fast and highly dynamic web applications to flourish. JSON (JavaScript Object Notation) is a lightweight data-interchange format with language bindings for C, C++, C#, Java, JavaScript, Perl, TCL and others. It is derived from JavaScript and it has similar expresive capabilities to XML. Perfect for the web as doesn't suffer from XML's bloat and is custom made for our defacto browser language. JSON-RPC is a simple remote procedure call protocol similar to XML-RPC although it uses the lightweight JSON format instead of XML (so it is much faster). The XMLHttpRequest object (or MSXML ActiveX in the case of Internet Explorer) is used in the browser to call remote methods on the server without the need for reloading the page. JSON-RPC-Java is a Java implementation of the JSON-RPC protocol. JSON-RPC-Java combines these all together to create an amazingly and simple way of developing these highly interactive type of enterprise java applications with JavaScript DHTML web front-ends. " Click below to read more about it. "Now is the turning point. Forget that horid wait while 100K of HTML downloads when the application just wanted to update one field on the page. The XMLHttpRequest object has made it's way into all the main browsers with it's recent introduction into Opera and Konqueror (sans the Konqueror bug). This new form of web development now works on Internet Explorer 5, 5.5, 6, Mozilla, Firefox, Safari 1.2, Opera 8 Beta and Konqueror 3.3 (with a much needed patch). Appeal to Konqueror users - please log into the KDE bugzilla and vote on this bug so you to can experience this wonderful thing. More details here: http://oss.metaparadigm.com/jsonrpc/ "

317 comments

  1. O...k..... by Anonymous Coward · · Score: 3, Funny

    *finishes reading summary*

    ok... so... huh?

    1. Re:O...k..... by rdc_uk · · Score: 3, Informative

      So...

      repopulate your product page for a new product WITHOUT reloading the whole page.

      Put a timer in, and have rotating feature products WITHOUT reloading the whole page on a timer.

      Update your totals in your chckout / shopping cart WITHOUT reloading the whole page.

      Write an RSS news ticker in html rather than flash...

      Basically anything that you might have used flash or an IFrame for, you could do with this, javascript and a DIV tag... Pretty important news (if you write commercial websites)

    2. Re:O...k..... by witte · · Score: 1

      This is cool. On the fly updating of pages, fetching data from components on the server, without reloading the page. So, no more uploading complete business logic components with pages to avoid page loading each time the user changes a value in e.g. a 'Country' dropdown.

      There may already be technology that can do in-page RPC to the server. But it's good to have more than one way to accomplish stuff like this, especially if it's free. And lightweight. (And a brand-spanking-new acronym to impress your peers with.)

    3. Re:O...k..... by dorward · · Score: 3, Insightful

      repopulate your product page for a new product WITHOUT reloading the whole page.

      So now people can't bookmark specific products

      Put a timer in, and have rotating feature products WITHOUT reloading the whole page on a timer.

      Useful from a commercial point of view. Really rather distracting from a visitor point of view. If I can't block it, I'm likely to find another vendor.

      Update your totals in your chckout / shopping cart WITHOUT reloading the whole page.

      This sounds practical, but at some stage you need to send the user to a new page anyway, and you can calculate new totals without having to make server calls - so you might as well leave telling the server about it until they go to the next stage of the checkout process.

      Write an RSS news ticker in html rather than flash...

      Ummm... why would you want an RSS new ticker on a webpage in the first place?

      Basically anything that you might have used flash or an IFrame for, you could do with this, javascript and a DIV tag... Pretty important news (if you write commercial websites)

      Yes, lets just create something with no practical advantages over Flash/Iframe, but which requires a more recent browser to access.

    4. Re:O...k..... by mikael · · Score: 1

      It might also be useful for saving application settings/user preferences.

      As having to update a complete set of file reading/writing/update routines for every application became rather tedious, we found it more convenient to load and save the files as XML documents, read them into memory and access data settings through getValue/setValue calls.

      The downside is that the configuration files are rather bloated. If this data exchange format can help reduce the size of these files, then that can only be a good thing.

      --
      Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
    5. Re:O...k..... by rdc_uk · · Score: 4, Interesting

      "So now people can't bookmark specific products"

      Fair comment, though I can think of places where similar features are desirable -> changing product images is a better usage.

      "Useful from a commercial point of view. Really rather distracting from a visitor point of view. If I can't block it, I'm likely to find another vendor."

      Good luck; sites designed to sell tend to ADVERTISE their wares. You seem to be thinking 3-second rotation; I'm thinking more 1-minute rotation of current "specials". Put bluntly; I have clients that will pay me to do this if its possible.

      "This sounds practical, but at some stage you need to send the user to a new page anyway, and you can calculate new totals without having to make server calls."

      1; I don't want the mechanism for calculations at the client side, so the calculation would require a reload, therefore this will make the page more responsive; i.e. better. The reason for non-client side? First: javascript is a shit language for anything other than DOM manipulation. Second: clients don't want their business logic exposed in javascript. Third: we don't want to download all the data required for those calculations to the client (prices in a code-manipulatable form should NEVER get to the client side, or be sent via post/get, prices just get displayed to the client, not manipulated by them)

      Think about a checkout that calculates shipping costs globally; you need the location from the client. Depending on location the methods available for shipping will change. Depending on weight of goods (changes with quantity change) and location, the costs for each method change.

      Thats a LOT of information to download to the client's machine to make the totals update without a server-call. Its also a ton of information (including prices) that I don't want the client side to have access to, and that I don't want javascript responsible for calculations on.

      If I can pull down just the new value, rather than the whole page -> better!

      "Ummm... why would you want an RSS new ticker on a webpage in the first place?"

      Again; clients will pay for it. Just because YOU don't want it (or, in fact, that my client's clients don't want it), doesn't mean it has no value.

      "Yes, lets just create something with no practical advantages over Flash/Iframe, but which requires a more recent browser to access."

      There are plenty of advantages to not using flash. (reduce number of languages required to display 1 page and reduce number of external plugins required to display 1 page to name just 2 advantages)

      Iframes are never a good idea.

      And did you read the list of supported browsers? Only notable omission in the real world was safari...
      2;

    6. Re:O...k..... by dorward · · Score: 2, Interesting

      So (some) Vendors want it, and (some) Web Developers want it becuase the Vendors (their clients) want it - but does it bring any serious benefit to the end user?

      Changing product images is a reasonable thing to do - but all that needs is a change in the src of the <img> (Or you can take the thinkgeek approach and have nice, large images that show lots of details and that a full page reload doesn't add any significant bandwidth needs to)

      1-minute rotation? How long to people spend on a single page that they aren't reading carefully (and don't want to be distracted)? Just pick a special at random with each new page. Amazon has a "related produts" which works rather well IMO.

      I accept your point about the price calculations, for things where the postage et al isn't simple there could be some benefit. However, do people really fiddle the quantities up and down so much that the occasional reload is going to be a noticable detraction of service?

      I can't say that I'm really pro-Flash or pro-Iframes (OK, I'm very much against them), but you say "Iframes are never a good idea." without giving any reasons - I can think of quite a few reasons why Iframes are a bad idea - but this JavaScript solution has all of those problems too - but with worse browser support!

      And did you read the list of supported browsers? Only notable omission in the real world was safari...

      I would really love it if it weren't so - but not everybody upgrades to the latest and greatest version of their browser. Some people still use Netscape 4. (And Safari was on the list).

    7. Re:O...k..... by Zphbeeblbrox · · Score: 3, Insightful

      Uhmmm... Actually I've been doing this for a while now using iframes and javascript. It's not that hard and also avoids the xml bloat. This just gives a "standard" api to use when doing it. It still uses Iframes you just don't have to create them yourself. Most people who have been doing this already have a set of custom tools to help them do it. The functionality has been there for a while. This will help boost its use though and for that I'm grateful. Gmail makes excellent use of it in their UI making it hugely more useable than most other webmail clients. More people need to be recognizing the, already present, power for dynamic applications in the web.

      --
      If you see spelling or grammatical errors don't blame me. I tried to preview but IE here at work borked the CSS
    8. Re:O...k..... by mwood · · Score: 1

      Actually I don't see anything there that I, as the object of the design process, wouldn't live happily without. Pages that crawl, buzz, flash, or otherwise do stuff other than lie there quietly for me to read are an anti-feature.

      If I hadn't already decided to buy your stuff, I wouldn't be reading your page. You don't need to attract my attention; my presence proves that you already have it.

    9. Re:O...k..... by rdc_uk · · Score: 1

      "Changing product images is a reasonable thing to do - but all that needs is a change in the src of the "

      And the VALUE to put in the SRC - which is what this would allow you to pull down as/if required.

    10. Re:O...k..... by dorward · · Score: 1

      How many images of each product are you going to have that you can't just include them in a block on the product page? Or in the "Change image" link?

      <a href="product-page-with-image-2"
      onclick="return changeProductImage('product', 'image-2.jpeg');">Action shot</a>

    11. Re:O...k..... by ryepup · · Score: 3, Insightful

      So would you rather download <1K to get the new cost in your cart, or download 100K of HTML and images and have the screen flash to get the new cost? As a web host, would you rather serve 1K or 100K?

      The other side is responsiveness of the application. A lot of places use the web for more than shopping carts, and this is the sort of technique that makes a web app seem multithreaded. Don't you like the multithreaded applications you use? Wouldn't it be cool to offer similar speed easily via a web browser? Right now my main option is to have a lengthy process performed in a pop-up window, or post back and start a new thread on the server, which both involve more work than it should.

    12. Re:O...k..... by nospmiS+remoH · · Score: 1

      You haven't used GMail, have you?

      GMail is far more pleasant to use than Yahoo!, Hotmail, et al. Hell, managing email in GMail is usually faster than using Outlook.

      Granted, I'm sure this technology will get abused just like every other potentially cool web feature. But, when used politely, it is very nice.

      --
      !hoD
    13. Re:O...k..... by rdc_uk · · Score: 1

      Oddly; enough that the idea seems like a good one!

    14. Re:O...k..... by dorward · · Score: 1

      So would you rather download <1K to get the new cost in your cart, or download 100K of HTML and images and have the screen flash to get the new cost? As a web host, would you rather serve 1K or 100K?

      If your HTML document containing little more then a list of products is 100 kilobytes, then its very very badly written. You should solve the problem by writing better HTML rather then trying to avoid downloading it.

    15. Re:O...k..... by ryepup · · Score: 1

      I said "HTML and images".

      Ok, change that number to 4K and reread the post. Or are you the type who likes to program in assembly, and prefers human labor over machine labor?

    16. Re:O...k..... by LifesABeach · · Score: 1

      I've got to agree. I think that if the creative great ones could get SVG, XSLT, and CSS3 fully implimented/documented; That would be hot. I just wish I had the time to do it.

      Just think of it; A browser that is fully WC3 complient. It doesn't have to be the PERFECT solution, but that it just work. Then let other great ones get a slice of the glory by offering better code reducing solutions.

    17. Re:O...k..... by Anonymous Coward · · Score: 0

      Give up, you troll. By your reasoning, you should junk computer and go back to pencil, paper, phone, and fax machine - no 'practical advantage'. Actually, dump fax machine, too. If you needed to send it fast, you should have thought of it before and have delivered it the day before last week.

    18. Re:O...k..... by Anonymous Coward · · Score: 0

      And naturally you are the single most experienced person opn the planet, since you are able to make such a sweeping generalization with no facts at your disposal. I salute you, sir.

    19. Re:O...k..... by dorward · · Score: 1

      I said "HTML and images".

      Well, that is still way too big for a webpage. With the exception of sites where images are the purpose (or video, etc), 30k is about the maximum you should be using - and why on earth aren't your images being cached?

      Ok, change that number to 4K and reread the post.

      I value reliability rather more then saving about 2 seconds of reaction time.

    20. Re:O...k..... by JamesOfTheDesert · · Score: 1
      Basically anything that you might have used flash or an IFrame for, you could do with this, javascript and a DIV tag... Pretty important news (if you write commercial websites)

      Indeed. Now you can design sites using remoting technology that was once IE-only. About time.

      (I'm basing this on my understanding that the XmlHttpRequest object first appeared in Internet Explorer, and was later copied by the Mozilla folks. If I'm wrong, could someone post some pointers to the correct history? Thanks.)

      --

      Java is the blue pill
      Choose the red pill
    21. Re:O...k..... by mwood · · Score: 1

      Well, yeah, but I wouldn't use *any* of those. I haven't seen a webmail service yet that didn't feel like typing with mittens on, compared to Pine and my own mail spool.

      Nice way to sidetrack, though. I wasn't talking about usability at all.

    22. Re:O...k..... by captredballs · · Score: 1


      The point of the post was that Gmail, according to me and many other reviewers, provides better functionality than other web-based email services. They achieve a more rich interface than their peers (and avoid that mittens feeling) by using this browser feature.

      You are in favor of this RPC feature if it eliminates your issues with web applications, no?

      --

      I suppose I'm not too threatening, presently, but wait till I start Nautilus
    23. Re:O...k..... by Anonymous Coward · · Score: 1, Informative

      I'm basing this on my understanding that the XmlHttpRequest object first appeared in Internet Explorer, and was later copied by the Mozilla folks.

      That is correct. Since then, the DOM 3 Load and Save specification has been published by the W3C and implemented in Mozilla, Opera and Konqueror.

    24. Re:O...k..... by mwood · · Score: 1

      Sorry, got confused between this article and the one further down about "Google Plans Free VoIP in UK".

      Ahem. Okay, this is indeed about usability. And the article sounds like it's a way to push *more* gunk into web pages. I suppose that webmail (for which I still feel no need) is about the only "web application" that would *not* be made even worse by nailing things onto the side of HTML.

      Basically any time some words, like "richer" or "tightly integrated", enter a discussion, I find I want the opposite of whatever is being enthused about. I want a more ascetic experience.

    25. Re:O...k..... by Anonymous Coward · · Score: 0

      You should solve the problem by writing better HTML rather then trying to avoid downloading it.

      Why?

    26. Re:O...k..... by stankulp · · Score: 1

      Weren't Java applets designed to do all the things you mentioned?

      If applets failed, what reason is there to believe this technology will fare an better?

      --
      We must be alert to the danger that public policy could become captive to a scientific-technological elite. - Eisenhower
    27. Re:O...k..... by CurlyG · · Score: 3, Insightful

      Weren't Java applets designed to do all the things you mentioned?

      If applets failed, what reason is there to believe this technology will fare an better?


      Because client-side embedded Java applets are a drastically impractical, inconvenient, bloated and slow way to do trivial tasks like this. (NOTE: not a Java troll - it's an awesome language for server-side and standalone client-side apps).

      OTOH, ECMAScript/Javascript is built into every browser produced in (at least) the last 5 years, is fast, has zero startup overhead, and is widely understood by every web developer on the planet.

      I rarely see Java applets anymore, for the above reasons. I do, however, see many more Flash apps, which have their own set of problems, including that they require yet another set of 3rd-party software to be installed and configured on the client's computer, rendering it undesirable from the point of view of most shopping and ecommerce sites.

      This is an elegant solution to something developers have been forced to use ugly workarounds to achieve for years.

      --
      You know they call 'em fingers but I've never seen 'em fing. Oh, there they go.
    28. Re:O...k..... by Anonymous Coward · · Score: 0

      It's all very well to want an "ascetic experience", now try to develop a web flight booking application with an ascetic experience (ie. one that checks flight availability, lets you choose seats, handles connecting flights etc.) You will need a large number of pages, which means that Mr. and Mrs. Smith/Wong will give up long before they get to the payment page.
      And of course with lots of information in your forms (addressses etc.), you need to use POSTs... so when Granny Sanchez realizes she's picked the wrong dates, and presses the back button, she gets a horrible message which she doesn't understand about POST data, and she has to start from the beginning again. By now the cat (which has been caught in the rain and is drying in the oven - yes this really happens) is burnt to a crisp (oh all right animal lovers, the pot roast is burnt to a crisp), and Granny decides this is too complicated, she will book over the phone next time.

      Now imagine you can do all the booking in one page. Perhaps even the confirmation page appears at the bottom of the same page, so the page doesn't have to be reloaded if the user changes their mind.
      (avoiding the risk of some details being missing, checkboxes changed etc.)

      The whole process is done in maybe 3 pages, well within everybody's attention span, and Mr ProfitMargin can let his belt out a notch or two.

    29. Re:O...k..... by morbiuswilters · · Score: 1

      Gmail is cool, it is my primary email (I am definitely a webmail kind of guy) but to me all of the little javascript tricks are either unnoticable (so why bother?) or annoying. I hate to say it, but maybe if they had spent more time on the backend they wouldn't have had the XML parsing vulnerability that exposed random emails. Things I like about Gmail: the light feel to the pages (unfortunately, they keep adding stuff), the wider range of basic functionality (like searching) and the usage of text ads which are far preferable to banner ads. These three things make Gmail feel like a real email service over the circus-like atmosphere of hotmail or yahoo. However, the nifty javascript never features in. Ditto for Google Suggest--it seems to have very limited usefulness. Honestly, I'm a huge Google fan because for years it gave the best results and had the cleanest interface, as well as non-intrusive ads that almost everyone (including advertisers) seemed to prefer. I'm not saying this is all a bad thing, but I've always been more of a fan of HTML+CSS interfaces. I remember back in 98 or so where every site suddenly decided it needed to add flash-based menus. Ugly, slow, stupid, and crashed the damn browser a lot. I just don't see anywhere this is being used that it is actually needed, especially not on the public web where most users have become accustomed to hypertext-based interfaces. I have never favored bloated desktop applications and I really hate to see web developers moving that way.

      --
      I have come here to chew memory and kick ass... and malloc() is returning a null pointer.
    30. Re:O...k..... by ahdeoz · · Score: 1

      OK How about this: Even when you do page reloads or load new pages, it saves on bandwidth. A new page that doesn't change the header/footer/sidebar doesn't have to reload any of those items.

    31. Re:O...k..... by ahdeoz · · Score: 1

      Right now (and for a long time now) you have had every option available that JSON uses. Even before XMLHTTPRequest (almost 5 years old on IE & Mozilla) you could use a frame, or even keepalive without frames. JSON is a potential standard notation so you don't have to parse the querystring or request body. JSON-RPC is rediculous though. You're already using HTTP, make a "REST" request (that's a URL)

    32. Re:O...k..... by Hektor_Troy · · Score: 1
      Because client-side embedded Java applets are a drastically impractical, inconvenient, bloated and slow way to do trivial tasks like this.
      Actually that's not true. That almost noone can apparently do it, doesn't mean that it's Javas fault.

      I have managed to cram all the tools needed to control HVAC and building lights, including graphing options, into an applet weighing in at 108,000 bytes. It did more, way more, than most applets I have seen for something as simple as navigating on webpages, and it did it in a whole lot less space, and to boot, it loaded faster. The update speed on the app was a bit slow (one update every two second), but that was due to the hardware the applet was served from (also why it couldn't be larger than 108,000 bytes). Changing it from an applet to a stand-alone application required me to change a single line of code, making it very easy to do testing like that - the only difference between the two? Not having to point my browser at the hardware in question.

      How is that possible? Because I knew what the hell I was doing with Java. Most people who use applets on their websites don't know what the fuck they do with Java. Most people who make those fancy applets, don't know what the fuck they're doing.

      Not saying that java applets are the way to do what's being discussed here - I don't think they are, as it'd be a pain to link directly to products etc. - my beef is with the "applets are impractical, inconvenient, bloated and slow" argument. It's just not true, if you know what you're doing. HTML is "bloated" as well, if you don't know what you're doing, and hence use Word to write your documents in, and then save them as HTML ... that'll bloat a "Hello World" document way too much. Because you don't know what you're doing.
      --
      We do not live in the 21st century. We live in the 20 second century.
    33. Re:O...k..... by dorward · · Score: 1

      OK How about this: Even when you do page reloads or load new pages, it saves on bandwidth. A new page that doesn't change the header/footer/sidebar doesn't have to reload any of those items.

      In other words: lets reinvent frames using JavaScript.

      Frames are not commonly used thanks to severe drawbacks with the concept. Using JS to implement that concept instead of HTML doesn't remove the drawbacks.

    34. Re:O...k..... by dorward · · Score: 1

      You should solve the problem by writing better HTML rather then trying to avoid downloading it.

      Why?

      The user agent is going to have to download it at some stage (if only for the first access), so you'll get significant benefits there.

      Lighter HTML is going to be a lot easier to maintain, so you'll save yourself development time.

      HTML doesn't demand a great deal from user agents, so you aren't going to be demanding that users find a JavaScript capable webbrowser. The browsers on many portable devices do not support JavaScript, and there are been recomendations that people disable JavaScript in thier browsers for security reasons (mainly due to the problems that keep being found in Internet Explorer's scripting engine).

      By using technology that works everywhere, you increase your potential market and therefore also increase potential profits.

    35. Re:O...k..... by yerfatma · · Score: 1

      Keep writing web pages like it's 1997. The rest of us are going to work on building client-server apps that don't feel so much like a Geocities fan page.

    36. Re:O...k..... by yerfatma · · Score: 1

      Fair enough. But there are lots of companies out there with mainframe applications to port that don't feel the way you do.

    37. Re:O...k..... by mwood · · Score: 1

      Ok. They are free to continue to do their darndest to drive away my business. I'll shop with the people whose sites don't give me a sick headache in seconds.

    38. Re:O...k..... by lphuberdeau · · Score: 1
      repopulate your product page for a new product WITHOUT reloading the whole page.
      So now people can't bookmark specific products

      It's also a great way to prevent Google from indexing your content. Seriously, no company with an online catalog can afford not being indexed on Google. I really don't see how this technology can be good for company websites. I see it as just as good as Flash. It's for eye candy and for other flash developpers.

      I can see it as useful in a web application to handle forms or perform complex tasks more effectively, but really not on a public web page.

      Seriously, this is not a new concept. I worked on a similar system years ago, until I realised it had no use in the real world. Content needs to be indexed. Users want their back button and reload their page with the reload button.

      --
      Qui ne va pas à la chasse n'a pas de gibier
      PHP Queb
    39. Re:O...k..... by Anonymous Coward · · Score: 0
      Yes, lets just create something with no practical advantages over Flash/Iframe, but which requires a more recent browser to access.

      The practical advantage is that it isn'tflash/iframe.

  2. Pros and cons? by Sierpinski · · Score: 4, Interesting

    Two major issues that come to mind with this type of technology:

    1) How easy is it to learn for the average programmer

    2) What kind of security precautions can we expect to see?

    Otherwise it sounds like a great technology to use for web developers who wish to have dynamic content on their sites.

    1. Re:Pros and cons? by metaparadigm · · Score: 4, Informative

      A1. The idea is to make it transparent to the programmer. You can practically just call a Java method from your JavaScript web application. one line of code is required to export or allow access to a server-side object.

      A2. Yes, security is an interesting topic. The Java implementation refered to works on a deny all by default - allow specific objects to specific clients. It does require the programmer to think about what methods they are exposing. I have been using it over HTTPS with selective objects exported to authorized clients (using the existing JAAS Java authorization and Authentication framework), so I believe it can be used in a very secure way.

    2. Re:Pros and cons? by Malc · · Score: 1

      Are you referring to "HTML Programmers" (hahaha) or programmers? The thing's bloody easy to use.

    3. Re:Pros and cons? by Jetifi · · Score: 4, Informative

      Well, JSON is a subset of JavaScript object notation, so people who know JavaScript already know this. It's basically a way of transfering structured data between browser and server that is less verbose than XML, and can be eval()ed straight into javacript itself.

      Of course, any server receiving this stuff via POST should do the same validity checks it does on anything else it gets from the wire. On the client, IIRC you can only use XMLHttpRequest with the server the document originated from, and neither should you be able to execute script across domains, even within iframes, so the existing browser security model should be sufficient to prevent additional security problems, bugs and exploits notwithstanding...

    4. Re:Pros and cons? by fireboy1919 · · Score: 1

      It makes it sound like the expected way to use it is for the client to be Javascript. If you're going to do that, why not just write an html frontend? There are a ton of ways to do that for all the languages listed. You don't need to use RPC of any kind. In fact, doing so is stupid. How do you expect to get the data into the RPC in the first place? A java client? You're going to be using html forms.

      And if you're not doing that, then you're writing some other kind of clients that can do more than html is capable of doing. In that case, you might as well use XML-RPC. There are already clients and servers available in tons of languages.
      And, it's easier to parse.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    5. Re:Pros and cons? by Anonymous Coward · · Score: 0

      Eval()-ing anything you receive from a server is asking to be ownz0red by malicious servers, anyhow. Clients shouldn't trust servers any more than servers should trust clients.

    6. Re:Pros and cons? by Jetifi · · Score: 2, Informative

      You're right, the expected client is JavaScript, inside a browser. The frontend UI is typically in HTML (or SVG), but the client-side logic is written in JavaScript. In this case, the request/response happens within a web-page, between the browser and the web server.

      HTML forms are one mechanism for client-server data transfer in a browser, but posting them necessitates reloading the entire web-page, or an iframe, which is not seamless for interfaces like Google Suggest, and may be overkill if you're only making small changes. In addition, a pure POST of form parameters can't transfer the same level of structural detail as XML or JSON without writing your own custom parser/serializer in JavaScript. Since JSON /is/ JavaScript to all intents and purposes, no extra parser is needed.

    7. Re:Pros and cons? by stupidfoo · · Score: 1

      3) What are the benefits of this compared to using a hidden iframe and using that to talk back and forth to the server?

    8. Re:Pros and cons? by Anonymous Coward · · Score: 0

      Eval()-ing anything you receive from a server is asking to be ownz0red by malicious servers, anyhow.

      Why? You're already running JavaScript embedded in the page that came from that server.

    9. Re:Pros and cons? by downwa · · Score: 2, Interesting

      I had seen this a few months ago, and had put together a system using a java-based JScript implementation on the server, so JSON could be evaluated both ways. It was pretty slick, being able to write a web app in entirely JScript (which is a pretty powerful language once you get to know it, naysayers notwithstanding). I had a generalized JScript library loaded client side which could produce menus and set form values from the server automatically.

      On the other hand, if your page is mostly data which will be changing (e.g. a database-backed web form), the vaunted performance isn't that much better than just slimming your HTML using CSS. And if you just use simple HTML (with CSS), you can have something which also works on lynx or older browsers, while still looking sharp on Firefox/IE/Safari/Opera/etc.

      --
      Life's a lot like money-- you spend it, then it's gone. Spend wisely.
    10. Re:Pros and cons? by Jetifi · · Score: 1

      That's a good point. It is important that basic data entry entry should be possible from lynx, and that's why most of the markup I crank out today is semantic HTML.

      It seems like iframes and XmlHTTPRequest are only just starting to be used seriously on the public web, and new patterns and models have yet to solidify around them. And since they're relatively shiny, there's a danger of overkill - using them when normal forms should do, as you said.

      That said, the new techniques are good ways to enhance the usability of the web in modern browsers, so I guess it's one more tool in the toolbox. Speaking of which: is your generalised JScript library proprietary, or on the web somewhere? It sounds interesting.

    11. Re:Pros and cons? by downwa · · Score: 1

      My generalized JScript library was created for in-house use, but is languishing unused at the moment. It might be possible to get it released, though it would take some cleanup to make it truly generalized. If you're still interested, email me at DownsWE at muni dot org. I could at least give you some more details how I went about it.

      --
      Life's a lot like money-- you spend it, then it's gone. Spend wisely.
    12. Re:Pros and cons? by downwa · · Score: 1

      JSON is the notation-- you can use a hidden IFRAME instead, for better compatibility with older browsers.

      --
      Life's a lot like money-- you spend it, then it's gone. Spend wisely.
  3. I have only one point to make. by Slash+Watch · · Score: 2, Insightful

    You know, guys, there's a reason that we have separate application programs instead of doing everything through Internet Explorer. Believe it or not, it's not necessarily the best interface for a lot of things.

    1. Re:I have only one point to make. by Anonymous Coward · · Score: 2, Interesting

      XUL and XAMAL are being developed so that all applications WILL run through the intarweb...

      Only computationally expensive programs will be relegated to the desktop, everything data orientated will live on the web

    2. Re:I have only one point to make. by agraupe · · Score: 1

      That is true, but, as far as I can see, it has experienced some impressive results, like Gmail (I believe that is what we are talking about, right?). The fact is that GUI programming, and even programming in general, can seem quite daunting to the beginner. Although I am an average-to-good C/C++ programmer, GUI still confuses me for the most part (I always have to refer back to the API, is that normal?). Combining JavaScript and its merits (easy-to-learn, basically a subset of Java and C), with (D)HTML and its merits (the starting point for a lot of programmers, myself included, since you see results fast and it's easy to learn, all "HTML is not a programming language" arguments aside). This could be quite interesting.

    3. Re:I have only one point to make. by Klar · · Score: 1

      Believe it or not, it's not necessarily the best interface for a lot of things.
      Yes, but how many applications make is so easy to give you access to such a wide variety of viruses? I kid, I kid.

      Actually, I agree with the parrent on this one. I prefer applications to have their own gui. This can help where speed of use is an issue. Also, if you buy software, throw the cd in, and all that is on the cd are a bunch of .html files, you are prolly gunna be pretty pissy.

    4. Re:I have only one point to make. by MancDiceman · · Score: 4, Insightful

      Imagine yourself in 5 years time. The web browser has all this stuff on it which means it is as good an interface as any other GUI widget stack. Firefox or Safari or IE or whatever effectively is the window manager with tabbed browsing and links to your favourite 'applications'.

      The interface is fluid, keyboard shortcuts working fine and everything is as responsive as it is right now in your current desktop. Your applications are used over the web - you don't have to worry about software upgrades or fixing your parent's computer after some installation as everything is done by your ISP.

      Can you see that future? What is stopping it from happening?

      You're right, the browser is a crap interface. If you actually understood the technology being described, you would realise that it is an improvement to the interface to make all those things happen.

      The browser is a bad interface right now. JSON helps to make it a more suitable interface. Go figure.

    5. Re:I have only one point to make. by ceeam · · Score: 4, Insightful

      IE besides - "Web app" is a darn appropriate interface for a lot of things and definitely the single most widely spread and portable one. The inability to request a "callback" value from the server from the JS code is a huge PITA if you've ever tried programming those.

    6. Re:I have only one point to make. by Malc · · Score: 5, Interesting

      Web interfaces have two massive advantages: no need to install anything. They also work just about anywhere.

      You're right: a web page for a complicated will rarely match the UI of a dedicated application. Take Outlook's Web Access UI: it's pretty amazing, especially if you're using IE. It can be used almost anywhere without having the latest version of Office installed. It's still damned clunky compared with real Outlook, but sometimes it's better than nothing.

    7. Re:I have only one point to make. by hey! · · Score: 3, Insightful

      Well, I think you're missing the point.

      These applications areng going to use a browser interface. The are going to use the browser as a platform on which non-browserish presentation layers can be constructed.

      This is exactly the future that caused Microsoft to go bezerk over Netscape all those years ago.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    8. Re:I have only one point to make. by Mant · · Score: 1

      Maybe not, but web apps can usually be developed, deployed and maintained far faster and easier than writing custom apps. That can often outweight having the best interface, as long as the interface is good enough.

    9. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      "you don't have to worry about software upgrades or fixing your parent's computer after some installation as everything is done by your ISP."

      Which means that my software is full of spyware/adware and my ISP has a copy of all my documents? No thanks...

    10. Re:I have only one point to make. by uradu · · Score: 3, Insightful

      > You're right, the browser is a crap interface. If you actually
      > understood the technology being described, you would realise
      > that it is an improvement to the interface to make all those
      > things happen.

      No, a real improvement to the interface would be to move away from any technologies that mix (D)HTML and executable code. It's a recipe for unmaintainability and for driving self-respecting desktop developers to despair. True advances in distributed apps are approaches such as Mozilla's XUL. Alas, they're a step away from the quasi-declarative "programming" of (D)HTML back to the procedural programming of C and its descendants, not something artsy web "developers" like to hear.

    11. Re:I have only one point to make. by PianoComp81 · · Score: 1
      Imagine yourself in 5 years time. The web browser has all this stuff on it which means it is as good an interface as any other GUI widget stack. Firefox or Safari or IE or whatever effectively is the window manager with tabbed browsing and links to your favourite 'applications'.
      The problem I have with this network reliability. Many connections go down at least once a day (even if it's only for a few minutes). Also, what if you're using applications provided by someone other than your ISP? The network connection could go down between you and that application. Until networks are as reliable as the phone service (which will be a while - 15 to 20 years maybe?), I can't see people wanting to use this type of service.
    12. Re:I have only one point to make. by maxwell+demon · · Score: 2, Insightful
      Your applications are used over the web - you don't have to worry about software upgrades or fixing your parent's computer after some installation as everything is done by your ISP.

      Exactly that is something to worry about! Imagine you are writing something important with a web-based word processor. You are close to deadline, and all you have to do now is to print out that stuff (or to convert it to PDF and mail it). Nobody would be so insane to update his word processor at exactly this point. But with web applications, it's your app provider who decides when to update. Since at every time there's likely someone who is close to deadline with sonething, so the provider cannot avoid that. And the new version may have a slight bug or incompatibility which doesn't affect 99.9% of all users but completely breaks your file. Now remember you are close to deadline. Sucks, eh?

      Of course, I guess MS would dream of web applications: Don't charge for the program, charge for the time you use it! You are slow in writing? Well, too bad for you, you'll pay more! Of course in addition to paying for your internet access (with normal apps I don't need to be online unless I want to explicitly get data from the net or send data to the net; with web apps, you'll have to be online even for writing a simple text!) I don't think they (as well as many other companies) could withstand the temption.

      I guess in the world you envision (all apps are web based), paper and pen would get a revival (because writing with pen on paper is just cheaper). The text program would likely be started up only for typing in the final text.

      Also, web applications are very volnerable to DoS attacks. Imagine Word would be replaced by a hypothetical WebWord. Now you have just to make a DoS attack on the WebWord server, and suddenly nobody could edit his WebWord documents!

      No thanks, I prefer to have my software on disk.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    13. Re:I have only one point to make. by mornfall · · Score: 1

      Since when is JavaScript a subset of Java and C? Refer to http://c2.com/cgi/wiki?JavaScript

    14. Re:I have only one point to make. by TomorrowPlusX · · Score: 1

      I agree, but there is something odd about using OWA on a windows machine: When you first visit ( say, on a clean machine ) it seems to ask you for your Office 2k cd-rom.

      I have to assume this is because it's expecting ActiveX controls that office provides. Still, how creepy is it that going to a *website* prompts your browser for your office install cd.

      Thank heaven OWA allows other browsers and still provides an acceptable, if degraded, interface.

      --

      lorem ipsum, dolor sit amet
    15. Re:I have only one point to make. by Malc · · Score: 1

      Interesting. No I haven't tried it on a clean machine... work pre-installed Office 2003 on it. But yes, it does degrade well doesn't it? It's perfectly usable in FireFox.

    16. Re:I have only one point to make. by arkanes · · Score: 3, Insightful
      What's stopping it from happening is that the features that make a good browser for hypertext are not the same features that make a good client for, say, a business or data entry application. As a quick test, go hit the back button in any web application that uses this sort of technology. Does it do what you expect? Does the "back button" even make sense in the context of what you're doing?

      Hypertext is a lousy way of writing applications - in fact, most "web apps" have roughly zero relationship with hypertext. Network-transparent thin clients are interesting, but HTML/DHTML/current browsers are the wrong way to implement these things. Part of the problem is the issue of control - client applications need to be able to control the user interface to a degree that a general purpose browser simply can't allow. Something as simple as "Save changes at exit" is impossible in a browser - and you wouldn't want it to be. Same thing with control of the back button, or spawning new windows (or even dialogs, which you can do with IE).

      In short - the browser is a fundamentally poor platform for most applications. More to the point, we have and have had the technology for network-based application suites for years. ASP (application service providers, not the MS web platform) is gaining some mindshare, but it's not taking off like gangbusters.

    17. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      You are not a good C++ programmer.

    18. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      Maybe you should try using your piss-poor interfaces sometime.

    19. Re:I have only one point to make. by phutureboy · · Score: 2, Interesting

      Hell, check out Oddpost

    20. Re:I have only one point to make. by fireboy1919 · · Score: 1

      Actually, you're wrong about the "save at exit" thing. That would actually be fairly straightforward to implement in javascript.

      But there are plenty of things that aren't:
      -It is nearly impossible to make a more advanced text widget than what are available in html already.
      -Rendering images takes a long time in interpreted languages by nature (of course, javascript could become JIT and this problem would be gone).
      -You're sandboxed into the browser. You can't interact with other desktop apps. To do so would be to create a security risk.
      -Browsers don't work the same, but people expect them to. Most people don't know, for instance, that sound stuff is easier to get to work in IE, while events are more well supported in Mozilla-based.

      Most of these are fundamental problems, and they're not going to go away. If they do, of course, I'll switch to old browsers. I personally prefer to have a more restricted browser that isn't a virus magnet.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    21. Re:I have only one point to make. by lamz · · Score: 1

      You buy software? And it comes on a CD? Dude! WTF?

      --

      Mike van Lammeren
      It will challenge your head, your brain, and your mind.

    22. Re:I have only one point to make. by Vacindak · · Score: 0, Redundant

      Outlook's Web Access UI ain't half-bad, but you should see what the guys over at Oddpost did. Most incredible chunk of JavaScript ever.

    23. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      Maybe you should try rolling out an application upgrade to 5000 users, today.

    24. Re:I have only one point to make. by Klar · · Score: 1

      Well, that was more of a hypothetical situation..

    25. Re:I have only one point to make. by RiotNrrd · · Score: 1

      Although I am an average-to-good C/C++ programmer, GUI still confuses me for the most part (I always have to refer back to the API, is that normal?).

      Who wastes time memorizing an API when the docs are available online?

      Going back to the docs is pretty normal for me (unless it's something that I've done millions of times before).

    26. Re:I have only one point to make. by Glabrezu · · Score: 1

      Agreed, every time I have to develop complex web based interfaces I feel like I have to hack my way into something that wasn't designed for what I need to do. Truly hate it. It seldom feels right and clean, and I do consider myself a clean programmer.

      I don't think the issue is if you can do it with HTML or not, but wether you should. Its entretaining to push a technology to its limits and think you are a wizard, but its also a waste of time. I really hope XUL kicks off (its great, but its still hackish). It doesn't make sense to keep trying to fix HTML by adding new out of the hat components that try to make a file cabinet work as a database. They are just another hack.

      --
      Santiago
    27. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      -It is nearly impossible to make a more advanced text widget than what are available in html already.

      www.fckeditor.net, too bad it's quite slow. I wish Javascript had a JIT.

      -You're sandboxed into the browser. You can't interact with other desktop apps.

      In a way you can- you can exchange documents. And you can interface remote FS over WEBDAV. And you can save documents to WEBDAV folder.

      -? Browser's don't work the same?

      Take a look at desktop applications. None of these work the same. Compared to desktop apps, all browsers work completely the same.

      I agree making thin clients could be easier or more 'right way' using other technologies, but browsers are the only thing we have right now, and they are quite suitable as thin clients.

      Oh, ant the only problem that isn't possible to solve with web-apps is sending an event from server to client(browser). Of course you can do a polling loop in javascript on browser and waste client resources+bandwidth, or keep an open connection to server and close it when event occurs (waste server resources), but these are just hacks.

      --Coder

    28. Re:I have only one point to make. by Politburo · · Score: 1

      I guess in the world you envision...

      You make valid points, but don't put words in the mouth of the GP. It's rude and it undermines your argument. And calm down with the strawmen, already.

    29. Re:I have only one point to make. by Politburo · · Score: 1

      I've had that error occur as well. However, if you hit cancel, OWA still loaded normally.

    30. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      The other day I had fifteen tabs open for different things in Firefox. I went to save something, and the save dialog hung. The entire app then became unresponsive and I was forced to kill it and lose all of those tabs. The nice thing is that this did not bring down the dozen or so other programs that I was running. I'll leave you to figure out the moral of this little tale.

    31. Re:I have only one point to make. by fireboy1919 · · Score: 1

      Thanks for the tip. I have a webapp I was going to rewrite for the desktop because it needs an editor, but...I think I'll just use that one.

      And the thing about working the same: it's not a problem that they don't work the same; it's a problem that people expect them to do so. Everyone wants all webapps to work on all browsers.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    32. Re:I have only one point to make. by chris_mahan · · Score: 2, Interesting

      One solution i have come up with that works ok is this:
      *use xhtml only
      *use extremely light html (under 10k if I can help it)
      *no graphics
      *no fancy nothing
      *javascript sparingly (and yes I use xml-rpc to do no-refresh data submits) (Apple, fix Safari's DomParser stuff. See http://developer.apple.com/internet/safari/safari_ faq.html#anchor19.)

      As far as server technology, remember to load the minimum (files, class libs, etc), optimize db queries, split pages logically for the USER, pool db connections, and return the page in 0.4 seconds (my intranet pages average .4, with .3 as common)

      And yes, I do do this for a living.

      Last but not least: do not, I repeat, do not write code that depends on IE. I'm not saying Firefox or Opera are taking over, I'm saying IE7 on Longhorn will break just enough of your IE 5.01 apps to propel you into howling fits of deranged rage.

      --

      "Piter, too, is dead."

    33. Re:I have only one point to make. by arkanes · · Score: 1

      Save at exit of the page is possible, if the brower allows you to veto navigation. Save at exit of the browser is totally impossible, and is what I was talking about.

    34. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      You are ********fundamentally********* a homosexual.

    35. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      Still not impossible. We do this already with invalidating sessions when a user closes the browser for our web app. When the browser is closed the onunload fires and opens a new window with some data from the original page which is immediately submitted back to the server and closes itself. They would have to kill the process for the save not to work. Plus when working from the perspective of owning the browser for that web application you can always strip the chrome and replace it with your own that looks the same but behaves the way you need it too. It's not difficult.

    36. Re:I have only one point to make. by Anonymous Coward · · Score: 0

      Thanks but no thanks, Scott McNealy. You can take your "the network is the computer" and shove it up your ass. The network is the source of lag and the avenue of intrusions. Nobody but your desperate, dying company and its clueless mindless fanboys wants to go back to the dinosaur days of dumb terminals.

    37. Re:I have only one point to make. by kgbspy · · Score: 1

      It's funny you should make that point, because Microsoft are actually starting to move down that road. Industry spies have indicated that MS are currently working on a project that has been codenamed Framework for Realtime E-Deployment of Internet. Expect the competition to be very fierce when the product is launched in 2006 - something along the lines of...




      wait for it...




      FREDI vs JSON.

      --
      ~
      ~
      ~
      -- INSERT --
    38. Re:I have only one point to make. by agraupe · · Score: 1

      Well, not litererly, but it does take some features and syntax from both, thus making it relatively easy to upgrade from JavaScript into a more powerful language.

    39. Re:I have only one point to make. by chris_mahan · · Score: 1

      >Save at exit of the browser is totally impossible, and is what I was talking about.

      The browser interface is sandboxed like a little computer inside your current computer.

      User understand very well that if they hit the power switch on their PC while in the middle of editing a document, the thing won't save.

      Likewise the browser. Enough people use hotmail and AOL to understand that if you close the browser without clicking that "SAVE" button, you're actually not going to get a save (and some people rely on that feature to not save their stuff. Amazing, but I have seen it with my own eyes.)

      I say that if your web app is clear and well behaved, the user won't be confused and click "back" or close the window when they're not supposed to.

      --

      "Piter, too, is dead."

    40. Re:I have only one point to make. by lamz · · Score: 1

      My reply was partly a joke, and partly an honest observation. I had to really think about the last time I bought software that came on a CD, and after a bit of thinking realized that it was Warcraft III, and I bought it around 18 months ago.

      Who else remembers when a "new game" was typed in from source code printed in a magazine like Compute?

      --

      Mike van Lammeren
      It will challenge your head, your brain, and your mind.

    41. Re:I have only one point to make. by Klar · · Score: 1

      heh Warcraft III..

      I actually bought Half Life 2 the day it came out because I wanted to be able to play CS online without the hassel.

      Before that, the last game I bought was uhhhh Quake 2.. haha

  4. Click below to read more about it. by Threni · · Score: 5, Funny

    With all that stuff going on it's a wonder it didn't click itself!

  5. Let me guess... by ceeam · · Score: 1

    Michael Clark usually runs corporate IT meetings, right? I mean - you can't just come with this buzzfest without due training.

  6. Just Great! by deutschemonte · · Score: 1, Insightful

    Now my clients' computers can be compromised even faster because this language/protocol is "light weight".

    --
    The preceding message was based on actual events. Only the names, locations and events have been changed.
    1. Re:Just Great! by nagora · · Score: 1
      Now my clients' computers can be compromised even faster because this language/protocol is "light weight".

      Are you suggesting that XML is more secure because the average skiddie can't be bothered to type all that bloated markup? You might be right, actually...

      TWW

      --
      "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
    2. Re:Just Great! by fforw · · Score: 1
      Now my clients' computers can be compromised even faster because this language/protocol is "light weight".
      If you can't write a secure web application you are fucked in any case. If the web application is well written this makes absolutely no difference from a security point of view.

      In most cases implementations will use this as javascript enhanced alternative to a static html page based web application. The website will expose the same objects with the same data it does via html. The only difference being that the html data is layouted and the JSON data is raw.

      And even if you use JSON as only means to use your website it makes no difference in security. You just have to design a RPC API which is secure enough for your purpose. And you have all the means available to make this RPC API secure. SSL, Authentication, Access control, all that can be combined with JSON if you want to.

      --
      while (!asleep()) sheep++
  7. Fix HTML instead? by Spiked_Three · · Score: 3, Insightful

    I've had to resort to all sorts of tricks to avoid postbacks in my current (aspx) development efforts. First we used a thrid party soap-xml RPC like this thing. Then we switched to an IFrame for the postback portion. Then I noticed that MS is including their own new and improved soap-xml RPC thing in .Net 2. Now I read about this.
    Seems it is a problem a lot of people need/want to solve - but to be honest, I am tired of having so many different solutions to a problem I should not have to begin with. Isn't there something that can be done with the HTML standard to elliminate the need? Life would be so much better down that path.

    --
    slashdot troll = you make a compelling argument I do not like the implications of.
    1. Re:Fix HTML instead? by Malc · · Score: 2, Insightful

      HTML was designed as a markup language for text. All these things you're complaining about result from trying to shoe-horn HTML in to an application it was never designed for. It still works pretty well though, all things considered.

    2. Re:Fix HTML instead? by TheRaven64 · · Score: 3, Interesting

      I don't think HTML is to blame so much as HTTP. The integration of something like XMPP into the browser would be a huge improvement, since it would allow arbitrary XML to be pushed to the client without the need for polling (which is ugly, and no less ugly if it's done in the background without the need for full page refreshes.

      --
      I am TheRaven on Soylent News
    3. Re:Fix HTML instead? by Spiked_Three · · Score: 1

      No shit? I complain about HTML not having the ability a lot less then I complain about having to write apps in HTML to begin with. But for some stupid reason, everyone thinks the web is the place to write applications. I wonder where they got such a stupid idea?

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
    4. Re:Fix HTML instead? by Jetifi · · Score: 1

      Heh, I had the exact same thought. I've done a basic prototype called Gradient. The next version uses a much nicer integration model than the first one. Put simply, loaded documents become nodes on an XMPP network, able to communicate with each other, receive broadcasts, etc.

      At the moment, the concept is demonstrated with an SVG browser in Java. Once the semantics of the idea are ironed out I'll move over to HTML and Firefox.

  8. And what about php? by Anonymous Coward · · Score: 2, Interesting

    If you want to interoperate with PHP, I'd suggest Harry Fuecks JPSPAN as it is quite nice at hooking javascript up with serverside php

    As for xmlhttprequest, it's rather easy to make neato web applications with it. Here's something I coded up the other night (only seems to work in firefox at the moment though): http://www.james-carr.org/index.php?p=8



    Cheers,
    James Carr
  9. Perfect for the web? I don't think so by Anonymous+Cowherd+X · · Score: 5, Interesting

    Example in JSON:

    {"menu": {
    "id": "file",
    "value": "File:",
    "popup": {
    "menuitem": [
    {"value": "New", "onclick": "CreateNewDoc()"},
    {"value": "Open", "onclick": "OpenDoc()"},
    {"value": "Close", "onclick": "CloseDoc()"}]}}}

    The same thing in XML:

    <menu id="file" value="File" >
    <popup>
    <menuitem value="New" onclick="CreateNewDoc()" />
    <menuitem value="Open" onclick="OpenDoc()" />
    <menuitem value="Close" onclick="CloseDoc()" />
    </popup>
    </menu>

    Perfect for the web as doesn't suffer from XML's bloat and is custom made for our defacto browser language.

    Take a look at those examples and try to explain how is JSON free from bloat when in fact it is even more bloated and slightly more difficult to read and write by humans? It's just another notation with no obvious advantages.

    1. Re:Perfect for the web? I don't think so by LiquidCoooled · · Score: 1

      JSON looks like LISP.

      *shudder*

      --
      liqbase :: faster than paper
    2. Re:Perfect for the web? I don't think so by metaparadigm · · Score: 5, Informative

      Yes, although this is an XML DTD discussion. Most DTDs including the XML-RPC and SOAP DTDs don't encode using attribute values but instead using child elements with character data (apparently this is the XML best practice). Much Much bigger.

      Also, the JSON takes one line of code to parse and access natively in our defacto web browser language 'JavaScript'.

      The second requires a bloated JavaScript XML parser (as this is not built in to many browsers) and CPU intensive processing and a cumbersome API to get the data out. Also try doing 100 RPC calls a second with SOAP in a browser (this can be done with JSON-RPC on a local network - 10ms round trip on simple methods).

    3. Re:Perfect for the web? I don't think so by EvilJohn · · Score: 2, Informative

      I think you're the missing the point. It's not the fact there's those little simple CreateNewDoc() functions, it's the binding to the Java objects on the backend that's simple to create, and that's the part the 'free from bloat'.

      --

      Less Talk, More Beer.
    4. Re:Perfect for the web? I don't think so by SvendTofte · · Score: 1

      Importing the datastructure into the language is very easy. In JS you can basicly go "eval(datastring)". No need to either a custom XML walker, or invoke some ActiveX, or create a document/fragment.

      Other obvious things, is that the "menuitem" notation in JSON is actually an array, this is not the case in the XML case. There we just have siblings, with coincidentally the same names. So JSON has richer information (this obvious alot of duplication, only one menuitem, instead of three).

    5. Re:Perfect for the web? I don't think so by MetaMarty · · Score: 1

      Yes, it does look like Lisp, but people often forget that XML does too. XML/JSON is just Lisp in a different syntax.

      There's nothing wrong with Lisp. It's one of the most underrated languages today. Programmers today start their eduction learning Java, OO, C and other modern stuff without looking at the foundation of modern computer science. I love the way Lisp can be used to have self contained pieces of code with minimal side effects.

    6. Re:Perfect for the web? I don't think so by Anonymous+Cowherd+X · · Score: 1

      Let's not sacrifice doing something right for momentary convenience. Sure, JavaScript is built into most browsers, but it's a horrible hack and is definitely not something to build upon. XML will become as much an integral part of browsers as JavaScript has and when that happens standardized ways of reducing the bloat will be accepted. There is no need for JSON and its crippled kin.

    7. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      Much Much bigger.

      FUD. XML compresses very well and practically every browser you will ever use supports the gzip transfer encoding with HTTP.

      The second requires a bloated JavaScript XML parser (as this is not built in to many browsers)

      FUD. Every web browser that JSON targets has an XML parser built in. They didn't call it XMLHttpRequest for nothing.

      Also try doing 100 RPC calls a second with SOAP in a browser

      FUD. Using XML does not mean that you must use SOAP, in fact Amazon says that their REST API is far more popular than their SOAP API. Both use XML. You can't use SOAP as a reason to dismiss XML.

    8. Re:Perfect for the web? I don't think so by ivec · · Score: 2, Interesting
      The previous does choose a best-case format for XML, relying on attributes instead of elements whenever possible. To be honest, what would be the actual SOAP encoding for the equivalent JavaScript data structure?

      Now what would you think of (dropping quotes and spaces when unnecessary for parsing):
      {menu:{id:file;value:"File:";
      popup:{menuitem:({v alue:New;onclick:"CreateNewDoc()"}
      {value:Open;on click:"OpenDoc()"}
      {value:Close;onclick:"CloseDoc ()"})}}}
      Now what if built-in filter allowed you to generate either this compact blurb, or a neatly auto-formatted and indented form?

      The JSON format (which I just discovered) is nearly identical to a format I have been using for 10+ years - with which this sample is compatible. The i/o implementation I use internally is in C++, and supports a binary, compressed, and encrypted formats as well. An incomplete rewrite of it in C is available at http://ivan.vecerina.com/code/datatree/.

      I like JSON more than XML - because it offers a natural representation of hierarchical data structures seen most languages: a tree of records(/objects), arrays(/collections), and leaf values(/simple data fields).

      XML has many qualities, but it is not the natural solution/format for such data structures. When should text data be used in XML? When should you use an element rather than an attribute in XML?
      XML forces you to either select a standardized mapping that introduces redundant clutter (SOAP), or accept the complexity of an application-specific mapping.
    9. Re:Perfect for the web? I don't think so by sporty · · Score: 1

      Also, the JSON takes one line of code to parse and access natively in our defacto web browser language 'JavaScript'.

      The second requires a bloated JavaScript XML parser (as this is not built in to many browsers) and CPU intensive processing and a cumbersome API to get the data out.


      Give us a CPU speed, amount of memory available, amount of memory used, number of cycles used and code for each parser. I want to know the features of these parsers, and why they were chosen (SAX vs XML-Pull vs DOM). I'd like to be able to reproduce your "numbers" on my machine, and if I can, optimize the XML parser used, 'cause 100RPC calls a second vs 10ms round trip using different softwares isn't a fair test.

      Otherwise, anyone (I) can say, "nuh uh" and be done with it. :)
      --

      -
      ping -f 255.255.255.255 # if only

    10. Re:Perfect for the web? I don't think so by OmniVector · · Score: 1

      lisp was at least 50 years ahead of it's time. it will be probably another 50 before people realize functional programming's expressive power.

      --
      - tristan
    11. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0
      Beside the point that JSON seems to be optimized for JavaScript, ATV (http://www.mark13.org/atv/) is even more sparse and C alike:
      menu {
      id = "file"
      value = "File"
      popup {
      menuitem { value="New" onclick="CreateNewDoc()" }
      menuitem { value="Open" onclick="OpenDoc()" }
      menuitem { value="Close" onclick="CloseDoc()" }
      }
      }
    12. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      Lisp is rarely used as a functional language. Almost never in fact. You'll see a lot of HOF in Lisp code, but that doesn't make it functional; that's just a result of having functions as first-class objects.

      Functional programming won't take off until people have nothing better to do with their days than thread monads through all of their code to change its reporting policy.

    13. Re:Perfect for the web? I don't think so by Cyn · · Score: 1

      As other replies have noted, you can just eval the JSON.

      Well, you can also just use an XSLT to translate the meaningful XML into JSON, or whatever other standard your heart desires.

      So, you're both right.

      --
      cyn, free software and *nix operating systems enthusiast.
    14. Re:Perfect for the web? I don't think so by Bazzargh · · Score: 2, Insightful

      It strikes me the JSON version would be *much* larger for non-western languages. It can only include non-ascii characters in the data via the use of unicode escapes, which are 6 bytes long (\uXXXX), as compared to 2 in XML using an appropriate charset. It also lacks object references, so can't be made as compact as an arbitrary JS program.

      JSON-RPC doesn't seem to be intended for use in interchange, but for websites, since it relies on browser security for the 'efficiency' of being able to use eval() in its JS implementation. That being the case, I can't see why you'd choose to use this rather than return arbitrary javascript to the browser.

    15. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      Let's not sacrifice doing something right for momentary convenience.

      You're kidding, right?

    16. Re:Perfect for the web? I don't think so by Entrope · · Score: 1

      As someone pointed out, your example XML is not "best current practice" with XML. In addition to using attributes to carry user data, you have not specified schema namespaces for any of your elements. Adding the method specification envelope for JSON and either SOAP or XML-RPC puts XML at even more of a disadvantage.

      That is one of the biggest WTFs I have about SOAP: You have to negotiate service location already. Why not negotiate the schema at the same time? I suspect I know the answer -- that it would make the schemas bigger and break in some cases -- but that's just another sign of XML misdesign.

    17. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      First of all, does your XML example correspond to any actual XML DTD in use? Most of the time, the way XML is used it never ends up anywhere close to the simplicity of your example.

      Second, even though in this example, the level of complexity seems similar, the XML parser will inevitably be much more heavyweight, due to the overcomplicated design of XML.

      Third, I don't see how the JSON version is any harder to read and write than the (unrealistic) XML version; in fact IMHO it's slightly easier. An S-expression would be even better.

    18. Re:Perfect for the web? I don't think so by cortana · · Score: 1

      Whoa, that JSON stuff practically _is_ an S-Expression.

      What's old is new again. :)

    19. Re:Perfect for the web? I don't think so by Zelphyr · · Score: 1

      It may not necessarily be less bloat and is less readable but the advantage is that the former will immediately be turned into a JavaScript object whereas the latter must be marshalled into an object using custom JavaScript code.

    20. Re:Perfect for the web? I don't think so by Edward+Kmett · · Score: 1

      The main reason to consider it, IMHO, is that it parses a couple of orders of magnitude faster on the browser than the equivalent XML document, with about the same information content.

      Now, the problem is the lack of namespaces, xpointers, and all of the other standards that make XML worth having.

      --
      Sanity is a sandbox. I prefer the swings.
    21. Re:Perfect for the web? I don't think so by mrogers · · Score: 1
      Functional languages assume a certain method of problem-solving: you break a problem down into smaller problems, then break each of those down into even smaller problems, until the parts are trivial to solve. Solve the parts, recompose, and you have a solution to the overall problem.

      Unfortunately, most people (including most programmers) don't solve problems that way. If they did, "software engineering" would be a day-to-day reality, not an oxymoron. People often start attacking a problem with only a vague idea of how they're going to finish. They make the first few steps, backtrack, try a different approach, solve a couple of easy but unrelated parts and then try fitting the pieces together. Maybe it doesn't work but it gives them a new insight into the structure of the problem, so they throw a couple of pieces out and try a new approach. Repeat until the problem is approximately solved. This gives rise to bugs, bloated APIs, the compile-run-debug cycle and everything else software engineering has been trying to save us from, but we keep doing it because it's the only way to solve a problem you don't really understand, and we keep using procedural languages because they support our hackish, fuzzy, intuitive style of problem-solving.

    22. Re:Perfect for the web? I don't think so by mrandre · · Score: 1

      I don't know. I'd generally say "Screw best practices. I'm doing what works." I find the XML easier to read. I wouldn't consider nesting tags. That's what the attributes are there for. If XML police want to come arrest me for that, I'm going down fighting. :-)

      We use XML for our JS data sending needs, and have no performance issues. We use attributes as in the above example, so our XML is lean. I hate to say it, but this looks like re-inventing the wheel. Whatever floats your boat, though.

      --
      "I don't want to achieve immortality through my work. I want to do it by not dying." -Woody Allen
    23. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      How safe is it if it takes one line of code to parse and access natively? Once you do any sort of validity checking, you're hosed.

    24. Re:Perfect for the web? I don't think so by Anonymous Coward · · Score: 0

      How about:

      menu id=file value=File
      popup
      menuitem onclick=CreateNewDoc() value=New
      menuitem onclick=OpenDoc() value=Open
      menuitem onclick=CloseDoc() value=Close

      that encoding is called ASCII Markup Language (AML). You can translate XML to AML, and back, on
      http://homepages.cwi.nl/~jacob/aml/cgiaml.html

  10. double edged boon to users by willCode4Beer.com · · Score: 2, Insightful

    and slow torutring pain for developers.

    The user benefit will come from more usable dynamic web applications when this is applied well. The users will suffer when everbody decides their pages need this even when they don't. Kiss that CPU goodbye. The users will get to suffer when they decide to use a platform that didn't rank high enough for the sites QA team to bother checking.

    When used and tested well, this can provide some awesome benefits. Hopefully, we'll see more than simple ad/news/stock tickers. Imagine a wiki where several people can edit the same page at the same time, a list of users editing on the side, and a diff color cursor for each user. We could get live spell checking on a web based email client, in a wiki edit window.

    Developers, our lives have just become hell. Now PHB's will want this technology to be used everywhere. And its gonna have to work the same on every platform. Browser bugs, browser inconsistencies, oh my....

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
    1. Re:double edged boon to users by EvilJohn · · Score: 1

      Yeah, god forbid we actually work for a living, and not whine about it.

      Seriously, this is what it means to be a real developer, solving hard problems. It's what good developers do, and what great developers do well.

      The next step will be to tie this to a backend framework for easy site building.

      --

      Less Talk, More Beer.
    2. Re:double edged boon to users by dtfinch · · Score: 1

      Thank God I've been doing this on my own for quite some time, and watching it work in every browser, though I've never referred to it as JSON because I'd never heard of JSON.

  11. I dare to disagree. by hummassa · · Score: 2, Insightful

    It may even not be the better interface for some things, but it *is* the better way to deploy the things. It is specially better if you have to deploy thousands of copies.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
    1. Re:I dare to disagree. by arkanes · · Score: 3, Insightful
      Eh. Not really. Auto-updating isn't especially difficult, especially in the close environments most web applications are written for. Java Web Start, for example, is a cinch. It's not too hard to roll your own mechanism either. Web applications are trendy now, though, despite there being no objective advantage in most circumstances.

      Refresh-less updating isn't new, either - I've been doing it for at least 3 years, without the XML stuff. Even with it there's only so much you can do on the client, by design. The web is a decent platform for reporting. It's a good place for universal access (see gmail, for example). It's a lousy place to put your data-entry heavy business applications.

  12. Nice by wintaki · · Score: 0

    It is nice to be able to do this, but it begs the question - how far should this go? At what point is a browser app indistinguishable from a normal app? Or maybe that's the point?

    1. Re:Nice by Anonymous Coward · · Score: 0

      > but it begs the question

      No it doesn't.

  13. Coolaid by willCode4Beer.com · · Score: 1

    You just need to drink the coolade.

    Haven't you been hearing all the hype for the last few years.
    If we make all applications web based then platform doesn't matter. Of course, to implement all the features the PHB wants, well the web app is only gonna work on one platform. And of course, it'll take more time to do web hoodoo-voodoo than it would to just build in C++/Delphi. But, it will run from a "Web Broswer". It'll if a "web" application.

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
    1. Re:Coolaid by Anonymous Coward · · Score: 0

      Yep. For all of their talk about it working everywhere, it really doesn't unless you go through some absurd degree of per-platform special-casing, for the 594395734987 web client incompatabilities. And then it doesn't work as well as a thick client, doesn't look as good as a thick client, and is never as functional as a thick client. Developing with Flash would provide a much greater level of conformity, but it still suffers from an absence of platform interoperability.

    2. Re:Coolaid by stupidfoo · · Score: 1

      It's Kool-Aid

      Did you mean: kool aid

    3. Re:Coolaid by willCode4Beer.com · · Score: 1

      yes, you are correct

      --
      ----- If communism is a system where the government owns business, what do you call a system where business owns govern
    4. Re:Coolaid by Anonymous Coward · · Score: 0

      I think he meant: Flavor Aid

  14. A standard? by tod_miller · · Score: 1

    OK they can call it a standard, but this is just the implementation of a design, that doesn't make it a standard! :-) adoption does. I want to play with it today! I am doing some web stuff... thinking how it will integreate with strust and jsp... hope ok, I am starting to hate struts!

    Is spring easy enough to learn without too many 5 hour sessions followed by kicking yoruself and going, oh, I should do that FIRST!!?? (a struts thing..)

    But it is great to see it.

    In other news msn search B3tA announced it had develped a 'kewl' better than google technology that shows suggested search keywords. Microsoft deny copying google, or reading JSON spec.

    --
    #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
  15. AAARRGH! by iantri · · Score: 1
    JSON, JSON-RPC, Java, JavaScript, Perl, TCL, XML, XMLHttpRequest, MSXML, DHTML :BOOM!:

    :head explodes from acrynym overload:

    1. Re:AAARRGH! by maxwell+demon · · Score: 1
      :head explodes from acrynym overload:

      HEFAO? :-)

      But anyway, Java and JavaScript are no acronyms at all, and XMLHttpRequest is only partially.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:AAARRGH! by game+kid · · Score: 1
      JSON, JSON-RPC, Java, JavaScript, Perl, TCL, XML, XMLHttpRequest, MSXML, DHTML

      Yes, it's a lot. I'm still trying to figure out Java, C# and C++, sans all these languages around. 500 languages and still nothing on...

      :head explodes from acrynym overload:

      Careful! The PC might explode too--no wait, that's operator overload, *sigh*...

      --
      You can hold down the "B" button for continuous firing.
    3. Re:AAARRGH! by game+kid · · Score: 1
      HEFAO?

      OMG T3H B35T 4C0RNYM EVAR!!!11!!one but seriously I like it too.

      Also, we can help him with the acronym headache. Remove the MS technologies and we'll already be down by at least 10 letters. (Not that Netscape hadn't been trying DHTML with their layers...)

      --
      You can hold down the "B" button for continuous firing.
    4. Re:AAARRGH! by imbaczek · · Score: 1

      What is worse: that I know what but one of these mean, or that I don't know what :BOOM!: stands for?

      ;)

    5. Re:AAARRGH! by Anonymous Coward · · Score: 0

      lol wtf? roflmao!

  16. Another language, another standard by drgonzo59 · · Score: 2, Funny

    When will the average programmer be able to keep up? I am sure in India they are already teaching classes on this ;-)

    1. Re:Another language, another standard by Bozdune · · Score: 1

      ha, but the way you eat someone's lunch the way the Indians are doing to the rest of the world is to get good at the crappy stuff that's out there and then stay on top of it, regardless of the pain.

      The scary part is, I happen to know (from working with Indians) they ARE teaching classes on this stuff, or at least similar stuff. I could use some classes myself. I just wrote a few pages of jscript and I am in severe browser standards pain just like I was the last time I did this, 2 years ago. There's still no decent place to find all the tricks of the trade. And finding the reasonable information in between all the stuff that the w3c "claims" is there but isn't, and all the stuff that random web pages "claim" is there, but is actually only available in IE, is a real problem.

      I wish somebody was teaching classes at our shop. It's such a moving target, most of the info out there (books included) is all worried about stuff that I couldn't care less about any more. Those big Indian shops have whole reams of jscript floating around to do all the "standard" stuff that I'm having to invent from scratch. Normally we're way faster programming than any Indian shop, but every time we dive into this shit they blow our fucking doors off.

      Have I mentioned how much I hate this?

      ah, well, back to the salt mines.

    2. Re:Another language, another standard by cgrand · · Score: 1

      In India, I don't know, but at work (somewhere in France) we are already using this stuff (embedded in JSP tags).
      I'm planning the next evol: model replication between the client and the server.
      I'd like to add that, despite loud mouthes, it can be used to make the web more RESTful: URLs only locate representations of resources (business objects and processes). The URL-space is not cluttered any more with technical URLs used to page through lists or to request new fields to be added to a form.

  17. Forget all the acronyms... by Anonymous Coward · · Score: 0

    Basically it lets you do a background request asynchronously to update a database or whatever without a page refresh. This makes the users experience better, reduces bandwidth, reduces server load, and is generally a much nicer way of doing things.

    I've recently implemented a system using this to talk to a php application and a mySQL database. I didn't use any fancy remote procedure calls - I just made a get request and sent a web page back containing javascript function calls. Simple.

    Anyone who can program server side and client side can use this effectively.

  18. ICBW but: Re:Perfect for the web? I don't think so by StandardDeviant · · Score: 2, Informative

    Because XML requires a parser, and this JSON thing looks (at least to my very rusty eyes, it's been ages and ages since I touched front-end stuff like javascript) like it could be evaled into a jscript array, which is a *much* quicker operation and requries no external libraries to operate. I've done something like this before, working at a startup back in 2000, with an invisible iframe (we were targeting IE only) that was running jscript which would poll the server api for various things and eval the jscript-formatted output to display stuff (kind of like proto-web-services before such a thing was popular). It sounds kludgy as hell, and parts of it were, but it did work suprisingly well for most of the things we asked it to do. The front-end people had written, I swear to god, a complete windowing/GUI library in dhtml with draggable, resizeable windows (not popups) and everything that our (suite of) ASP-paradigmed applications were flown into.

  19. Re:ICBW but: Re:Perfect for the web? I don't think by Anonymous Coward · · Score: 0

    (we were targeting IE only)

    You should have aimed better, that SOB piece of trash is still around!

  20. NO, NO, NO, NOT the browser by Anonymous Coward · · Score: 0

    The "browser" is not the issue here. The real issue is HTTP and HTML. Don't shoot the messenger here. Those protocols were NOT designed to create "applications", but are now used to do just that. Stateless connections, wonky navigation, limited widgets, all make for some serious shortcomings. We won't be seeing anything better until we see a major shift in the underlying infrastructure of the "web".

  21. Want to see a fantastic example? by stanhawkins · · Score: 2, Interesting

    We've written a client for the Remedy Action Request System using JS and the XMLHttpRequest object, with a Java based back end. The client is faster than we ever imagined, and is twice as fast as Remedy's own client. So if you fancy seeing some Shockwave movies of a overly complex web client, which demonstrates exactly what can be achieved with the XMLHttpRequest object, visit: http://www.symbiontsolutions.com/tour Stan

    1. Re:Want to see a fantastic example? by stanhawkins · · Score: 1

      And let me apologise for not noticing that I should have put markup into my post :-)

      Movies of JS and the XMLHttpRequest object in action.
    2. Re:Want to see a fantastic example? by Anonymous Coward · · Score: 0

      Remedy is the shitiest, and most horribly-coded application I have ever had to use; my heart goes out to you, who even in the midst of programming misery, can find some small joy to share with others.

      This is real beauty.

    3. Re:Want to see a fantastic example? by Anonymous Coward · · Score: 0

      Remedy really is an awful company with appalling products. But this really does look like an excellent web client. Perhaps I should recommend it to my employer :-)

      Oh, damn. I work for Remedy.

    4. Re:Want to see a fantastic example? by elemental23 · · Score: 1

      twice as fast as Remedy's own client

      Not a difficult feat, I'd imagine. I spent about a year fighting with that PoS at a former job and nearly quit over it a number of times. Slow as hell plus the worst interface I've ever seen on a web app.

      --
      I like my women like my coffee... pale and bitter.
  22. Re:double edged boon to dev by witte · · Score: 1

    Well, look at it like this :
    As long as PHB want things implemented that they may not really need with technology they may not understand, *we* still have a job.

    I for one welcome ou<connection reset by JSON-RPC Overlords>
    .

  23. New exploit techniques ? by Homology · · Score: 2
    "Seen those funky remote scripting techniques employed by Orkut, Gmail and Google Suggests that avoid that oh so 80's page reloading (think IBM 3270 only slower)....."

    I hope I wasn't the only one that shuddered when I read "remote scripting techniques".

  24. uhh, did anyone realize? by Anonymous Coward · · Score: 0

    ...uses the lightweight JSON format instead of XML (so it is much faster).

    So, in other words, the speed this provides is negated by the slow, inefficient, proprietary nature of the POS that is java?

    1. Re:uhh, did anyone realize? by Anonymous Coward · · Score: 0
      So, in other words, the speed this provides is negated by the slow, inefficient, proprietary nature of the POS that is java?

      Hahahahahahaha!

      Fool.

    2. Re:uhh, did anyone realize? by insomniac247 · · Score: 1

      JSON has nothing to do with Java. It's only coincidence that the implementation of JSON-RPC mentioned in the post happened to be a Java implementation. You could just as easily implement JSON/JSON-RPC in whatever language you want.

  25. Just what we need.... by Adrian.Challlinor · · Score: 2, Insightful

    ... Yet another standard that can confuse just about everyone. "You have a problem on the server, wait thats written in JSON, we only do XML. The JSON developer is on vacation."

    1. Re:Just what we need.... by cheezit · · Score: 1

      "...we only do XML. The JSON developer is on vacation."

      "No, he's not, he's right here."

      "That's *Jason*. The JSON developer isn't here---she's named Exemelle."

      (sound of heads exploding)

      --
      Premature optimization is the root of all evil
  26. Trade-offs by Anonymous Coward · · Score: 1, Insightful

    It's simply a matter of what trade-offs you want to make. Yes there are platforms that are better for building GUI apps. One, not insignificant, problem after you've created the app however is the issue of updating and/or deployment.

    So you get to pick:
    "I want everything there is for a GUI (fast, stateful, all the controls, etc)."
    -- or --
    "I want to ease deployment to my internal and external customers and am willing to go without some GUI elements to gain that."

    Another issue is what you are trying to do. Are you attempting to feed realtime data to a user? Are you providing and interface to data that's encapsulated only on the users PC and not on some back-end? One is good for a web app and one not so much.

    Then there's also the issue of testing. If you have an app that ends up being an executable somewhere you either have to limit the user to a specific OS/hardware or you have to do some significant exhaustive testing to ensure compatability. With web apps this is reduced (but not eliminated).

    Personally I've been a developer on a web app internally for 6 years now. We made the switch from a Win32 application to the web just as I moved to the group. The old app required flying out to a site and installing it (and updates several times a year). It was a maintenance nightmare. Today the web app serves customer service at 7 sites across the country which is an extremely high volume of calls. The same web app also serves 10 external clients and will be opened up to 30 more this year. I would hate to think of deploying an executable to 30 clients considering the problems we had maintaining just one 6 years ago.

  27. Pushlets by tezza · · Score: 3, Informative
    http://www.pushlets.com

    This is a server side push framework based on the same idea. It preceded GMail et alia.

    --
    [% slash_sig_val.text %]
    1. Re:Pushlets by Fat+Cow · · Score: 1

      I've seen this before - java only. The good thing about this is that it's multi-language on the backend.

      --
      stay frosty and alert
    2. Re:Pushlets by Apocalypse_now1 · · Score: 1

      What would be really useful is to combine pushlets and JSON-Java-RPC and update individual parts of the client browser based on server pushing. This would allow great flexibility in scaling and fit nicely as a tool for things like real-time traffic, weather and news. An RMI-style callback is where I think this could be useful as well.

  28. Accessibility by Anonymous Coward · · Score: 0

    Accessibility is the real thorn in the side of this I reckon. We need to realise that we have to keep alternative browsers uptodate as well (I've yet to see a browser take advantage of Aural stylesheets).

    The main problem here though isnt the fact that the current crop of accessibiltiy browsers arnt uptodate: its a fundamental change in the way a page is rendered. Before, a complete page would be sent, now with this technology sections of a page can be updated. The trick is to descibe any updates to the user whilst maintaining the concept of staying on the same page.

    Don't get me wrong, I'm a web dev with 8 years experience, and I use XMLHTTPRequest with XML-RPC all the time (checkout the excellent js-o-lait library), and I really dig this tech, but just hope it doesnt take us back to "a website for some, a website for the rest" development.

  29. Malarky by sporty · · Score: 1, Flamebait
    This is a lot of junk except in exceptional cases.


    We have machines that are now in the gigahertz. Even a 0.5 ghz machine can process XML with some speed.


    We have machines that have tons of memory, so even an inefficient DOM parser which loves using memory, can handle a large XML packet (use sax for that).


    We have parsers that are a bit smarter than the slow ones, namely XML-Pull parsers and SAX.


    When implementing someone else's protocol, something that is readable is awesome, because documentation isn't always there. Using XSLT, you can also port one XML type to another.


    We have land lines that can transmit compressed data easily at 11kb/s (based on a 56k modem).


    All json provides, is a way to eek out a few less cycles, a little less memory depending on how you parse it, and a few less bytes per second over XML. It's less readable and it isn't as widely used. What problem are we solving again?

    --

    -
    ping -f 255.255.255.255 # if only

    1. Re:Malarky by Transdimentia · · Score: 1

      Wow, I'd suspected this thinking was going on but I hadn't seen such a blatent statement. This seems to parallel the "we've got more memory and disk so lets throw in bloat instead of running 2x as fast".
      I have no problem using XML where it makes sense, but if performance is your priority over compatibility, XML rarely makes sense.

    2. Re:Malarky by sporty · · Score: 1

      XML is not faster than a byte position oriented language. What is being provided is not byte oritented. All data is not at a fixed position nor is it hinted by the data format. i.e. when a { is at spot 1, } can be expected at one or a few places distant from it. This language nor XML can do this. They both lose equaly in this department. TCP/IP is a perfect example of compromise for speed. The entire packet except for the data portion is more or less fixed. You know how many bytes you need to read to find things. In JSON AND XML, you can't.

      How much more performance are you expecting using this over something like XML? If the packets are throw-away after you get the data, and you are stretching the limits, ala google, how MUCH are you saving and is it really worht it to diverge from something that is clearer, more of a standard, and easier to read/write.

      --

      -
      ping -f 255.255.255.255 # if only

    3. Re:Malarky by fforw · · Score: 1

      The problem we are solving is that XML handling in javascript is cumbersome. JSON offers a very simple solution to provide client java scripts with a normal javascript object without the need to use any DOM parser. This is the second easiest solution right after sending html text blocks to replace the html embedded in the original page. And the responses generated by this approach are much shorter than html text blocks.

      --
      while (!asleep()) sheep++
    4. Re:Malarky by Anonymous Coward · · Score: 0

      You have obviously never tried to parse a large XML file using javascript. Anything over 20K takes FOREVER (even on my 1.5Mhz, 1Gb RAM machine).

      The fact that it doesnt need to be parsed is the greatest benefit of this technology,

    5. Re:Malarky by Anonymous Coward · · Score: 0

      You and I might have those machines, but some of our clients don't. I don't know about you but when it comes to forcing a hardware upgrade because *we* can't find more efficient ways to do things, it gets *us* fired.

    6. Re:Malarky by Anonymous Coward · · Score: 0

      XML is an extremely unclean design - you can't easily build a lexer/parser combination without having ugly interdependencies between the lexical format and the semantics. Eww...

      The only reason anyone like you consider XML more readable is that you're actually used to its idiosyncracies, as opposed to the idiosyncracies of another format.

      XML is crap. Please get rid of it, now.

    7. Re:Malarky by sporty · · Score: 1

      That's odd. I have a 500mhz machine that works with it just fine. Also claiming that it's that much faster is malarky.

      Next.

      --

      -
      ping -f 255.255.255.255 # if only

    8. Re:Malarky by sporty · · Score: 1

      Of course it has to be parsed. It's not automatically put into memory addresses via magic.

      Next.

      --

      -
      ping -f 255.255.255.255 # if only

    9. Re:Malarky by sporty · · Score: 1

      Then what you need is something like XPath for selecting nodes in JS, not an entirely different language. If DOM really was the problem, then it wouldn't be just JS, since DOM is DOM in every language. It's a common interface.

      --

      -
      ping -f 255.255.255.255 # if only

    10. Re:Malarky by sporty · · Score: 1

      A parser for plain xml is fairly easy as is the language. Why do you think HTML is so easy to pick up? XML is as easy, with minor tweaks to the rules.

      As for the parser, since the rules are completely recursive, basic xml using a dtd is fairly easy. Schema requires a more intelligent parser. Using XLink and XPointer are more addons. Parsers for other languages, like perl, python and a few others are far more difficult.

      -s

      --

      -
      ping -f 255.255.255.255 # if only

  30. Or instead... by koehn · · Score: 2, Informative
    Why not just replace some of your HTML instead?

    All JSON does is make it easier to have your JavaScript call in to your application and parse the results. If you're just interested in presentation, just have your JS call up, get some HTML, and replace the affected HTML. This decreases the amount of JS and increases your re-use (since you don't need to build your UI twice: once is (PHP|Java|.Net|Ruby|.*), and once in JS). You just call your (\1) code on the server from the JS and have it generate the HTML.

    I understand that sometimes there are advantages to the programmatic approach that JSON (and XML-RPC, which the browsers support) extoll, but I don't think many developers even realize the UI-based alternative.

  31. Developers perogative to whine by willCode4Beer.com · · Score: 1

    Sorry if my comment sounded like whining. I was commenting on the appropriate USE of a new idea. If web dev wasn't pure hell, I would probably do something else. Its the challenge that makes coming to work worth while.

    Actually, since reading the article a while back about the guy who reversed engineered google's thing, I've been thinking about building a library to make this two-way communication between server APIs and a dynamic page.
    This package looks like it will be very interesting and might fill the role. And considering I'm a J2EE dev, I suspect it might even play well (based on statements on the site) with my apps.

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
    1. Re:Developers perogative to whine by EvilJohn · · Score: 1

      That's an interesting idea. I'm looking forward to building something that I can tie back to an EJB3 backend (POJOs) and just massage through session beans. This might take some of the more tedious aspects of EJB->Web Development a lot less painful.

      Anyway, this is going to make it's way into my playtime toolbox.

      --

      Less Talk, More Beer.
  32. Re:Enterprise Java application, ha! by Anonymous Coward · · Score: 0

    Why?
    Keeping Scotty from falling asleep at the teleporters.
    Perfectly valid Enterprise Java application.

  33. oh so 80's??? by Anonymous Coward · · Score: 0

    Umm.. "..that oh so 80's page reloading"... ???

    Hello? HTML browsers started around 94..

  34. XML-RPC did this *years* ago by Petronius · · Score: 1
    XML-RPC did this years ago:

    What is XML-RPC?

    It's a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet.

    It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted, processed and returned.

    It works quite well too. Next, please!

    --
    there's no place like ~
    1. Re:XML-RPC did this *years* ago by togofspookware · · Score: 2, Informative

      You missed the part that "XML-RPC sucks".

      --
      Duct tape, XML, democracy: Not doing the job? Use more.
    2. Re:XML-RPC did this *years* ago by Petronius · · Score: 1

      Yeah, how does it suck?

      --
      there's no place like ~
    3. Re:XML-RPC did this *years* ago by togofspookware · · Score: 1

      Because it is rediculosly verbose and hard to parse. You may counter-argue that it is good because it is standard and there are widely available libraries to handle it, but with simple protcols like JSON or plain ole' url-encoding, you hardly even need a library (esp. in JavaScript :). It will also save you bandwidth and CPU cycles.

      --
      Duct tape, XML, democracy: Not doing the job? Use more.
    4. Re:XML-RPC did this *years* ago by Petronius · · Score: 1

      with simple protcols like JSON (..) you hardly even need a library
      uhmmmm....
      --
      there's no place like ~
    5. Re:XML-RPC did this *years* ago by togofspookware · · Score: 1

      Thank you for helping me make my point. :) The ruby parser is a single line.

      --
      Duct tape, XML, democracy: Not doing the job? Use more.
    6. Re:XML-RPC did this *years* ago by Petronius · · Score: 1
      Thank you for helping me make my point. :) The ruby parser is a single line.

      (BTW, how do you embed a Ruby call in an HTML page?). The JavaScript version is longer is just as cryptic. This seems like the new kludge, not the new standard.

      --
      there's no place like ~
  35. 3270s by Alrescha · · Score: 2, Informative

    "think IBM 3270 only slower"

    Hey, 3270s were coax-connected to a channel-attached controller with a 4.5MB/sec path to the CPU. You could do video on them (if you didn't mind the fact that your pixels were the size of a tic-tac.

    A.
    (who lusts for the feel of a 3270 keyboard under his fingers)

    --
    ...bringing you cynical quips since 1998
    1. Re:3270s by Cato · · Score: 1

      3270s were (and are) frequently connected over WANs, so it's unlikely they normally had 4.5 Mbps to the mainframe, even shared with the cluster controller, except in few cases where the terminals were just about in the data centre.

    2. Re:3270s by LorenzoV · · Score: 1

      Lessee if my foggy memory can reconstruct the details here. It ain't quite as simple as 4.5MB/sec.

      The IBM 3278 and related terminals were just the end point of the display system. These terminals were connected via coax to a control unit: the IBM 3272 local control unit or the IBM 3271 remote control unit. There were some plug compatible makers of both control units and terminals, IIRC.

      In the case of the 3272 control unit, it was channel attached to a block multiplexer channel. This was the high bandwidth attachment suggested by Alrecha. The distance from the mainframe of the 3278 display terminal was, at best a few hundreds of feet. In effect, in the same building as the mainframe.

      In the case of the 3271 control unit, it was connected to the mainframe via WAN. From the mainframe end, a channel attached byte multiplexor channel sent data to a communication control unit such as a 2701, 2702 or 2703 which would send the 3270 data streams, via modem, to the 3271 control unit. Later connunications control units, the 3705 and its successors, did the same job as the 270x CUs and could handle many more lines. The data path was: mainframe to bytemux channel to communication CU to modem to WAN to modem to 3271 CU to 3278 terminal. Via modem, distances were limited by one's relationship with the phone company provided leased lines to branch offices. Bandwidth was similarly limited to what was possible line conditioning and/or with modems.

      Most of my experience, as a user, with 3270 stuff was with the channel attached terminals (fast). I had some very limited experience with remote 3270 in about 1980 (slow). My last experience with 3270 related technology, about 1995, was as a user of a Sun workstation running Solaris 4-something with TN3270, a software emulator for 3270 data streams, attached to a mainframe running VM/CMS.

      Times change. My recall could be faulty. YMMV.

    3. Re:3270s by Anonymous Coward · · Score: 0


      O 3270s sucked!
      <---->
      |
      / \

  36. Where does this fit in with W3C standards? by hexene · · Score: 1

    Hopefully this will provide some added incentive for browser makers to support DOM Level 3 Load and Save...

  37. Character Encoding? by Anonymous Coward · · Score: 0

    Interesting that it doesn't specify a way to declare character encoding like XML does.

    That's probably a good thing if you're using it with HTTP, where the "Content-Type: blah; charset=UTF-8" can be used, saving duplication / mismatch with XML. Could be a problem though if you store a JSON message in a file.

    And what is the MIME type anyway?

  38. Native PHP-JSON data-converter classes by passionplay · · Score: 1

    If anyone wants, I have a native PHP based JSON converter package I've implemented that takes JSON formatted text and creates PHP structures from it, and in other direction, takes PHP structures and creates JSON formatted text. I'm going to try to post it to SourceForge today. If anyone wants it sooner, feel free to reply to this thread. I created this about a year ago, but haven't had the impetus to post it yet, because it seemed esoteric at best and I wasn't sure anyone would need it. Now that JSON is becoming more prevalent, the need seems to be present. Thanks.

    1. Re:Native PHP-JSON data-converter classes by metaparadigm · · Score: 1

      When you've put it on the web, send a mail to the author of this page: http://www.crockford.com/JSON/ I'm sure he'll be interested.

    2. Re:Native PHP-JSON data-converter classes by austinm3 · · Score: 1

      Since you're guaging interest, I'd also be very interested in your solution.

    3. Re:Native PHP-JSON data-converter classes by rffrff · · Score: 1

      classes? there is a ruby *oneliner* to parse json (linked on the home page) ;) I bet is reproducible with php.

  39. JSON in japano by fforw · · Score: 1
    Although I haven't called it JSON this is kind of exactly what I called "javascript views" in my web application toolkit. One small part of my project uses serverside java to generate dynamic javascript objects which are a javascript representation of nested java object graphs. The syntax of the generated js object source is a bit different because I did not know that the language constructs used by JSON exist (I think I'll switch to JSON very soon).

    Online Demo showing the javascript view feature.

    Project Documentation.

    ( Funny thing is my story about this was just rejected this morning.)

    --
    while (!asleep()) sheep++
  40. JS usage? by thisisauniqueid · · Score: 1

    Isn't it dangerous to evaluate JSON on the js side by calling Javascript's eval() ? The server could be returning anything, not just JSON-valid JS syntax.

    Mind you, if there's a non-JSON JS exploit that could be taken advantage, I guess you could put it straight into JS code in the HTML, and the user would be just as vulnerable as if the exploit were run using eval().

    1. Re:JS usage? by Anonymous Coward · · Score: 0

      Er, yes, exactly. By the way, why did you bother to submit? Thinking outloud on slashdot is probably a sign of something...

  41. Is this the real thing? by ZakMcCracken · · Score: 1

    This is very, very, very cool for designers of complex web applications. But is this the real thing that Google uses?

  42. Re:ICBW but: Re:Perfect for the web? I don't think by Anonymous Coward · · Score: 2, Insightful

    Because XML requires a parser, and this JSON thing looks like it could be evaled into a jscript array,

    Which magical browser do you use that doesn't need to parse the code that it eval()s?

    which is a *much* quicker operation

    I think that you have forgotten that eval() needs to parse too, I'm not convinced that it is much quicker. Even if it was, it doesn't follow the Principle of Least Power. XML doesn't execute. Javascript does. There's a reason why JSSS was rejected by the W3C and CSS wasn't. Using a fully-fledged scripting language to represent data is insane, especially when you are working with untrusted data off the web.

    and requries no external libraries to operate.

    An XML parser is built into every web browser that JSON targets.

  43. One more major advantage... by Anonymous Coward · · Score: 0

    Eliminate piracy on the spot.

    How many people do you think are using a pirated copy of Basecamp?

  44. just tested (played) by willCode4Beer.com · · Score: 1

    Ok, I've just downloaded their demo code and played with it a bit. I've also read most of the source code. So basically, we can register java objects, and call their methods from the client in JS. The (un)marshalling basically translates our objects between Java/text/JavaScript. It even appears to work well. :)
    I now think this is officially pretty cool.
    One mod though, since I tend to think scripting in JSP's is evil, I create and register the objects in my Struts Action class. I then store it in the session object. The jsp just does what it needs to. Now, I should think about putting the object name in the properties file since it gets used by both the Action class and the javascript.
    I'm also using Struts URL rewriting to pick the URL of the servlet so I can ensure the URL is context relative and that it gets the user's session id.
    Now, I wonder if I can write a class to tie this into the validation framework in Struts. Imagine getting live form field validation.
    bua-ha-ha-ha
    Slow work days become play days.

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
  45. Oh no... by KontinMonet · · Score: 1

    And, no doubt, JSON etc. will work exactly the same across browsers/platforms and any combination of client/server platform. There will be no surprises. Yeah right.

    And all those crappy Javascript 'programs' are going to be magically transformed into high-quality type-safe rock-solid modules by the same people who wrote the crap JS in the first place?

    I won't hold my breath on this one...

    --
    Did he inhale?
    1. Re:Oh no... by Kingpin · · Score: 1

      Better solve the cross-browser JS issues in one package than have web-dev's do it over and over again, poorly.

      --
      Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
      Geocrawler error message.
  46. Re:FREE MAC MINIS by Anonymous Coward · · Score: 0

    Link doesn't seem to work at all in my AOL Fire Fox (?). I wanted to buy a mac since I keep filling up my screensaver with spyware, but this search engine my nephew installed for me doesn't work. Please help.

  47. With JSON-RPC nothing new to learn by willCode4Beer.com · · Score: 1

    I forgot to mention in my previous POST.
    Using the JSON-RPC package, you don't actually have to touch and JSON. Just plain old Java/JavaScript. The package does the conversion for you.
    In the (un)marshalling stage the text representation of the objects, is actually the JSON. But, since the package does this step for you (each way), you don't have to mess with it.
    So, now we have a new toy but, don't *really* have to learn anything new. Now, if someone wanted to do a PHP,ASP, or insert favorite scripting lang here type RPC package they would have to learn JSON but, once the bridge was built, they wouldn't need to bother with it any more.

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
  48. Re:Slashdot crowd shows their technical ignorance by drooling-dog · · Score: 0

    Funny - My "web experience" is almost always a lot nicer when I disable Flash (which is most of the time these days)...

  49. yeah! porn is now less filling! by Anonymous Coward · · Score: 0

    Alright! I can view more porn, faster!

  50. Back to the future: Web = CICS? by Bozdune · · Score: 2, Informative

    Yes, mainframes are really, really good at I/O, which is a concept that many people didn't get (DEC for one, when they fell flat on their faces trying to leverage the VAX into mainframe land) and still don't get. The CDC 7600 was surrounded by 6600's to spoon feed it, just as IBM mainframes have channel controllers (real processors) separate from the CPU to do the same thing.

    However, your memory of 3270's is a lot different than mine. How about when that nifty wifty 3270 cluster controller went south, as it did at our shop multiple times per day? And maybe you could pump bits at it pretty fast, but under TSO your Q1 response time was 10 to 20 seconds during peak times, so it didn't really matter how high-speed the intrinsic channel was.

    3270's were designed for forms entry with CICS apps, basically. It's a record-oriented device (like all IBM devices) which just doesn't add up to a very good user experience. You need character interrupts, and you need fast service for those interrupts. The mainframe secret is to let the CPU compute uninterrupted by batching up terminal I/O, screw the user.

    Which is exactly the Web experience today. Fill in a form, press a button, wait. Back to the future! In the limit, it doesn't matter whether you're connecting back to get a whole new page, or whether you're doing some socket hackery under the covers to return a response to some jscript code. Either way, you're waiting for a server that's servicing a bazillion other people, so conceptually you might as well be running CICS thirty years ago.

    Yeah, yeah, the screens are prettier now, you can download jscript and java applets, yadda yadda. You could program the 3270, too, with sufficient pain. Wake me up when this jscript shit actually works reasonably well. Just coming up for air after writing a few pages of it, and boy am I pissed. Standards all over the place. IE style.backgroundColor is "#ffffff", FF's is "rgb(255, 255, 255)". There are religious wars over "document.all", with some w3c fanatics claiming the world should have to write hideous tree-walkers to iterate over the DOM (so prove me wrong, post a code frag to show how easy it is). It never ends.

    (that 3270 keyboard was GREAT. Nothing like it today. Typing on spongebob squarekeys at the moment).

    1. Re:Back to the future: Web = CICS? by tricorn · · Score: 1

      Yeah, I've been saying for years that the Web was basically a step backwards into batch processing, except that back then at least there was the concept of a real session. HTTP was designed as a stateless protocol for a reason, to avoid the overhead of keeping track of state. Tacking on kludges to keep track of state is ridiculous.

      What I don't understand about this JSON is why everyone thinks that parsing Javascript is oh-so-much-faster than parsing XML. Not that I think XML is great either, mind you.

      Tcl also uses script-passing for RPC, and has a plug-in for doing Tcl-script in browsers. I bet this would have been a bit cleaner using Tcl as the interchange instead of Javascript. Tcl has a well developed security model for keeping scripts like this safe. If the only reason for using something is "well, it's already built in to the browser", you're locking yourself in to an evolutionary dead-end. Well, the web browser did that to us Internet-ages (i.e. 5-10 years) ago already, but it isn't necessarily too late. Tacking on more stuff like this just digs us in deeper, though.

      Network apps using Java make a whole lot more sense to me, at this point. Implement the Web browser part in Java if you must, but do scripting in "native" Java (which can be easily sandboxed). For "Web apps", use a (caching) network class loader and be done with it. If you don't need the Web browser part, it doesn't have to be there.

  51. ASN.1? by akypoon · · Score: 1

    Anyone has experience with ASN.1 http://asn1.elibel.tm.fr/en/? JSON seems to be aiming in the same direction but I don't quite understand what is it they want to do differently.

    Can anyone explain this please?

  52. Yay! by clohman · · Score: 1

    The new frames!

  53. Apples vs. Oranges by hey! · · Score: 1

    XML is a way of repreenting data.

    JSON is an RPC API for javascript, that is implemented by a simple on-wire data represenation.

    The W3C XML encryption standards notwithstanding, security is clearly a concern outside the scope of simple data respresentation. However, this is NOT the case for a RPC system.

    After spending a few minutes futzing around with this, clearly this is pretty interesting stuff. However what is missing is a sense of what best practices for security are in a JSON application. Is security supposed to be handled by the remote objects? By the application container? By the transport layer?

    A quick look at the JSONRPCServlet code makes it look like no thought has been given to security at all. It merely checks for a session and creates one if it doesn't exist. So, if you are simply mapping /JSON-RPC to com.metaparadigm.jsonrpc.JSONRPCServlet, you get no security whatsoever. Once an attacker figures out the URL patterns of your system (which would be very easy, especially if he can sniff packets on your network), your objects are basically wide open.

    Experience has shown that not thinking about security in a network.

    My guess it that best practices for security in a JSON applicaiton would include a combination of TLS for on-wire security and AOP to your remote callable objects. You could put an adapter around com.metaparadigm.jsonrpc.JSONRPCServlet to perform some kind of security check on requests, maybe checking authentication credentials against a set of configuration files. This would in effect be a kind of aspect oriented programming wrapped around your remoteable objects, without any special AOP magic.

    My sense is that this would have the potential to be reasonably secure, while remainign orthagonal to the overall model and so maintain the original simplicity. These JSON folks should consider making this mandatory -- to have a role/method security registry that would cause an error to be thrown if somebody exceeded their rights. The servlet could then be configured in one of two differnt modes: allow-if-not-forbiiden, or forbid-if-not-allowed. The allow-if-not-forbidden mode of the servlet would work just as it does now in the absence of any security configuration information.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  54. uh by nomadic · · Score: 1

    Seen those funky remote scripting techniques employed by Orkut, Gmail and Google Suggests that avoid that oh so 80's page reloading (think IBM 3270 only slower).

    Mr. Grammar has left the building.

    1. Re:uh by captain_craptacular · · Score: 1

      Seen those write can't people who 80's reference sense google makes none (think Ford F-250 but uses more gas)?

      In other words, I couldn't agree more. I can't for the life of me discern what the hell what he/she is trying to say.

      --
      They who would give up an essential liberty for temporary security, deserve neither liberty nor security
  55. Wonder what animal will be on the O'Reilly book? by neckdeepinspecialsau · · Score: 1

    I vote for the majestic wilderbeast.

  56. Re:Slashdot crowd shows their technical ignorance by Anonymous Coward · · Score: 0
    > Funny - My "web experience" is almost always a lot nicer when I disable Flash (which is most of the time these days)...

    And Javascript, for that matter.

    I use the PrefBar extension in Mozilla. I click a radio button to turn JavaScript on for the two minutes I spend logging in to my bank. Rest of the time, that shit stays off.

  57. 3270 keyboard by Tumbleweed · · Score: 1

    (who lusts for the feel of a 3270 keyboard under his fingers)

    Dammit, you had to bring up the best keyboard ever made. Now I've got an erection. I'm such a nerd. :)

  58. S-expressions by imbaczek · · Score: 3, Funny

    It looks like the technology is finally converging towards Lisp. Maybe 40 years isn't THAT much, after all...

    (If you think about it, it started quite a time ago, since xml is isomorphic to sexps.)

    1. Re:S-expressions by SunFan · · Score: 1

      Everything comes back to Lisp. Imagine how much time we would have saved if we just used Lisp instead of re-inventing the wheel a dozen times over. All this over those poor poor parenthesis. Did anyone ask how they felt about all this conflict?

      --
      -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
    2. Re:S-expressions by Anonymous Coward · · Score: 0

      Somebody should make a Lisp text editor that lets people use a simple alternate syntax of their choosing, then we can all buckle down and get some real work done.

    3. Re:S-expressions by SunFan · · Score: 1
      --
      -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
    4. Re:S-expressions by Crockford · · Score: 1

      Right you are. See for example http://www.crockford.com/javascript/little.html. JavaScript has a lot in common with Scheme.

  59. Re:Wonder what animal will be on the O'Reilly book by Anonymous Coward · · Score: 0

    That's "wildebeest" idiot.

  60. LiveConnect? by milton_wadams · · Score: 1
    I see that no one has mentioned LiveConnect, so I figured I'd chime in.
    Forget that horid wait while 100K of HTML downloads when the application just wanted to update one field on the page.
    Netscape developed LiveConnect over 7 years ago to do exactly that. Well, not exactly, but it enabled communication between Java applets and Javascript, which allows for dynamic updates without page refreshes. Yes, this new standard may be met with much broader browser support, but it's not like the technology is revolutionary.

    Check out this guy's page for an example: http://members.ozemail.com.au/~dcrombie/java/Pendu lum.htm
  61. I, for one... by Anonymous Coward · · Score: 0

    ...welcome our new acronym overlords.

  62. Different than ASP.NET script callbacks? by dioscaido · · Score: 2, Interesting

    Is this different from script callbacks in ASP.NET? It allows you to hit the server on an already loaded page and selectively update its contents. While the full abstracted implementation will be available in ASP.NET 2.0, you can easily implement it in the current ASP.NET 1.x.

    http://msdn.microsoft.com/msdnmag/issues/04/08/Cut tingEdge/

  63. Python binding by imnoteddy · · Score: 1
    I noticed that there was no Python binding listed. Then I looked at the examples and they looked a lot like Python dictionaries and lists so I fired up the python interpreter and fed it the following from one of the example pages:
    { "glossary": {
    "title": "example glossary",
    "GlossDiv": {
    "title": "S",
    "GlossList": [{
    "ID": "SGML",
    "SortAs": "SGML",
    "GlossTerm": "Standard Generalized Markup Language",
    "Acronym": "SGML",
    "Abbrev": "ISO 8879:1986",
    "GlossDef":
    "A meta-markup language, used to create markup languages such as DocBook.",
    "GlossSeeAlso": ["GML", "XML", "markup"]}]}}}
    and Python accepted it without complaint.

    I can see a couple issues - Python uses None instead of null and Python doesn't always play nicely with Unicode - but a Python *binding* will be *very* lightweight.

    --
    No electrons were harmed creating this post, though some may have been subjected to electrical and/or magnetic fields.
    1. Re:Python binding by Pete · · Score: 1

      I'm working on a project at the moment that's all Javascript on the client side and mod_python (with the very nice Publisher handler on the server. I have a simple Javascript wrapper around XMLHttpRequest for making asynchronous calls to the server (using CPS with Javascript closures as the "continuations") and I just pass all the info back in JSON format, so I can just eval() the returned text.

      Surprisingly neat and (very) surprisingly flexible - you can also do stuff like pass back Javascript functions (from the server) along with the data you wish to process.

      You can use the Python str() function for the most simple data conversions (eg. an array or a dictionary), but I prefer the pyjsonrpc package which has very nice little objToJson and jsonToObj functions. Better than just using Python's str() function, as it also strips out excess whitespace. I also modified it slightly to also properly convert Python booleans to Javascript booleans (it already handled null to None conversions).

      It all works very nicely, a testament to the power of simplicity. The Javascript (client) side just makes requests in response to user actions (eg. button clicks) or other events, and the server responds to those requests with Javascript data (CPS is very well suited to this kind of programming).

      Javascript really is a very cool programming language. I've implemented my own python.js library which adds a handful of Python-like functional programming facilities to Javascript (eg. map, filter, reduce) and dictionary/object methods like keys() and values(). It's got to the point now where I sometimes get confused as to whether I'm writing Javascript or Python, because they're so similar in all the ways that really matter.

      This kind of web development is quite fun. I also have a nice advantage with the web application I'm working on, as it flat-out can't run on IE (it uses fixed-positioned divs quite extensively, along with a few other standard features that IE can't handle) and so I don't have to worry about compatibility with that fucking mess of a browser. Hooray. :-)

    2. Re:Python binding by Evan · · Score: 1

      I wish that I had read about JSON before coding up my own yet-another-lightweight data format for WEBoggle. It uses scgi with a persistent Python server rather than mod_python, and is a single-page application. My experience of JavaScript is quite similar to yours, although I'm a lot more affected by compatibility concerns.

    3. Re:Python binding by Pete · · Score: 1

      Ha. That's funny. WEBoggle was probably the major inspiration for the stuff I'm working on, when I first discovered it a few months ago. It's really a brilliant implementation of Boggle - so simple and enjoyable. Great fun.

      Even though my partner is now dreadfully addicted to it :), I must thank you for making it. It's really cool.

      When I have a bit more time I'm thinking of having a bash at implementing a Fungus clone using this sort of technology - there's probably a huge variety of simple-but-addictive games that'd be well suited to this kind of framework.

    4. Re:Python binding by Crockford · · Score: 1

      Python was considered in the design of JSON. JavaScript does not require that names be quoted, but Python does. That is why JSON uses quoted names.

  64. JSON Rocks - Here are some ideas by JPyObjC+Dude · · Score: 1

    I was converted to using JSON about 2 years ago to enable my rather complex DHTML applications to go to the next level. The transition was so sucessfull that I now use JSON in many levels such as:

    1) Server to client hashmaps:
    JSON is great for passing hashmaps of data and for storing specifications meta data for applications.
    eg:
    ServerReport={serverFailed: true, errorMessage: "you used XML dummy"}

    2) Application meta data:
    Storing application configuration using JSON is not only efficient but very easy to maintain and read.

    3) Singleton Object Declaration for utility objects:
    By using JSON to define objects in JavaScript, a singleton object can be used very well to be used as utility objects. By nesting the methods and properties within a JSON spec, you can save on namespace. And as any script programmer (especially JavaScript), namespace is everything.

    eg: (real exerpt)
    _SC=SearchComponent={
    log: [], // Private - Condition Index Log
    ind: -1, // Private - Condition index
    elem: null, // Read only - use setElem
    atts: [], // Read only, setAtts()
    buildBody: function SC_buildBody(){
    return _GUI.buildCurveTable(
    (
    "table ...

    4) Function/method arguments:
    When dealing with many arguments of functions, often the calling code and the method/func get out of hand. By using JSON to pass arguments, you can still read your code from both ends.
    ie: (another real exerpt I wrote yesterday)
    function ExtNav_downloadFile(j){
    if(
    !isJSON(j) ||
    !isJSRec(j.fileRec) ||
    !isBool(j.lock))
    { debugErr("j must a JSON and contain: fileRec: ~JSRecord~, lock: ~Bool~") }
    if(!confirm(ExtNav.buildCMText({ action: (j.lock?"checkout":"download"), fileRec: j.fileRec, userRec: User, popup: false}))){return}
    ExtNav.postIt(
    (j.lock?"checkout":"download"),
    [
    "oid",j.fileRec.ID,
    "type",j.fileRec.Type,
    "filename",j.fileRec.FileName
    ]
    )
    }

    One important note though, It is still better to pass tables of data without the fields being specified. It should be the programmers job to understand that the server sent a table with n fields that are in a particular order. By only passing the data (in a JavaScript array not JSON), the data size is greatly reduced. ie:
    aTableDat=[
    ["r1f1","r1f2","r1f3"],
    ["r2f1","r2f2","r2f3"]
    ]

    Another interesting thing is that Python has JSON natively interpreted like JavaScript. Meaning that a Python based servlet could very efficiently communicate information with the client application.

    JsD
    [Use FireFox and JSON or Die:]

    1. Re:JSON Rocks - Here are some ideas by Anonymous Coward · · Score: 0

      Just a simple point. Sending tables with field names wouldn't increase bandwidth used much IMHO if you use gzipped HTTP streams. And if you do serious server side development, you probably do that already. Writing that gzipping servlet filter is a piece of cake.

      P.S. I once thought about using jython to write servlets, because of the same problem- managing property-value lists is much easier in python than managing Maps in java. Have you ever tried that?

      --Coder

    2. Re:JSON Rocks - Here are some ideas by JPyObjC+Dude · · Score: 1

      Sure you can use gzip for server-client but you cannot gzip upwards. I have used gzip filters and they work ok. The only unfortunate thing about gzip is with IE - They do not support gzipping of resource files like JS, CSS etc. And unfortunately there was no way I could gate the servlet filter based on the browser's mime type. Although, I could probably hack the servlet filter code but I was not interested in hacking that at the time.

      I have given serious consideration to jython for the exact same reasons and I believe I will go there one day but right now my app needs to be enterprise quality and adding jython does not make sense (yet).

      For now I have a method for converting an serialized Name Value String to a hashmap to pass a HM colletion from JS to Java. Not super efficient but it does work solidly.

  65. Re:first by Anonymous Coward · · Score: 1, Insightful

    How is this news? People have bene doing this forever with javascript and posting to a hidden iframe which can call any of the needed functions on it's parent page.

    Want to add a new DIV? Easy. Want to remove/hide some DIV? Easy. Want to change the values of some tags? Easy. Want to do almost anything to any element on the page? Easy. Want to save to your DB? Easy.

    And all without refereshing the page once. Easy to implement, easy to use. Nothing new to learn. Any server side tech can be used. Can work with more web browsers than this can, etc. etc.

  66. Against the Model View Controller by Anonymous Coward · · Score: 1, Insightful

    This seem like it will be against the Model View Controller (MVC) architecture.

  67. The browser model is ok,the implementation sucks by master_p · · Score: 1

    The distributed app model (i.e. passive connection, declarative programming, flow-oriented MMI) is very very good. That's a good concept. But the implementation really sucks. Developing distributed applications via this model is very immature, at the very best. It is difficult since there are tens of domain-specific programming languages to learn, the binding between them leaves a lot to be desired, and debugging is almost non-existent. It's very clear to those who have developed (or tried to develop) distributed apps that go beyond the 'write some data to the db' problem that a better implementation of the distributed app model is needed.

  68. Re:first by stupidfoo · · Score: 1

    That's what I've been wondering about too. Does this newer tech have some inherent advantage over the hidden iframe method? Is it just more structured?

  69. Tapestry widgets by JLavezzo · · Score: 1

    Ideally, this is the place where your server-side library like Tapestry that already generates html widgets that link back up to server calls come in handy. You DON'T have to write out this stuff by hand, it's generated by the server according to your parameters.

    Then all the worries about ANOTHER programming language and ANOTHER place to introduce un-maintainable code just go out the window. Someone who knows what s/he is doing writes a widget that is well documented and tested. You employ it according to it's API and POOF! your web-based UI just got XMLHttpRequest-ified(TM).

    1. Re:Tapestry widgets by Jerf · · Score: 1

      Adding Tapestry looks like adding another language to me for a lot of us.

      I'm working on a pure Javascript solution to that problem, XBLinJS (sourceforge project) which implements the capabilities of XBL in JS. It will is easy to create widgets that are XMLHttpRequest aware. I don't ship any, partially because the project is young and partially because needs tend to be too specific to be easily demo-able, but it's not too hard; I'll be doing that today or tommorow in the project XBLinJS is supporting for me.

      Now that's not adding another language.

  70. Javascript security??? by bradbury · · Score: 0, Troll
    Great! Another proposal for using a scripting language that one does not have the source code for (at least in IE, Opera and probably other browsers), and is *NOT* a standardized language (what approved "forum" such as ANSI or ISO has standardized Javascript?) AND is known in its various forms to crash browsers (e.g. Netscape 4.79 that people will still choose to use because it is still faster in many situations than Firefox) AND isn't even available in the more simple browsers (does anyone even remember Mosaic?)

    The use of Javascript and Java -- i.e. languages that run code on *your* computer, vs. HTML which is a display language should be discouraged until there is some responsible independent body that has verified them as "secure".

    There is a question of "trust" levels here. And in my experience I don't "trust" anything whose source code I have not reviewed or has not been reviewed by people whom I can trust. And that is simply not the case with most or all of the scripting languages currently available.

    Thus their use should be discouraged.

    1. Re:Javascript security??? by iantri · · Score: 1
      and is *NOT* a standardized language (what approved "forum" such as ANSI or ISO has standardized Javascript?)
      ECMA-262 EcmaScript
    2. Re:Javascript security??? by Anonymous Coward · · Score: 0

      ECMA standardised javascript a good few years ago, there are 10 or more interopable implementations and are highly conformant to the specfication.

      The crashing, you appear to be confusing the DOM and javascript, not surprising it always happens with muppets who flame something without actually bothering to check basics.

      At least you're right not to trust scripts run on your computer, but you're free to have the scripts reviewed by people you trust. If you really want to look at the Script engines themselves, then Mozilla, Safari, IE etc. all have public access to the source code. Opera doesn't so best not to use Opera, but then what security minded person would be?

  71. Yup by Greyfox · · Score: 1
    And by the time they're glomming shit onto the various web browsers in order to provide web apps with all the tools that HTML was never intended to provide, it'll be 10 times less complex just to write a custom app that does some client server stuff using a protocol designed specifically for the problem at hand. And if you don't use XML it'll have a 10 times less bloated data steam, too.

    Oh wait. That's now. But hey! At least they don't have to actually deploy web apps. That's progress!

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  72. Advantages to hidden iframe by fforw · · Score: 2, Informative
    That's what I've been wondering about too. Does this newer tech have some inherent advantage over the hidden iframe method? Is it just more structured?
    The XMLHttpRequest has the advantage to be a little less of a hack and to support HTTP-POST.

    You could use the JSON as message format with hidden iframes, too.

    --
    while (!asleep()) sheep++
  73. JPSPAN by lux55 · · Score: 1

    I didn't see much on their site about the API, just the serialization, but I'm wondering how this compares with JPSPAN (http://jpspan.sourceforge.net/wiki/doku.php) which actually mimicks the server-side objects in JavaScript, which is a really cool idea that take a lot of the pain out of client-side RPC programming.

  74. Finally by Doc+Ruby · · Score: 1

    This is good even for "static" pages (not reloaded/redrawn in response to interaction with a user). HTML is a badly designed presentation protocol, even (especially) after all the "dynamic" revisions. Just as you can embed an image with tags, or movies, or sounds, or other multimedia objects, you should be able to embed text or HTML with a simple tag with a "SRC" parameter. <OBJECT> and <IFRAME> tags bring a lot of overhead, and extra GUI features that prevent the embedded text from appearing in the page exactly the same as the text directly in the page's HTML. So these client/server objects can at least provide the functionality that browsers should have had since Mosaic. Too bad it can't just use the browser's own HTTP and rendering engine with a simple <CONTENT TYPE="text/plain" SRC="http://slashdot.org/~Doc%20Ruby"> tag pointing to an existing simple web page, but rather forces the downloading and running of Java and a menagerie of interfaces.

    --

    --
    make install -not war

  75. Re:first by Anonymous Coward · · Score: 0

    I'd like to ask how is it possible to get rid of that 'click' sound explorer makes when it reloads the frame. I couldn't ever solve this problem without a downloadable .reg file.

    --Coder

  76. Been there, done that. by tgrigsby · · Score: 1

    A long time ago I realized the need for speedy updates to a web page without having to reload a page. Instead I created a very small Java class that could be loaded with the page and called via Javascript. All it does is call a web service and return the result. The javascript routine that made use of that class accepted two parameters: the URL to call and the DIV name to put the result in. It acted as a great hook for dynamically modifying any page without reloading the entire page. I was able to create some very sophisticated looking data pages that updated quickly.

    The end result was fast, flexible, and did everything this stuff will do. So why would I switch?

    To make use of a standard. There has been no good standard way to do what this does. I'm all for it, and I'll be diving in right away.

    --
    *** *** You're just jealous 'cause the voices talk to me... ***
  77. Look to Google for the future by SuperKendall · · Score: 2, Insightful

    Google is currently one of the masters of Javascript.

    Look at what they have done, and what they have not done - GMail has a very good interface. But even Google has released some real applications, like desktop search and Picassa.

    I really believe the browser model can only be taken so far. As someone else noted, your browser becomes your window manager and pretty soon you develop a little cosmos in there. But that cosmos will always be a subset of the richer cosmos the OS itself offers, and so web apps will be convienent but probably never dominant. There is too much to be gained by going to a desktop app.

    What I think will happen instead is that hybrid desktop apps, where part of the UI is essentially JavaScript will emerge and the desktop part is able to do what it does well.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Look to Google for the future by Anonymous Coward · · Score: 0

      Google is currently one of the masters of Javascript.

      Bullshit. Head on over to comp.lang.javascript and ask real Javascript masters what they think of Google's expertise when it comes to Javascript. You'll get a uniform "they're terrible" response. Christ, Google are currently vulnerable to an XSS attack when you feed certain code to the Googlebot. They've had this hole for years, despite it being pointed out to them.

  78. That's not true by lokedhs · · Score: 1
    You obviously understand how the system works, but you failed to understand exactly what it does.

    JSON is not less secure than normal web access. Say you have a servlet mapped as such:

    http://myhost/DeleteFile?name=/etc/passwd
    which allows you to delete the /etc directory. Unless you enable some kind of security mechanisms, anyone can delete anything in the system.

    The same is true for JSON. Sure you can expose a deleteFile() method, but it would be just as stupid as the above mentioned URL. You always have to add some security and you do that the same way regardless of wether a request comes in to a servlet which you write or via JSON.

    The typical way to handle authentication is through the application servers login stuff which binds a principal to a session, or you do it by hand by using a ServletFiliter on top of the pages (and the JSON servlet).

  79. The cat's out of the bag by los+furtive · · Score: 1

    I've been using this stuff for almost a year, even though the people at work were too short sighted to see the advantages. Then GMail came out and lo and behold, google was doing what I was doing. This is the way to make powerful web apps and lighten the burden of maintaining state. This is the future for at least the next five years in web development. Now that the cat is out of the bag, I guess I won't be so elite anymore. But if anyone wants a wizard on this topic, send me an email and I'll come work for you.

    --

    I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  80. JSON looks a lot like NeXTStep property lists by Anonymous Coward · · Score: 0

    NeXTStep circa 1994 used to store defaults settings using property lists:

    {} = dictionary, () = arrray ...
    { a = "First", b = "Second" }, etc.

    Mac OS X switched to using XML format for them !

    Try:
    defaults read com.apple.mail
    and
    more ~/Library/Preferences/com.apple.mail.plist

  81. XML and javascript by fforw · · Score: 1
    This is javascript we're talking of. All scripts have to be transferred to the user. Implementing XPath in javascript is doomed to be a monster.

    (Look at this for example. 100kb script library and the client code using this API will look clumsy and not as descriptive as JSON code. The javascript-RPC client api I wrote is about 4051 bytes, the server part 5853 bytes without any size optimization.)

    Not the DOM is the problem, the implementation of a the javascript DOM doesn't work well for this kind of problem.

    IMHO the only reason to use XML in javascript is that you absolutely WANT to. There's really no need in using to travel a DOM or using XPath when you can use nicely nested javascript objects with descriptive members.

    --
    while (!asleep()) sheep++
    1. Re:XML and javascript by sporty · · Score: 1

      Hold on a sec. Why is such an intense library for javascript written IN javascript. This should be part of the browser. The same happens in perl... the underlying lib is written in c, but the interfaces are perl using XS.

      --

      -
      ping -f 255.255.255.255 # if only

    2. Re:XML and javascript by fforw · · Score: 1
      Hold on a sec. Why is such an intense library for javascript written IN javascript. This should be part of the browser. The same happens in perl... the underlying lib is written in c, but the interfaces are perl using XS.
      Welcome to the world of web development where a certain monopoly holder uses his powers to let the majority of web users use a insecure and feature lacking browser with no intention to enhance it before there's a new technology to lure users into with it.

      Yes.. browsers could implement a lot of really nifty things and you could do marvelous things with that but as long as the browser market does not change significantly there is this technology which works now.

      --
      while (!asleep()) sheep++
  82. You can use it today by lokedhs · · Score: 1
    Nothing prevents you from using it today. The browsers have the required support. All you do is write the containers, add the code to your JSP, add the JSON servlet to you app server and just use it.

    I think I'll use this. I've dreaded to do it manually and this is just what I need.

    1. Re:You can use it today by fforw · · Score: 1

      maybe you are interested in this .

      --
      while (!asleep()) sheep++
    2. Re:You can use it today by lokedhs · · Score: 1

      It certainly looks interesting too. It seems to do pretty much the same thing as JSON. Could you explain in what respect japano is better than JSON? (note that my experience with neither of these exceed 5 minutes).

    3. Re:You can use it today by fforw · · Score: 1

      JSON and JSON-RPC focus on the Javascript-RPC thing and offer some advanced features like different language support or ORB. My implementation uses a very similar but even simpler approach embedded in a general web application toolkit and runtime engine. While JSON-RPC-java uses a seperate servlet to handle JSON requests, my framework uses Javascript libraries as alternative reponse form for the actions supported by the framework.

      --
      while (!asleep()) sheep++
    4. Re:You can use it today by lokedhs · · Score: 1

      I will take a look at it to seeif it suits out needs better. Thanks for the information, it's quite unusual here. :-)

  83. It's the Anti-Dot-Net Way by serutan · · Score: 1

    Having done most of my web dev work for internal corp sites with IE as the standard, I fell in love with the XMLHttpRequest paradigm a long time ago. Basically you throw up a simple page with some controls and some DIVs. That page stays in the browser during the whole session. As the user interacts with the controls, you submit http requests for backend pages and paste the results into the DIVs, either as HTML or using an XSL transform. Or you use dynamic HTML to doctor individual elements with the results. One neat thing about doing it that way is that session state maintenance goes away. The page that stays in the browser maintains its own state information, just like a standalone client app.

    I've been doing this in the IE world for about 5 years, and I thought it was the way Microsoft was going to push web apps in the future. Boy was I surprised when ASP.Net turned it completely around and said now the new cool thing is to make a trip to the server just about every time anything happens. What a waste!

    I never heard any good reasons for going it this direction, and I still think dividing the work between the client and server is a good thing. One classic example is a large datagrid populated by a complex query, that allows the user to update individual rows. Rather than the .Net way of sending in the change, requerying and refreshing the whole grid, it's much faster to send in the update as an http request and use dynamic HTML to alter just that one row with the results.

  84. Yet another RPC protocol by Animats · · Score: 1
    Here we go again, a new RPC protocol based on a new marshalling protocol. We already have SunRPC (with binary marshalling), Java RMI (again with binary marshalling), and SOAP (with XML marshalling). Nobody seems to be using LISP S-expressions for marshalling. JSON has its own marshalling protocol, vaguely reminiscent of that used for VRML 97.

    There are some tempting "simplifications" in JSON, most of which may cause trouble if deployment becomes widespread.

    First, it's an RPC protocol, which means the client can call arbitrary functions on the server. This is always a potential security hole. Every function available on the server is effectively trusted. Expect attacks based on this. It's at least as vulnerable as CGI, but it's new, so new mistakes will be made. The most likely holes will involve not crashes, but the ability to make broader database queries than was intended, via "SQL scripting" type attacks. Resource exhaustion denial of service attacks by clients that make repeated calls is also a possibility.

    Second, there's no versioning. This works fine as long as a new client is downloaded on each use. If it's possible to get the client out of sync with the server, something will break.

    Third, error handling consists of closing the connection on any problem. This equates to one support call per problem.

    This new protocol will become bloated like the others as those problems are fixed.

  85. Images should be cached... by irritating+environme · · Score: 1

    So that leaves the text. Which shouldn't be that large. And if its compressed in the transmission, it should be really small.

    --


    Hey, I'm just your average shit and piss factory.
    1. Re:Images should be cached... by ahdeoz · · Score: 1

      This very page is 200+ KB. Compression might cut it in half. Using the techniques for JSON, you could reload it and see my post and it will be less than 0.1 K more for you to download.

    2. Re:Images should be cached... by dorward · · Score: 1

      Slashdot isn't exactly a great example of clean HTML (i.e. this page wouldn't be so big if it was better written in the first place), and I really wouldn't like to try to pass in new posts using JavaScript. Lets look at what you would need to do:

      (This is pretty rough and ready)

      1. Pass a token back to the server that the server can use to work out all new posts since the page was created.
      2. Pass all the new posts back to the client including information about their parent node.
      3. Pass the new score of all posts which have changed their score back to the client along with the data for those nodes.
      4. Work out where each post needs to go in the threaded view and insert it there... if the threshold is low enough
      5. Show posts which have had their score increased enough to display.
      6. Hide posts which have had their score lowered enough to hide.

      This would be a lot of processing for the client and there would be rather a lot of jerking around of content. Not to mention the fun of trying to get this to work sanely in a bunch of different browsers.

      Oh, and you can't intercept the Refresh request, so you would have to provide a button on the page for it... and users would have to learn the new UI to retrieve new data ... and they would have to learn a different technique for every site that implements it slightly differently.

    3. Re:Images should be cached... by ryepup · · Score: 1

      Ok, I think we are arguing two different things. I'm thinking this is excellent for data-heavy web applications where support for Netscape 2 is not a requirement. Slashdot would be insane to try to convert to RPC, because it's very bidirectional, pushing data to clients is hard, polling from the client is a bad idea, and Slashdot has a wide range of browsers it needs to support.

      I'm thinking more of office management apps, GMail, the sort of thing where you have a user taking some action that doesn't require re-fetching and re-sending all the displayed data. Programs that, even with clean HTML, are displaying excessive amounts of data due to customer requirements.

      Say they want a list of all products their site offers in one big table. They want to be able to change a price, and click "Update". They don't want to wait for minutes while the form posts back, and will complain. Using these javascript rpc methods provides a solution, which means they give you more money. Granted, if I was writing something for myself, I wouldn't put all the data on one page, but desired functionality is not the programmer's decision in many cases.

      Another example, say you have some bug reporting app, and there's a textbox for an admin to email the person who reported the bug. Do you really need to post all the data on the form, run some trivial email code, generate the form and data again, and pass it back to the client? The only difference in display would be some indicator that an email was sent. Isn't it a lot simpler to just issue a "send email" RPC and then show the result with javascript?

    4. Re:Images should be cached... by dorward · · Score: 1

      Ok, I think we are arguing two different things. I'm thinking this is excellent for data-heavy web applications where...

      Data-heavy web applications weren't in the use cases that started this thread. :)

    5. Re:Images should be cached... by rdc_uk · · Score: 1

      Yes they were.

      You decided to assume all my examples were trivial; they are not.

  86. Also see YAML by xoboots · · Score: 1

    YAML.org does about the same thing, though its goals are slightly different. XML is still a good idea -- in theory, Marge.

  87. we have used MSXML ActiveX for years by freejamesbrown · · Score: 1

    it's been in msie since 2000 or so. very handy. stable. probably a HUGE security hole like anything can be...

    very good for writing dynamically browsable trees and things using selects and stuff.

    i'm sorta shocked this is news and/or that there hasn't been a move to standardize this already.

    m.

  88. I have only one point to make-And it's a doozy. by Anonymous Coward · · Score: 0

    "Alas, they're a step away from the quasi-declarative "programming" of (D)HTML back to the procedural programming of C and its descendants, not something artsy web "developers" like to hear."

    "Artsy" devlopers don't program in the raw to begin with. That's what front end tools are for.

    Anyway "artsy" developers use stuff like this to get what they want. (programmed in XML and JS). There's even an Eclipse plugin to help. Maybe one of you non-"artsy" developers can mod it to spit out XUL?*

    *And ditch HTTP for communications. Try Jabber.

    1. Re:I have only one point to make-And it's a doozy. by uradu · · Score: 1

      > Maybe one of you non-"artsy" developers can mod it to spit out XUL?

      That would be nice, but in most enterprises the bottom line is still the underlying technology: are you generating ASP or not? If not, it really doesn't matter how good and productive the tools. Heck, it's not like the world has been wanting for productive distributed app tools and frameworks. In many shops, the question is only which Microsoft-provided technologies are the most productive.

      > And ditch HTTP for communications. Try Jabber.

      Can't argue with that. How about plain sockets if we're ditching HTTP anyway? The point of HTTP though is that it's firewall friendlier, so together with XML-RPC, SOAP, or a roll-your-own marshalling mechanism, it provides a viable RPC alternative.

    2. Re:I have only one point to make-And it's a doozy. by mattpalmer1086 · · Score: 1

      The whole point of HTML is that it's firewall friendlier? The whole point of firewalls is to control what kind of traffic you let through and what applications you expose. Tunnelling everything through HTTP just means you need an even cleverer firewall that can inspect each packet and decode the application layer stuff in it before passing it through. And HTTPS makes the problem even worse. Sigh.

    3. Re:I have only one point to make-And it's a doozy. by uradu · · Score: 1

      "The whole point of HTTP" was meant within the context of the discussion of different RPC transports, not as a qualifier of HTTP in general. IOW, the reason to choose HTTP over plain sockets would be because of the higher firewall tolerance, because there's little else speaking for it otherwise. Of course you'd still want to filter HTTP at a higher level in that case, even though exploits become harder to discover and more application specific the more you move up the protocol stack. Double sigh.

  89. Hear hear by GunFodder · · Score: 1

    Bring back the good old days! I love applications that only work on one platform. I need the speed that comes from undocumented OS calls, so when the app crashes it takes the system down with it. I think every app should have a totally different interface, because the developers know what users really want.

    I love recompiling my applications every time a new OS version comes out. I really love writing my own make scripts because the developers don't package the app for my platform. And I'm ecstatic when my application uses some non-standard network ports, so I get to poke holes in my firewall. Undocumented network interfaces are thrilling as well, since they allow new ways to infect my computer with viruses. It fills me with joy when I get to maintain my own client-side data, allowing me to spend hours pretending to be an SA and hundreds of dollars on local storage.

    Who wants boring old web apps that run on almost all OSes, over secure HTTP streams, on platforms (web browsers) maintained by hundreds of professionals, using web interface components used by web developers world-wide, and using data maintained by yet more professionals in real server rooms? This makes computing less of an adventure and more of a utility.

  90. S-expressions-is not XML. by Anonymous Coward · · Score: 0

    "(If you think about it, it started quite a time ago, since xml is isomorphic to sexps.)"

    XML is not S-Expressions.

    1. Re:S-expressions-is not XML. by imbaczek · · Score: 1

      That's all true; but notice that is-a != isomorphic.

  91. It is SO true! ;-) by hey! · · Score: 1

    You obviously understand how the system works, but you failed to understand exactly what it does.


    I'd actually turn that around. You understand that the system uses the same mechanisms as normal web access; however what is being done is application logic is being remoted. As such, in my opinion, security will have to be added on as an afterthought in many, if not most applications. While this is certainly feasible, it is not, in my opinion, a good thing.

    JSON is not less secure than normal web access


    And exposing application logic with no more security thant "normal web access" is a good thing?

    The same is true for JSON. Sure you can expose a deleteFile() method, but it would be just as stupid as the above mentioned URL


    And which, by default is what happens if you just remote your objects using JSON. What I'm saying is that this could be improved upon.

    The typical way to handle authentication is through the application servers login stuff which binds a principal to a session, or you do it by hand by using a ServletFiliter on top of the pages (and the JSON servlet).


    Now, the thing to remember JSON helpfully creates a session for you if you don't have on. So relying on the session to be created by your login page won't work, unless you have every object referenced by the JSON servlet check the session to make sure it is legit -- which is ugly. One of the nice things about JSON is that it allows you to remote access to POJOs, which in my book is a big plus. Right of the bat, you don't have your application logic littered with framework APIs that you may want to get rid of later.

    Your ServletFiler idea is essentially the same as my suggesting that we could apply an AOP interceptor on method requests. It's a good idea, so far as it goes, but to my mind it could be improved upon by building the security right into the servlet. The entire point is to make accessing remote logic from DHTML easy and hassle (i.e. bookkeeping) free. Granted creating servlet filters would not be rocket science, but in many cases there would be important cases overlooked, especially after software maintenance adds APIs to the objects in question.

    Let me give you an example of one possible way this could be done. I just pulled this out my hat, so it is far from perfect, but it illusrates how the process could be simplified.

    Suppose every class has a properties file listing who is allowed to access each of its methods.

    ping.deny:none
    ping.allow:all
    alist.deny:none
    alist.allow:adminstrator,programmer ...

    Now when a remote user tries to "Test.ping()", he gets the normal results. If a user tries to Test.alist(), his browser gets a 404 non-authorized, and he has to provide credentials if he hasn't done so yet.

    Now, to simplify the bookkeeping, the servlet can use introspection to create and maintain these properties files. When it sees a new method that isn't in the properties file, it can add the method to its security properties, defaulting to deny/all allow/none, the default policies to be settable by the servlet properties. When you are almost ready to deploy and have thoroughly unit tested all your remote logic, you just edit up the securities properties and run your user tests and you have a reasonably secure application.

    Next add a few interfaces for authenticating roles and users, and a few simple ready made implementations, for example using the container's digest authentication mechanisms, and you've got a reasonable, simple, extensible and replaceable default starting point for security. If the interface didn't suit your particular needs, you could turn it all of with a servlet property and use whatever method you wanted to.

    But you wouldn't start out of the gate with a completely unsecured application.

    I should be clear here. I think JSON is impressively clean. However, I think that security should not be an afterthought: it's going to be a requirement in virtually every non-trivial application it is used in.
    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    1. Re:It is SO true! ;-) by lokedhs · · Score: 1
      And exposing application logic with no more security thant "normal web access" is a good thing?
      I never said exposing application logic is a good thing. No self-concious developer are going to take their existing application classes and expose them through JSON. You write specific front-end classes that the JavaScript can use. The security can be placed wither in the servlet filter or in the front-end class.
      And which, by default is what happens if you just remote your objects using JSON. What I'm saying is that this could be improved upon.
      Doing that is so stupid I never even thought about it. :-)
      Now, the thing to remember JSON helpfully creates a session for you if you don't have on. So relying on the session to be created by your login page won't work, unless you have every object referenced by the JSON servlet check the session to make sure it is legit -- which is ugly.
      Yes, a servlet session is created on every access. However, I said "which binds a principal to a session". The key word here is "principal". Once this is done, you can use the standard servlet security mechanisms to allow/deny access to the JSON handler servlet as a whole.

      For more fine-grained control you'll have to use code in the handler methods or use the servlet filter.

      Your ServletFiler idea is essentially the same as my suggesting that we could apply an AOP interceptor on method requests.
      I'm no fan of AOP, the less the better. Why suggest AOP here when servlet filters are specifically designed for that purpose?
      Suppose every class has a properties file listing who is allowed to access each of its methods.

      [ most of the examples snipped ]

      Not a bad idea, and I'm sure something like this will be introduced in JSON. However, assuming JSON puts the method name in a request parameter (or in some other equally easy to reach place) you could implement all of this in a servlet filter that wraps the JSON handler servlet. Thinking about it, I think I'd be able to cover all of your suggestions in a single filter. It wouldn't even be particularily complicated.
    2. Re:It is SO true! ;-) by hey! · · Score: 1

      assuming JSON puts the method name in a request parameter

      Well, the method name and parameters are actually a character stream in the HTTP post, IIRC. You could still, I think, do what you are saying with a filter, but you are going to have to unmarshall the call from the input stream instead of just callng getParameter. However once done, you could do all kinds of weird and wonderful things with it if you were so inclined. The drawback is that it is not transparent at all to to the on-wire data representation.

      Once this is done, you can use the standard servlet security mechanisms to allow/deny access to the JSON handler servlet as a whole.

      Yes, but that's probably not what you want to do. (Why do I hear Dr. McCoy shout "But Funndascopic Examination is unrevealing in these cases!") It's almost never the case that you can get away with a security model this coarse grained.

      For more fine-grained control you'll have to use code in the handler methods or use the servlet filter.

      Well, again a servlet filter is certainly feasible, but not easily maintainable for the reasons cited in my prior post. WRT to the handler methods, if you are talking about the target objects, they are POJOs so you don't want to put a lot of stuff in them that knows about sessions and what-not, otherwise you lose all the POJO flexibility and testability. Which is why something AOPish works very nicely here.

      I'm no fan of AOP, the less the better. Why suggest AOP here when servlet filters are specifically designed for that purpose?

      Well, so far as I can see, servlet filters and AOP are apples and oranges, since in one case we're talking about intercepting and modifying http requests and in the other method calls. It's a similar idea, just applied to completely different problems. But in THIS case (using a servlet filter to intercept method calls encoded in HTTP requests) what we are talking about is absolutely using servlet filters to implement a form of AOP.

      So far as the suckiness of AOP, I think there is nothing wrong with the paradigm, just the current tools used for AOP.

      Doing that is so stupid I never even thought about it. :-)

      Glad you to give you a laugh -- no offence intended, mate.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    3. Re:It is SO true! ;-) by lokedhs · · Score: 1
      Well, the method name and parameters are actually a character stream in the HTTP post, IIRC. You could still, I think, do what you are saying with a filter, but you are going to have to unmarshall the call from the input stream instead of just callng getParameter. However once done, you could do all kinds of weird and wonderful things with it if you were so inclined. The drawback is that it is not transparent at all to to the on-wire data representation
      True, it might be somewhat difficult to do it. However, I'd say that that is the best option today. And once you've dont it, you can reuse that for all your JSON stuff.

      However, I do agree that it certainly isn't a bad idea to have it as part of the JSON framework, assuming they support some type of pluggable authentication modules. Because of the suckyness of the standard servlet authentication methods most people have designed their own and they need a way to plug into that.

      Well, again a servlet filter is certainly feasible, but not easily maintainable for the reasons cited in my prior post. WRT to the handler methods, if you are talking about the target objects, they are POJOs so you don't want to put a lot of stuff in them that knows about sessions and what-not, otherwise you lose all the POJO flexibility and testability. Which is why something AOPish works very nicely here.
      Like, why? You most certainly want to create some kind of front-end objects which the JacaScript page can use. Note that I'm not talking about the value objects here. I'm talking about the service objects which provides the information to the web pages.

      Just because the framework is flexible enough that it can support plain java objects doesn't mean it's a good idea to do so.

      So far as the suckiness of AOP, I think there is nothing wrong with the paradigm, just the current tools used for AOP.
      I find the concept flawed, mostly with regards to readability and debugability. This is, however, not the right forum to discuss that.
    4. Re:It is SO true! ;-) by hey! · · Score: 1

      Like, why? You most certainly want to create some kind of front-end objects which the JacaScript page can use. Note that I'm not talking about the value objects here. I'm talking about the service objects which provides the information to the web pages.


      Well, because of the every-policy-is-best-implemented-in-one-and-only-o ne-place principle and its effect on reusability and testability. The more that the software which implements the business logic of the application are mucked up with the details of delivery over the web and worse yet dealing with specific frameworks for deliverying services over the web, harder it is to devise tests for the object. Also, the more context specific the class is, the harder it is to reuse it in a different web framework, or in a Swing application, or a J2ME application. Reuse and testability seem to be two halves of the same coin. It seems to me the half the benefit of JSON is that the webification of a service object takes place outside the object's class definition, which simplifies it and makes it more portable. The other half is that it makes the object available for use at the presentation layer at a finer grain level than a page refresh.

      Cross-cutting concerns, like security, have a tendency to spread the impact of policy decisions across multiple objects. They should be handled at either the container level (e.g. servlet filters) or framework level, which naturally involves some form of method interception. In either case (filters or interceptors), we are using the one place principle to segregate the crosscutting concerns to simplify the basic object. Of course, we are also, in either case, introducing a potential source of bugs, but one that on the whole enhances the testability of the application if used sensibly.

      I find the concept flawed, mostly with regards to readability and debugability. This is, however, not the right forum to discuss that.

      In time, AOP style modification of method invocations will be regarded the same way as other things compilers and runtime environments do for us, like upcasting objects to their superclasses. The benefits of interception in AOP are exactly the same as the benefits of filtering for servlet invocation; in essence they are the same idea applied in two different problem domains. That said, there are underlying differences between the problem domains; if anything the methods used in AspectJ are too similar to servlet filtering for my taste. I'm a bit chary of the pattern matching aspect because the sheer number of object classes in a non-trivial application are so high. I'd prefer an explicit declaration of an aspect's application to a method configured in a separate source file, although it is a bit more time consuming. But I suppose in time experience will tell whether the wild card approach works.

      In any case, I don't think that we're disagreeing on JSON here: my original point is that there ought to be recommended best practices for implementing security before this thing really gets out of the gate. Servlet filtering would be acceptable, especially if some standard classes to facilitate this were provided. Clearly JSON is still in its infancy; in time it would probably be a good thing for there to be some model for security within the framework itself.
      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  92. slight problem in IE5.5 by willCode4Beer.com · · Score: 1
    So the Opera *fix* causes IE5.5 (Win) to throw an error.
    if(JSONRpcClient.http.setRequestHeader)
    JSONRpcCl ient.http.setRequestHeader("Content-type", "text/plain");
    Throws an exception on the if statement. Replacing it with:
    try{
    JSONRpcClient.http.setRequestHeader("Content-type" , "text/plain");
    }catch(e){ }
    appears to work. Anybody else find any issues? With this many brains on the task, this should turn out to be some bang-up code.
    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
  93. Validation by pdoubleya · · Score: 1

    What sort of validation is provided? Anyone can come up with a protocol that is thinner than XML, XML wasn't meant to be small. XML is readable while still allowing for type checking (basic with DTDs, advanced with Schemas or RelaxNG). Why pass around objects if you aren't going to do type-checking?

    --
    "I honestly would vote libertarian if their candidates weren't usually total cooks."--slashdot poster
  94. check out xul. by Antilles · · Score: 1

    I see some of the posts on here complaining about user interfaces via the web not being up to snuff, or the web not being 'suitable' or proper for certain things, or 'shouldnt be used' for task x. I hate to tell you, but the web can do a lot of things and if it works, it works, point blank. Want better UIs? Check out the XUL with firefox. My company has been doing the behind the scenes js calls for over 5 years now, this is nothing new. When we saw what they ff/xul guys were doing, we instantly realized they knew how to do it right from a developer's standpoint, and its first rate. For a little background, our progressions of js-callback tech went like this:
    First we used a hidden background frame to pull in data behind the scenes, and process posts to the server, all managed by a multiple queue which handled all calls in an orderly fashion and async. less control than a socket, but it worked well in commercial apps. Then we moved to something like

    this.oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");

    which gave us more control, but still wasnt cross platform. It could use xml, or just a variant of soap, or just text values, posting it to a ASP file. (And then MS makes something similar, calls it webservices with a asp file having a .asmx extension, and they are hailed as groundbreaking.)
    And then we moved on to XUL + XMLHttpRequest
    which is much the same as xmlhttp from ms, in fact when we ported over the IE6 specific js code, it worked almost flawlessly (the xul devs knew it was a 'good idea' and made sure they had a version in their stuff that matched the method sigs almost item for item). After we knew that the xul stuff was good under the hood, we had to know that the GUI-widgets was going to match our overly engineered 5000+ line dhtml controls (pain to write, but they sure look good.)

    XUL blows this one out of the water.

    intro
    http://docs.mandragor.org/files/M isc/Mozilla_applications_en/
    http://en.wikibooks. org/wiki/XUL_is_COOL

    file explorer! (nice)
    http://filemanager.mozdev.org/

    svg dom + xul dom intertwined (ff 1.9?)
    http://www.croczilla.com/svg/samples/

    oh oh oh you say! but Avalon/XAML are coming! --- and I say yeah, its nice, and does the xml markup of guis with the code behind, same thing as XUL. And you can bet your bottom dollar MS is betting on that (and indigo, and <blah blah blah/> to force you into longhorn, as well as another upgrade cycle. Avalon is essentially the same thing as xul, but with 2d rendering done via DX on your 300 dollar gfx card.

    So, since its getting late and I really should get off of this soapbox, the moral of the post is that the web can do more than you think, so give XUL a try.

  95. I've been doing this too... by vivin · · Score: 1

    In response to the parent, I've been doing this too, through iframes, Javascript and some server-side-scripting.

    I keep a hidden iframe that handles all my db transactions. All forms post to that iframe. The server-side language (I use PHP), dynamically creates JavaScript that accesses objects in the main frame, and updates them. This way, I don't have to reload the whole page.

    --
    Vivin Suresh Paliath
    http://vivin.net

    I like
  96. Re:ICBW but: Re:Perfect for the web? I don't think by JPyObjC+Dude · · Score: 1

    Java Script Object Notation is a native construct of JavaScript. As such JavaScript interpreters for parsing a JSON construct would be very highly refined requiring minimal resources from the host machine.

    JSON parsing was written way before any XML parsing and would be compiled at a lower level since again it is a native construct.

    Python would be the same.

  97. Similar interface for PHP by tahpot · · Score: 1

    There is a similar interface to serialize objects between PHP and Javascript called JPSpan (http://jpspan.sourceforge.net/).

    In addition a toolkit I've been working with to assist developers building such Javascript/PHP applications can be found at http://www.qwad.com.au/framework/

    Although the technology to do this has been around for a while, it's good to see people starting to realise some of the possibilities.

  98. Re:ICBW but: Re:Perfect for the web? I don't think by Anonymous Coward · · Score: 0

    Java Script Object Notation is a native construct of JavaScript. As such JavaScript interpreters for parsing a JSON construct would be very highly refined requiring minimal resources from the host machine.

    XML is a native document format of web browsers. As such, XML parsers are very highly refined requiring minimal resources from the host machine.

    Javascript is a general-purpose scripting language, and as such, a parser is necessarily more complex than a parser for a format that simply represents data.

    SON parsing was written way before any XML parsing and would be compiled at a lower level since again it is a native construct.

    "Compiled at a lower level"? It sounds like you think the XML parser in web browsers is code that runs on top of the Javascript engine. You are wrong.

  99. Security risk and guaranteed annoying by zogger · · Score: 1

    How secure is this? Haven't we seen enough havoc wrought with webpages that just go off and do what they want, instead of the web page viewer human actually selecting something? How many ActiveX and JS type security risks and exploits and "surprises" will it take to sink in? Is this lesson never to be learned, or what?

    Ya this sort of dynamic stuff can be used for "good", but it also most likely will be exploited for teh evil, and everyone knows it too, and joe poor web surfer will *not* know if he's hit a good or evil website until AFTER he shows up on the webpage, when it's too late. Get it? A-F-T-E-R. As in "too late", hacked, owned, screwed again.

    Just like now with JS and flash and whatnot. It's bogus 'sploit du juor, or screwy looking webpages with "style" sheets that *almost* work,(they can't even get that style sheet crap down so it actually works on most sites that use it) And know they want all sorts of new and shiny programs to be automagically activated when you click over on some site? Huh???

    uh huh, I bet this is real secure. And no blackhats will ever abuse it.

    You can run nitromethane in your car too,get some darn impressive spiffy street effects out of it, the deal is, do you *want* to all the time, is it really a good idea?

    Not trying to rain on anyone's parade, but how about this, just for something to chew on. How about making the web you got to play with NOW secure (and accessible) FIRST before you make it even more possibly IN-secure and IN-accessible unless you have broadband and a multi GHz machine with a gigs of RAM and 16 virus programs and three firewalls and block this and non pop that and..phooie. Just to surf??

    It's already annoying enough the amount of web pages you click over to INSIST you have images and JS turned on in order to use or view their site and the pages are obviously meant ONLY for people with wicked almost new fast machines and high speed broadband connections. You can't even get most webmasters to do a simple basic HTML 101 useability tiny pice of code typing which is to put alt text tags on images or image links anymore,it's become a lost art, they *don't freeking care*. It's not like they don't know about it, they absolutely don't care, can't be bothered with it, and I can hear them mumbling "&*&&^^^ them turkeys". Sorry, that's already quite rude enough. Now this stuff, they are gonna run all sorts of applications over the net? Click over and WHAM your machine starts doing whatever the heck some guy you never saw thinks it should be doing?

    Say WHUT? Oh boy, I can just see it now....not

    Good luckski, I'll be avoiding most of those pages whenever I run across them, just like I avoid JS and flash and cookies and images including web bugs now whenever possible. Man, just turning off JS and you avoid 90% of the bogus crap on the net. I kept wondering, like for the longest time where the hell all these "popups" were everyone was kvetching about, then one day I forgot and left JS on after I absolutely had to use it to get what I wanted at this site. MAN, the web is crawling with JS crap that popups ads and stuff! I didn't even know it! thought I was just lucky or something, turns out I took some security advice to heart and IT WORKED. And to avoid it, all I did was turn it OFF, didn't have to download install a new program or whatever. That should be a clue or two I would think.

    I just don't see this "new shiny" automatic web applications to last more than a little while and it will primarily be used by the same slimy guys who write and deploy all the crap viruses, trojans, adware, spyware, keyloggers, blah blah blah out there now. And no, absolutely no, I do NOT trust anyone's "assurances" about how "safe and secure" it is. We see security bugs found every day in stuff written years ago and used by millions and they still keep appearing. I'm fed up with "new shiny" crap on the web. FIX what you have FIRST please before you go off and force more crap on us. I'd be much mo

  100. Javascript ..shit ? by Anonymous Coward · · Score: 0

    "First: javascript is a shit language for anything other than DOM manipulation."

    I think this sweeping statement needs some backup.
    My suspicion is that anyone who believes this simply isn't fully aquainted with Javascript.

  101. Testing on IE 5.5sp1 by JPyObjC+Dude · · Score: 1

    Unfortunatly our corp still has images floating around with IE 5.5 sp1 installed. It carries MSXML version 8.0.5226. Has anybody gotten JSON-RPC to work solidly on these versions of IE?

    I'm having a bit of trouble tracking down a machine with it installed but I know it's out there.

    Tnx

    JsD

  102. Advantages over hidden iFrame by JPyObjC+Dude · · Score: 1

    I use the hidden iFrame technique quite extensivly in an enterprise system and the code needed to make it work solidly is rather complex. Aside from complexity, the hidden iFrame also has issues with the user easily killing the submit/get of the iFrame. This killing of the iFrame must be detected or blocked by the code else the DHTML application fails and the user blames the developer (as expected).

    I have gotten around this by poping up a modal window with some eye candy to capture all refreshes, stops, hotkeys etc, while the hidden iFrame is being processed.

    The advantage to this JSON-RPC methodology is that the code is completely synchronous. If you look at the source code, the request to the server and the response is on the same line. In the hidden iFrame, the event must be serialized and the loading of the iFrame must de-serialize that thread and continue the code. With JSON-RPC, you are on the next line of code.

    Much, much simpler and faster.

    Now hopefully, If I can get IE 5.5sp1 to work solidly, all my client side DHTML apps are going this way. Since I've been doing strong client side DHTML apps for years using hidden iframes as an RPC framework, I can turn JSON-RPC on in just a few days :]

  103. Re:ICBW but: Re:Perfect for the web? I don't think by JPyObjC+Dude · · Score: 1

    Yes you are correct, JSON parsing is not a lower level than XML, however it is at least as efficient. Just look at the total number of bytes in a JSON data structure vs an XML data structure. The only way to make XML as efficient is to compile it in some form but I've never seen compiled XML or support for such frameworks. Just gzip and you can gzip JSON too.

    I'd be surprised if JSON eval is slower than an XML parse.

    Another beautiful advantage of JSON is that again it is a native JavaScript data structure. A JSON is an object is a hashmap...

    It's the sweetest thing I have ever found in any language. Now if only I did'nt ignore that chapter when I was studying JavaScript way back when...

  104. Check out... Waqui: Web Applications Quickly by AndrewBoddy · · Score: 1

    Here're my 2 cents worth: http://www.i-fidelity.net/

    Waqui: Web Applications Quickly requires NO applets or plugins or XUL or Avalon. It is backend agnostic and is very light weight (200k). It is also pre-release so don't be too harsh.

    Waqui is aimed at "distributed complex back-office applications". It uses a tiny XML protocol to communicate with PHP/Java/ASP/...

    More examples coming soon...

    Andy

  105. PHP implementation by migurski · · Score: 1

    Couple days late, but I just finished banging out a lightweight PHP implementation of JSON.