Idea of Using ajax to implement ORM

Source: Internet
Author: User
Recently, Ajax has been quite popular. It seems like the savior of Web applications. It has not been able to speculate in the Web field for a long time. Now, I have finally found something to vent my passion. Although I personally don't think there is anything amazing about this thing, I always think that JavaScript and other things can be used as an adhesive, but it is still not enough to count on it. I am optimistic about Windows platforms. net, the thing itself has a runtime that can be dynamically compiled and run, the performance is better than that of JavaScript, and the IDE is incredibly powerful (you can write a bit later. net Code , Compile and execute technology, it is estimated that the final implementation of sliverlight should push. net instead of JavaScript), Ajax is always a transitional thing. In addition, Ajax is not a technique, but a skill.
Although I think Ajax is a transitional thing, I still need to learn about it and mix it with a few dollars. For the transfer of Web data or the persistent solution of objects, Microsoft provides a solution named Javascriptserializer HTTP handler implemented by ASP. NET pages, htpp handler, or ashx pages to serialize an object into a josn string or serialize A josn character into an object. Although flexible, I still feel that the implementation is not transparent. Program There are too many things to do.
I want to provide a session class implemented by JavaScript on the Web Client. This class provides object persistence operations and a handler on the server side to respond to Session requests, in addition, reflection or other technologies (such as data drivers) are used to schedule Session requests to the object persistence layer, this completely solves the issue that many handler needs to be provided for the Web Client to handle a bunch of loose requests, making the code more rigorous.
Client pseudocode:
Net. Session = function {};
// Query object
VaR projects = net. session. Query ("project", "Some condition ");
// Delete an object
Projects. Delete ();
Net. session. Submit (projects );
// Update object
Project [0]. Name = "idea of Using ajax to implement ORM ";
Net. session. Submit (projects );
// Add an object. The prototype of the object is retained on the client. If no record is recorded, request a new object from the server.
VaR newproject = net. session. New ("project ");
Newproject. Name = "the idea of using Ajax to implement ORM ";
Net. session. Submit (newproject );

// Server
VaR object = parser. parse (request );
Net. session. Submit (object );

This is just an assumption. If there is anything wrong, please give us a lot of advice. If you are not busy in the future, please write out the specific implementation code.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.