【转载】Spring最佳后台框架
https://www.quora.com/What-is-the-best-backend-arquitecture-using-spring-framework
The most modern architecture is one based on Spring as a backend, with a Javascript framework on the frontend. A good alternative is Spring as a full stack framework, using Thymeleaf for server generated JSP pages, see Tutorial: Thymeleaf + Spring, but nowadays people expect web pages to be dynamic and fast responsing, and this is harder to do with server generated UI.
In this case, Spring will act as a RESTful service (Understanding : REST) and the JS framework will request and use it to generate Web pages. Actually, the most used frameworks are:
- AngularJS Superheroic JavaScript MVW Framework
- ReactJS A JavaScript library for building user interfaces | React
- JQuery UI jQuery UI
You’ll surely find a ton of other alternatives as valid as these. My personal suggestion is to start with AngularJS 2, avoid the 1.x branch which suffered from various issues.
ReactJS is probably most performant and has more hype, but it requires to be assembled with other libraries to start working, while Angular is an all-in-one tool.
DDD is a design approach where entities “drive” the overall architecture. So, you have a OO model and, around it, a layer of services which manage them.
Casually it’s what Spring does by default :)
If a storage is needed, you have to choice between SQL or noSQL. Then you have to choice between direct SQL access or an ORM framework. ORM, usually by Hibernate, simplifies table <-> entity mapping, but it’s another framework to learn…
This is a guide about using SQL with Spring Accessing Relational Data using JDBC with Spring and this is about using an ORM Accessing Data with JPA
Having your DB mapped to OO entities, you now need to throw them to the JS framework. The right way is to serialize your output as Json, so the (simplified) path is:
DB -> (by SQL/ORM repository)-> Object -> (by Services) -> HTTP Resource -> (by Controller) -> Json
Going from your DB-loaded entities (or some representation of them) to Json is very easy, by using RestControllers, usually you simply return the entity, and Spring will do the serialization, using FasterXML/jackson.
This is a guide about REST controllers: Spring MVC 4 RESTFul Web Services CRUD Example+RestTemplate - WebSystique
As I usually write, there is a lot of work to do, compared to PHP/Ruby/Python couterparts. This is justified by a better organization of your code, and the advantages become more clear on size growing. For little or simple problems all this work has objectively no justification.
【转载】Spring最佳后台框架的更多相关文章
- Spring Boot(5)一个极简且完整的后台框架
https://blog.csdn.net/daleiwang/article/details/75007588 Spring Boot(5)一个极简且完整的后台框架 2017年07月12日 11:3 ...
- 关于vue 框架与后台框架的混合使用的尝试------转载
这几天我在研究前台框架和后台框架融合的问题,进行了一些尝试; 我前台选择的是 vue,当然也可以选择 react 等其他 mvvm 框架,不过 vue 对于我来说是最熟悉的; 后台话,我选择的是 ph ...
- 2016年7款最佳 Java 框架
毫无疑问,Java 是目前最为流行的编程语言之一,这里我们挖掘出了一些比较受欢迎的框架的有效信息,它们可以减轻全球软件开发人员的日常工作. RebelLabs的一项调查显示,通过在线Java用户论坛( ...
- Spring Batch 批处理框架介绍
前言 在大型的企业应用中,或多或少都会存在大量的任务需要处理,如邮件批量通知所有将要过期的会员,日终更新订单信息等.而在批量处理任务的过程中,又需要注意很多细节,如任务异常.性能瓶颈等等.那么,使用一 ...
- 为什么选择 Spring 作为 Java 框架
1. 概述 在本文中,我们将讨论 Spring 作为最流行的 Java 框架之一的主要价值体现. 最重要的是,我们将尝试理解 Spring 成为我们选择框架的原因.Spring 的详细信息及其组成部分 ...
- Spring的JDBC框架
转自: http://www.cnblogs.com/windlaughing/p/3287750.html Spring JDBC提供了一套JDBC抽象框架,用于简化JDBC开发. Spring主要 ...
- 【Spring】Spring系列7之Spring整合MVC框架
7.Spring整合MVC框架 7.1.web环境中使用Spring 7.2.整合MVC框架 目标:使用Spring管理MVC的Action.Controller 最佳实践参考:http://www. ...
- Struts2+Spring+Hibernate 三大框架的合并集成
这次来看看Struts2+Spring+Hibernate三大框架的整合应用,主要是Spring和Hibernate框架的整合,因为前边已经将Strtus2+Spring整合过了基本一样. 首先看一 ...
- (文件)图片上传,Spring或SpringMVC框架
spring或springMVC框架图片(文件)上传 页面部分,用一个简单的form表单提交文件,将图片或文件提交到服务端.一个输入框,用于输入图片的最终名称,一个file文件选择,用于选择图片. 页 ...
随机推荐
- histoty显示时间戳
设置Linux可以查看历史命令的执行时间 大家都知道Linux平台上,可以通过history命令查看最近所执行过的命令,但history命令默认所显示的只有编号和命令的,只知道命令是最近所执行 ...
- AngularJS内建服务以及自定义服务的用法
在AngularJS中, 服务是一个比较重要的部分,它是一个对象或者是函数,可以在你的AngularJS的应用中使用.接下来介绍几种比较常用的内建服务以及自定义服务的方法. [内建服务] (1)loc ...
- 【JavaScript 从零开始】 数字 文本 包装对象
JavaScript中的算术运算 JavaScript 还自称更加复杂的算术运算,这些复杂的运算通过作为Math对象的属性定义的函数和常量来实现: Math.pow(2,53) //=>9007 ...
- 美图吴欣鸿:请不要叫我CEO
关于采访提纲上“对互联网+如何理解?”的问题能否不做回答? 他的说法听上去谦虚而实在,“我一般对于这种大的.有点政策性的问题其实是Hold不住的,我的谈话风格就是比较随性.感性,也很难说去推出一个很强 ...
- SpringBoot数据库访问(一)--------关系型数据库访问(RDBMS)
关系型数据库访问(RDBMS) 采用JdbcTemplate.MyBatis.JPA.Hibernate等技术. 一.JdbcTemplate工具 在pom.xml添加boot-starter-jdb ...
- 如何在HTML 5中拖动光标图标?
window.app = { dragging: false, config: { canDrag: false, cursorOffsetX: null, cursorOffsetY: null } ...
- [日常] SinaMail项目和技术能力总结
一.企邮WEBMAIL项目1.完成手机绑定二次验证,绑定手机提升账户的安全性2.登陆验证接口改造,增加一系列登陆限制,增强webmail的系统可靠性3.增加外发限制功能,及时控制用户发信行为,有利于企 ...
- js-用于检测类数组对象的函数
//判定o是否是一个类数组对象 //字符串和函数有length属性,但是它们 //可以用typeof检测将其排除.在客户端JavaScript中,DOM文本节点 //也有length属性,需要用额外判 ...
- Docker for Windows(二)登录与配置镜像加速器
一.启动Docker for Windows 通过桌面Docker Desktop启动,右下角出现的白色鲸鱼图标保持稳定时,表示Docker正在正常运行,将鼠标移到图标上会显示"Docker ...
- Oracle SQL_TRACE使用小结
一.关于基础表Oc_COJ^c680758 rd-A6z/&[1R1] H680758 Oracle10G之前,启用AUTOTRACE功能需要手工创建plan_table表,创建脚本为$ORA ...