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:

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最佳后台框架的更多相关文章

  1. Spring Boot(5)一个极简且完整的后台框架

    https://blog.csdn.net/daleiwang/article/details/75007588 Spring Boot(5)一个极简且完整的后台框架 2017年07月12日 11:3 ...

  2. 关于vue 框架与后台框架的混合使用的尝试------转载

    这几天我在研究前台框架和后台框架融合的问题,进行了一些尝试; 我前台选择的是 vue,当然也可以选择 react 等其他 mvvm 框架,不过 vue 对于我来说是最熟悉的; 后台话,我选择的是 ph ...

  3. 2016年7款最佳 Java 框架

    毫无疑问,Java 是目前最为流行的编程语言之一,这里我们挖掘出了一些比较受欢迎的框架的有效信息,它们可以减轻全球软件开发人员的日常工作. RebelLabs的一项调查显示,通过在线Java用户论坛( ...

  4. Spring Batch 批处理框架介绍

    前言 在大型的企业应用中,或多或少都会存在大量的任务需要处理,如邮件批量通知所有将要过期的会员,日终更新订单信息等.而在批量处理任务的过程中,又需要注意很多细节,如任务异常.性能瓶颈等等.那么,使用一 ...

  5. 为什么选择 Spring 作为 Java 框架

    1. 概述 在本文中,我们将讨论 Spring 作为最流行的 Java 框架之一的主要价值体现. 最重要的是,我们将尝试理解 Spring 成为我们选择框架的原因.Spring 的详细信息及其组成部分 ...

  6. Spring的JDBC框架

    转自: http://www.cnblogs.com/windlaughing/p/3287750.html Spring JDBC提供了一套JDBC抽象框架,用于简化JDBC开发. Spring主要 ...

  7. 【Spring】Spring系列7之Spring整合MVC框架

    7.Spring整合MVC框架 7.1.web环境中使用Spring 7.2.整合MVC框架 目标:使用Spring管理MVC的Action.Controller 最佳实践参考:http://www. ...

  8. Struts2+Spring+Hibernate 三大框架的合并集成

    这次来看看Struts2+Spring+Hibernate三大框架的整合应用,主要是Spring和Hibernate框架的整合,因为前边已经将Strtus2+Spring整合过了基本一样.  首先看一 ...

  9. (文件)图片上传,Spring或SpringMVC框架

    spring或springMVC框架图片(文件)上传 页面部分,用一个简单的form表单提交文件,将图片或文件提交到服务端.一个输入框,用于输入图片的最终名称,一个file文件选择,用于选择图片. 页 ...

随机推荐

  1. C#编程,TreeView控件的学习

    新建一个WinForm项目之后,在窗体中放入一个treeView控件(treeView1),根据数据库数据填充建立树节点.数据库的结构如下: ID        Title        P_ID a ...

  2. [转]验证发生前无法调用 Page.IsValid。应在 CausesValidation=True 且已启动回发的控件

    在ASP.Net中,为了方便表单的验证,提供了验证控件来完成表单输入数据的验证.这些验证控件确实是功能强大,为写表单程序提供了极大的便利.但是,在不熟悉的情况下,经常碰到问题.其中,最常见的是遇到错误 ...

  3. springboot 源码笔记

    1.springAppication构造器 基于getSpringFactoriesInstances方法构造如下类(获取文件内容在META-INF/spring.factories文件中) 1.1 ...

  4. 用bind方法保持this上下文

    什么是this对象 先来说说什么是this对象吧.每一个函数在调用的时候都会自己主动获取两个特殊变量:this和arguments对象. this值详细是指哪个对象是和该函数的运行环境相关的.假设是作 ...

  5. 2017年10月21日 CSS常用样式&鼠标样式 以及 jQuery鼠标事件& jQuery图片轮播& jQuery图片自动轮播代码

    css代码 背景与前景 background-color:#0000; //背景色,样式表优先级高 background-image:url(路径); //设置背景图片 background-atta ...

  6. 规范大于编码-我的javaWeb开发规范

    1.应用名称和数据库名称一致 2.javaBean类名称+s和数据库表名一致 3.返回一条数据时,变量名为javaBean类名称的小写;返回多条数据时,变量名为javaBean类名称的大写 4.jav ...

  7. jquery 对象的 height、innerHeight、outerHeight 的区别以及DOM 元素的 clientHeight、offsetHeight、scrollHeight、offsetTop、scrollTop

    前言:jquery 对象的 height.innerHeight.outerHeight,还有 DOM 元素的 clientHeight.offsetHeight.scrollHeight.offse ...

  8. 洛谷P2973 [USACO10HOL]赶小猪(高斯消元 期望)

    题意 题目链接 Sol 设\(f[i]\)表示炸弹到达\(i\)这个点的概率,转移的时候考虑从哪个点转移而来 \(f[i] = \sum_{\frac{f(j) * (1 - \frac{p}{q}) ...

  9. Web缓存加速指南(转载)

    这是一篇知识性的文档,主要目的是为了让Web缓存相关概念更容易被开发者理解并应用于实际的应用环境中.为了简要起见,某些实现方面的细节被简化或省略了.如果你更关心细节实现则完全不必耐心看完本文,后面参考 ...

  10. C语言各类型大小,结构体大小 sizeof(struct A)

    C语言类型大小总览 编译器pack指令 #pragma pack(n)——定义n字节对齐 C++固有类型的对齐取编译器对齐与自身大小中较小的一个 32位C++默认8字节对齐.gcc编译器默认4字节对齐 ...