当前位置: 首页 > 工具软件 > MERN > 使用案例 >

mern全栈开发pdf_使用MEAN / MERN进行JavaScript全栈开发-您可能会错过的一些巨大优势

桂高昂
2023-12-01

mern全栈开发pdf

JavaScript has been the dominant language in the field of web development for a couple of decades. Initially being the leader of front-end development, the popularity of JavaScript was only limited to front-end engineering. But with the introduction of Node.js, it also became a popular choice for server-side developments and hence became a complete technology for the major proportion of web development projects.

几十年来,JavaScript一直是Web开发领域中的主导语言。 最初,JavaScript是前端开发的领导者,其流行仅限于前端工程。 但是随着Node.js的引入,它也成为服务器端开发的流行选择,因此成为了大部分Web开发项目的完整技术。

什么是“全技术堆栈”? (What is “Full Tech-Stack”?)

Any sort of a web or desktop application contains several layers or stacks. The simplest stack formation is the Front-end -> Back-end -> Database. Therefore a developer should be aware of technologies that could be used to implement each layer if he wishes to be a full-stack developer. The combination of technologies that could be used to implement a full-stack is known as a “full tech-stack”.

任何类型的Web或桌面应用程序都包含多个层或堆栈。 最简单的堆栈结构是前端->后端->数据库。 因此,如果开发人员希望成为一名全栈开发人员,则应意识到可用于实现每个层的技术。 可以用于实现完整堆​​栈的技术组合被称为“完整技术堆栈”。

Usually, it has been almost impossible to have a full tech-stack that operates on a single technology. But with the introduction of MEAN and MERN stacks, it has now become completely possible.

通常,要拥有一个基于单一技术的完整技术栈几乎是不可能的。 但是随着MEAN和MERN堆栈的引入,现在已经完全有可能。

什么是“ MEAN”和“ MERN”? (What is ‘MEAN’ and ‘MERN’?)

MEAN and MERN stacks refer to an open-source collection of JavaScript-based technologies used to develop web applications. MEAN is an acronym for MongoDB, ExpressJS, AngularJS, and Node.js. And MERN stands for MongoDB, ExpressJS, ReactJS, and Node.js.

MEAN和MERN堆栈是指用于开发Web应用程序的基于JavaScript的技术的开源集合。 MEANM ongoDBE xpressJSA ngularJSN ode.js的首字母缩写。 和MERN代表中号 ongoDBêxpressJS- [R eactJS ,和Ñode.js

Node.js is the server-side JavaScript execution environment. Express is a lightweight framework used to build web applications in Node. MongoDB is a schemaless NoSQL database system. And AngularJS/ReactJS is the client-side JavaScript framework.

Node.js是服务器端JavaScript执行环境。 Express是用于在Node中构建Web应用程序的轻量级框架。 MongoDB是无模式的NoSQL数据库系统。 AngularJS / ReactJS是客户端JavaScript框架。

As you can see, the difference between MEAN and MERN is driven by the differences in between AngularJS and ReactJS. AngularJS which is developed and maintained by Google is mainly used for developing Single Page Applications (SPA). AngularJS is commonly used to build “Rich Internet Applications”. It aims to simplify both the development and the testing of such applications by providing a framework for client-side Model View Controller (MVC). And also the applications written in AngularJS are cross-browser compliant — Angular automatically handles JavaScript code suitable for each browser.

如您所见,MEAN和MERN之间的差异是由AngularJS和ReactJS之间的差异驱动的。 由Google开发和维护的AngularJS主要用于开发单页应用程序 (SPA)。 AngularJS通常用于构建“ 富Internet应用程序 ”。 它旨在通过为客户端模型视图控制器 (MVC)提供框架来简化此类应用程序的开发和测试。 而且,用AngularJS编写的应用程序也兼容跨浏览器-Angular自动处理适用于每种浏览器JavaScript代码。

On the other hand, ReactJS (which is the most popular JavaScript framework at the present is maintained by Facebook) is a specialized tool for building dynamic user interfaces of the web pages with high incoming traffic. The virtual DOM and the JSX are the special features that make ReactJS unique from AngularJS.

另一方面,ReactJS(目前由Facebook维护的最流行JavaScript框架)是用于构建具有高传入流量的网页动态用户界面的专用工具。 虚拟DOMJSX是使ReactJS与AngularJS独树一帜的特殊功能。

If you are wondering about when to choose between MEAN and MERN, it's solely based on the differences in between ReactJS and AngularJS. Briefly put, the MERN stack will be a good choice if:

如果您想知道何时在MEAN和MERN之间进行选择,那完全是基于ReactJS和AngularJS之间的差异。 简而言之,在以下情况下,MERN堆栈将是一个不错的选择:

  • Your team is new to both Angular and React and therefore thought to opt for the language with the easier learning curve

    您的团队是Angular和React的新手,因此认为您应该选择易于学习的语言
  • Better documentation is available

    提供更好的文档
  • The project under execution is somewhat bigger

    执行中的项目更大
  • The project is more performance-focused

    该项目更加注重绩效
  • There are long-term enhancements and maintenance

    有长期的改进和维护
  • There is a mobile development component in your project

    您的项目中有一个移动开发组件

And if the following is true then the MEAN stack will be a good choice:

如果满足以下条件,那么MEAN堆栈将是一个不错的选择:

  • You are focusing on developer productivity

    您正在关注开发人员的生产力
  • The project is smaller and simpler

    该项目更小,更简单
  • You are focused on defect prevention and pass lesser work to the QA

    您专注于缺陷预防,并将较少的工作交给质量检查人员

与其他传统技术堆栈相比,使用MEAN / MERN有什么优势? (What are the advantages of using MEAN/MERN over other traditional tech-stacks?)

  • A common language for the entire project — This is the most highlighted feature of using MEAN/MERN over other tech stacks. MEAN/MERN uses only JavaScript and therefore is the universal language of development. This can significantly reduce the cost and effort spent on coding since two separate teams won’t be required for the front-end and back-end separately. Such a cross-functional team is a great asset when following Agile methodologies.

    整个项目的通用语言 -这是在其他技术堆栈上使用MEAN / MERN的最突出功能。 MEAN / MERN仅使用JavaScript,因此是开发的通用语言。 由于不需要分别为前端和后端组成两个独立的团队,因此可以大大减少编码成本和工作量。 当遵循敏捷方法论时,这样的跨职能团队是一笔巨大的财富。

  • It is completely open-source — The technologies in the MEAN/MERN stacks are open source, making them available and free. This gives you easier access to public repositories and libraries making the development process easy and less costly. The tools that are open-sourced are updated regularly and evolving fast due to active community contributions. Instead of relying on a fixed set of technologies, you may use any of more than 475,000 tools hosted by the npm, the largest JavaScript modules registry in the world.

    它是完全开源的-MEAN / MERN堆栈中的技术是开源的,使其可以免费使用。 这使您可以更轻松地访问公共存储库和库,从而简化了开发过程并降低了成本。 开源工具会定期更新,并且由于社区的积极贡献而Swift发展。 您可以使用npm(世界上最大JavaScript模块注册中心)托管的超过475,000个工具中的任何一种,而不必依赖一组固定的技术。

  • Backed up by some of the largest communities in the world — Backed by giants like Facebook and Google, JavaScript has a powerful and fast-growing community. Any popular developer websites contain lists of questions tagged “JavaScript”, which indicates the high activity of the developer community and the huge amount of valuable information that can be found there. Top app developers have posted their answers to common queries, and even if you have any doubts, you can always post it in a public forum and would invoke answers from the experts.

    在世界上一些最大的社区的支持下,JavaScript得到了Facebook和Google等巨头的支持,它拥有一个功能强大且发展Swift的社区。 任何受欢迎的开发人员网站都包含标记为“ JavaScript”的问题列表,这表明开发人员社区的活跃程度以及可以在此处找到的大量有价值的信息。 顶级应用程序开发人员已经发布了他们对常见查询的答案,即使您有任何疑问,也可以随时将其发布在公共论坛上,并会调用专家的答案。

  • Higher code reuse — With full-stack JavaScript, you save time through code reuse and sharing. Following the “don’t repeat yourself” (DRY) principle, you might be able to reduce the effort by reusing the parts of the code (or shared libraries, templates, and models) on both back and front-end that are very close in terms of logic and implementation. Reducing the number of lines of code by up to 40% is also a valuable capability when refactoring and maintaining the source code.

    更高的代码重用性 -使用全栈JavaScript,可以通过代码重用和共享节省时间。 遵循“不要重复自己”( DRY )原则,您可以通过在后端和前端重用非常接近的部分代码(或共享库,模板和模型)来减少工作量在逻辑和实现方面。 在重构和维护源代码时,将代码行数减少多达40%也是一项有价值的功能。

  • Using JSON — As MongoDB is a component-based relational database, you can save documents in the JSON format (Javascript Object Notation). This is, however, limited to small to intermediate level companies. This is probably why developers prefer this tech stack for various stages of app development.

    使用JSON-由于MongoDB是基于组件的关系数据库,因此您可以将文档保存为JSON格式(JavaScript对象表示法)。 但是,这仅限于中小型公司。 这可能就是为什么开发人员在应用程序开发的各个阶段都喜欢这种技术堆栈的原因。

  • Allows for real-time demonstrations of apps — At a time when the trend is to have real-time demo app open to viewers/ subscribers, this technology would be a major help as it allows for quick and real-time changes to your app even during app development.

    允许对应用程序进行实时演示 —在趋势是向观众/订户开放实时演示应用程序的时代,该技术将为您带来快速的实时更改,这将是一项重大帮助,甚至在应用程序开发期间。

  • Better performance and speed — Node.js uses an event-driven, non-blocking IO model that makes it lightweight and fast as compared to other commonly used back end technologies. PayPal was able to make the development almost 2 times faster while reducing the engineering personnel involved. Moreover, they have seen a dramatic improvement in performance, doubling the number of requests completed per second and decreasing the average response time by 35% for the same page. This means that the pages are served 200ms faster, which is definitely a noteworthy result.

    更高的性能和速度 -Node.js使用事件驱动的非阻塞IO模型,与其他常用的后端技术相比,它轻巧,快速。 PayPal能够使开发速度提高近2倍,同时减少了所涉及的工程人员。 此外,他们看到了性能的显着提高,每秒完成的请求数量增加了一倍,并且同一页面的平均响应时间减少了35%。 这意味着页面的提供速度提高了200毫秒,这绝对是一个值得注意的结果。

  • High flexibility — You can test your app even during the development process, and host it on the cloud. And if you want to add new information any time in the future, just a new field to add in the form, and it's done.

    高度的灵活性 -您甚至可以在开发过程中测试您的应用程序,并将其托管在云中。 而且,如果您想在将来的任何时候添加新信息,只需在表单中添加一个新字段即可。

  • Ease of hiring developers — According to the Stack Overflow annual survey, JavaScript is the most-used programming language, used by 67.7% opting for it. Taking into account the fact that the survey covered only about 0.4% out of more than 20 million developers worldwide, the total number of JavaScript engineers might be well over 12 million. Therefore, finding a skilled engineer is relatively easy.

    轻松招聘开发人员 -根据Stack Overflow年度调查 ,JavaScript是使用最多的编程语言,有67.7%的人选择使用JavaScript。 考虑到该调查仅覆盖了全球超过2000万开发人员中的0.4%,JavaScript工程师的总数可能远远超过1200万。 因此,找到熟练的工程师相对容易。

Despite the fact that there are some drawbacks to going full stack with JavaScript, the MEAN/MERN approach already has achieved a strong backup and is evolving quickly. The number of active repositories on GitHub is a compelling argument in favor of the language. Due to its high scalability and speed, this approach is often used to build MVPs. Apart from that, there are a number of use cases for full-stack JavaScript with Node.js. Based on the arguments listed above, it is recommended using MEAN/MERN within the following domains:

尽管使用JavaScript全栈存在一些缺点,但MEAN / MERN方法已经实现了强大的备份,并且正在Swift发展。 GitHub上的有效存储库数量是支持该语言的令人信服的论点。 由于其高可伸缩性和速度,该方法通常用于构建MVP 。 除此之外,Node.js的全栈JavaScript还有很多用例 。 根据上面列出的参数,建议在以下域中使用MEAN / MERN:

  • Real-time peer-to-peer applications and services (multi-user chats, social media platforms, online games, collaboration tools)

    实时对等应用程序和服务(多用户聊天,社交媒体平台,在线游戏,协作工具)
  • The Internet of Things

    物联网
  • eCommerce solutions

    电子商务解决方案
  • Enterprise web solutions

    企业网页解决方案
  • Application/system monitoring dashboards, admin panels.

    应用程序/系统监视仪表板,管理面板。

结论: (Conclusion:)

The future and longevity of the MEAN/MERN stacks will depend on you, so take it out of the pigeon-hole and let it realize its full potential! Thank you for reading my article. Happy coding and be safe!

MEAN / MERN堆栈的未来和寿命将取决于您,因此将其从鸽子洞中移出并充分发挥其潜力! 感谢您阅读我的文章。 编码愉快,安全无虞!

翻译自: https://codeburst.io/javascript-full-stack-development-with-mean-mern-some-magnificent-advantages-you-might-have-87551b738fb5

mern全栈开发pdf

 类似资料: