简体   繁体   English

CRUD Spring-Boot 与 ZK?

[英]CRUD Spring-Boot with ZK?

I want to make a web-based application using spring-boot with zk as backend and frontend, but I still haven't found a good tutorial.我想使用 spring-boot 以 zk 作为后端和前端来制作一个基于网络的应用程序,但我仍然没有找到好的教程。

Spring boot itself is a convention based framework to setup/configure an application(-server). Spring Boot 本身是一个基于约定的框架,用于设置/配置应用程序(-server)。 It has examples for many ways to load/store data, each with their own tutorials, so you have to at least choose the persistence technology most suitable for your scenario ... be it spring data, jdbc, restful or nosql or webservice based ... you name it.它有多种加载/存储数据的示例,每个示例都有自己的教程,因此您至少必须选择最适合您场景的持久化技术……无论是 spring 数据、jdbc、restful 还是 nosql 或基于 webservice 的。 ..你说出它的名字。 Then someone might be able to point you to a dedicated tutorial.然后有人可能会为您指出专门的教程。

From the ZK perspective all that doesn't really matter.从 ZK 的角度来看,所有这些都无关紧要。 Being a front end framework it doesn't make any persistence assumptions.作为前端框架,它不做任何持久性假设。 Ie you can load/save data from/to any source in your controller/viewmodel code (delegating to your spring-services / repositories).即,您可以从/向控制器/视图模型代码中的任何源加载/保存数据(委托给您的弹簧服务/存储库)。 Here an example project , demonstrating how a spring service can be wired and used inside MainViewModel .是一个示例项目,演示了如何在 MainViewModel 内部连接和使用 spring 服务。

Now it's up to you to decide and implement what the spring service will do, when its methods are called.现在由您来决定和实现 spring 服务在调用其方法时将执行的操作。 For your CRUD scenario you'll most likely need methods to create, read, update and delete your data objects.对于您的 CRUD 场景,您很可能需要创建、读取、更新和删除数据对象的方法。 Eg Spring data provides standard interfaces for that eg CrudRepository例如 Spring 数据提供了标准接口, 例如 CrudRepository

Before you decide to use spring-data you should definitely read and understand the common concepts first.在您决定使用spring-data之前,您一定要先阅读并理解常见概念。 After that the integration into spring-boot should feel less mystical (we've all been there), and you can pick the options you want, instead of a tutorial someone put together - most likely under different assumptions unsuitable to your situation.在那之后,集成到 spring-boot 应该感觉不那么神秘了(我们都去过那里),您可以选择您想要的选项,而不是某人放在一起的教程 - 很可能是在不适合您情况的不同假设下。

I suppose that you have fundamental skills in Java and in web development.我假设您具备 Java 和 web 开发方面的基本技能。 If you do, but you are starting with spring boot I recommend starting with spring boot by reading articles in baeldung.com and mkyong.com for specific things.如果你这样做,但你是从 spring 引导开始的,我建议你通过阅读 baeldung.com 和 mkyong.com 中的文章来从 spring 引导开始,了解具体的事情。

To get a general perspective of spring boot I recommend that you read the book "spring boot in action" by Craig Walls:要了解 spring 引导的一般情况,我建议您阅读 Craig Walls 撰写的“spring boot in action”一书:

在此处输入图像描述

You can purchase it online or find it in here .您可以在线购买或在此处找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM