API-First web framework synth, and different voices in the community

Source: Internet
Author: User
Tags naming convention

At the recent Google Angularjs conference,Synth surfaced as a set of API-first Web application frameworks built on node. js.

Since synth was disclosed, the GitHub project has grown from 1 to more than 500 stars in 1.5 months. But Synth's creator, Jon Abrams, says the broader developer community is still confused about the framework.

Jon Abrams says the synth project differs from the traditional node. JS Web Framework. It is designed to simplify the creation of back-end resources that can be preloaded automatically when the Angularjs view is loaded.

Synth features include preloading of angular model data, preloaded HTML views, and a simplified set of project structures when the page loads-front-end code is placed in the front-end folder, and the backend Code (node's code and package) is placed in the back-end folder.

Abrams a detailed description of the preload:

The automatic pre-loading of data will solve the problem of data rendering delays when loading a particular Web view.

Many people may remember when Twitter first switched to the single page app (SPA) architecture. If you click a link to jump to a specific tweet online, the single page app renders first, and then after a delay, the tweet is finally rendered.

If Twitter was able to use synth at the time, the tweet would be rendered as soon as the page was rendered, since using synth would eliminate the need to send API requests for data.

Preloaded features benefit from the added support for the "commit" feature in the Synth API handler function. Since the API processor no longer needs to speak directly to the express response object, synth has reused the API processor. Now, when requesting a particular Web view, the API processor will work, not only when the corresponding API is called. This will help reduce the high latency issues that are common in mobile Web applications.

Synth also wants to simplify the process of creating new restful API resources by creating folders and named functions in a specific way. Synth scans the resource folder for. js (or. coffee) files, and then generates the API based on the name of the folder in which they are located. To create a memo resource, a developer should create a directory with the same name, and then declare a request handler for a specific HTTP method in a file in the resource path, which can be done by assigning an export function.

For synth, the response from the developer community mixes a different sound. Abrams said the feedback from the Angularjs community was very positive, especially on Twitter. However, as his synth speech was recently on the home page of Hacker News , Abrams found that some people were confused about the problems synth aimed to solve.

Panu Horsmalahti, a software designer for the Finnish cybercom Company, evaluates the name function:

from my experience, memory can have a new naming convention that affects functionality, making everything more difficult rather than simpler. We can create an interesting demo that shows how "easy" and "fast" it is to create such a demo, but as soon as we extend the app, everything becomes more chaotic, and at this point the naming convention will begin to encounter limitations.

Also, learning the code base becomes more difficult when we have a naming convention that will create functionality anywhere.

Other commentators even questioned Abrams's ability to think. Software engineer Richard Bishop:

at any time, when I see" Some servers are used specifically for some customer-side frames ", I feel that the author has lost his mind.

The browser is just a client. All browser-oriented frameworks are just (should be) abstractions created to create dynamic browser applications. If we need to create a server-side framework that is specifically designed to work with the client framework, it actually represents a signal: we should stop and think about what went wrong.

abrams response Way:

I know the idea is crazy. I like crazy ideas, the more crazy the better.

But I don't agree with the fact that the browser is just a client. If we want to, we can treat it as a client, but we can also go another way: The client code can be provided by the same server, the server can access the data of the client application. And that's exactly what synth is designed for.

synth is still in beta and is in active development. So it's still a distance away from being applied to the product. Infoq readers can use their github Project (and subkeys, such as synth-api ) To contribute to this open source project.

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.