作为Grails的单一的应用程序或不同的后端和前端应用程序 [英] Grails as single app or different back-end and front end app

查看:128
本文介绍了作为Grails的单一的应用程序或不同的后端和前端应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是新的Grails和关心以下问题:

We are new to grails and are concerned about the following issues:


  1. 可扩展性的担忧

  1. scalability concerns

使用相同的后端针对不同的应用

Using same back-end for different applications

所以坚持一个Grails是好主意还是应该分开的关注,甚至使用类似的node.js的前端使用REST等框架。

So sticking to a single grails is good idea or we should separate concerns and even use other framework like node.js for frontend using rest.

其次,我不是很清楚,我们应该把业务逻辑在大盘app.Ideal地方应该是服务我想

Secondly i am not very clear ,where we should put business logic in grail app.Ideal place should be services i suppose

我们正在研究Angular.js,因为它似乎比GSP页,当前香精,用于前端和集成大盘更快也easier.Wanted检查这是正确的选择与否。

We are examining Angular.js since it seems to faster than gsp pages,current flavour for frontend and integration with grail is also easier.Wanted to check is this correct option or not.

推荐答案

Grails是非常适合快节奏的发展需要和你一定会喜欢它,当你得到它基本的了解。你可以写在任何框架/语言性能糟糕的应用程序。有一件事我建议越来越Hibernate的一个很好的理解这是底层持久库。如果您了解如何工作的,它应该帮助你避免在数据库级别做任何愚蠢的错误。

Grails is very well suited fast paced development needs and you will love it when you get basic understanding of it. You can write a badly performing application in any framework/language. One thing I'd recommend is getting a good understanding of Hibernate which is the underlying persistence library. If you understand how that works, it should help you avoid making any silly mistakes at the DB level.

对于你的问题的第一部分Web应用程序的可伸缩性不会真的取决于什么语言/框架您选择使用,但您的应用程序,而如何构建的。你可以建立在Grails的一个可扩展的Web应用程序,就像你可以在C构建一个慢得令人难以置信的应用程序++。如果Grails是你想用的框架,然后用它;你总是可以重写Java或其他语言的快慢速部分,如果需要的话。 (毕竟,这就是微博做了与斯卡拉。)

For the first part of your question the scalability of your web application won't really depend on what language/framework you choose to use, but rather how your application is built. You can build a scalable web application in Grails, just as you can build an incredibly slow application in C++. If Grails is the framework you would like to use, then use it; you can always rewrite the slow parts in Java or another fast language, if need be. (After all, that's what Twitter did with Scala.)

在我们公司,我们要做的就是将Grails用作一个客户端交互/授权服务器,并使用多个Node.js的服务器进行分析。因此,所有的客户端是什么使被存储的Grails服务器上,然后在功能的数据发送到Node.js的服务器群进行进一步的处理。从Node.js的服务器分析数据由Grails的服务器使用http建设者获取并用于绘制仪表盘上的图表和数据。

In our company what we do is use grails as a client interaction/licensing server and use multiple Node.js servers for analytics. So all what client gives gets stored on grails server and then the functional data is sent to Node.js server cluster for further processing. The analytics data from Node.js server is fetched by grails server using http builder and is used to plot charts and data on dashboard.

// -------------更新应答更新的问题----------------------

//------------- Updating answer for updated question ----------------------


  • 的Node.js是服务器端技术,它不会在前端的工作,即客户端

  • 在Grails中你写的所有传入(服务器)和离开(从服务器)的东西控制器。

  • 虽然所有的业务逻辑/计算/ DB查询进入您的服务方法。做一次通过return语句和控制器发送运算数据回控制器发出/显示它GSP。

  • 虽然关于你的角度JS问题,我会说,你不能用角JS更换GSP作为GSP不过是在你写的Grails /常规/ JAVA code在服务器端脚本脚本可以让普通HTML一起形式code和它被渲染成完整的HTML和被发送到客户端。所以,你只能通过添加前端MVC像角来增强其功能,并不能代替它。和功能明智的角度俱佳的框架。任何一种JS添加到您的GSP的,享受它们。

P.S。 - 一旦你这是很容易做的事情很多GSP标签的窍门你会开始爱上GSP

P.S. - You'll start loving GSP once you get hang of GSP tags which are so easy to do many things.

这篇关于作为Grails的单一的应用程序或不同的后端和前端应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆