【转载】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文件选择,用于选择图片. 页 ...
随机推荐
- mysql中Access denied for user 'root'@'localhost' (using password:YES)错误
此错误主要是由于你的系统曾经装过MYSQL,在重装就会要求输入原来设定的密码 由于输入错误导致 解决办法见 上一篇博客 MYSQL安装时解决要输入current root passwo ...
- springcloud-feign的hystrix支持
关于hystrix的介绍,可以看我的上篇博客:springcloud-断路器hystrixs 本文主要介绍在feign中,如何使用hystrix 1.pom依赖 <dependency> ...
- win7下使用IIS服务器及自定义服务器端包含模块(SSI)步骤
配置完过段时间就容易忘记,特此记录. 1.开启IIS服务器. 默认没有安装,需要先安装. 打开控制面板–> 打开“程序和功能”–> 左侧选择“启用或关闭windows功能”–> 找到 ...
- 3.C#基础篇-->堆和栈
一.前言 堆与栈对于理解.NET中的内存管理.垃圾回收.错误和异常.调试与日志有很大的帮助.垃圾回收的机制使程序员从复杂的内存管理中解脱出来,虽然绝大多数的C#程序并不需要程序员手动管理内存,但这并不 ...
- sql count执行速度测试
要对数据库里面的数据数量进行统计使用,数据库的大概有2000w多的数据.数据库是mysql5.6 用的是远程连接测试 ELECT COUNT(*) 执行语句: select count( *) fro ...
- [日常] PHP设置 include_path 配置选项
动态设置php.ini中的include_path 配置选项: 两种方式set_include_path($new_include_path)ini_set('include_path',$new_i ...
- spring事务注解失效问题
问题描述: 由于工作需要,需要在spring中配置两个数据源,有一天突然发现@Transactional注解失效 环境框架: springmvc+spring+spring jdbcTemplate ...
- 郭霖 - MVVM开源项目学习
https://blog.csdn.net/guolin_blog/article/details/87900605 https://medium.com/androiddevelopers/view ...
- centos7下安装sublime text3并配置环境变量
注意:我解压完把sublime_text全改成了sublime,如果未改就是sublime_text 1.官网下载sublime,保存到指定目录,例如/home 2.解压 tar xjf sublim ...
- Linux学习5-初学者注意事项
1.Linux严格区分大小写 2.Linux中所有内容以文件形式保存,包括硬件 硬盘文件是/dev/sd[a-p] 光盘文件是/dev/sr0等 3.Linux不靠扩展名区分文件类型, ...