目录
一、(回顾Spring)Spring是如何简化Java开发的
⭐自定义banner (Spring Boot自定义启动Banner在线生成工具)


Spring是为了解决企业级应用开发的复杂性而创建的,简化开发。
为了降低Java开发的复杂性,Spring采用了以下4种关键策略:
Spring框架最初是没有打算构建一个自己的WebMVC框架,其开发人员在开发过程中认为现有的StrutsWeb框架的呈现层和请求处理层之间以及请求处理层和模型之间的分离不够,于是创建了SpringMVC。

微服务(或微服务架构)是一种云原生架构方法,是一种架构风格,其中单个应用程序由许多松散耦合且可独立部署的较小组件或服务组成。
维基上对其定义为:一种软件开发技术- 面向服务的体系结构(SOA)架构样式的一种变体,它提倡将单一应用程序划分成一组小的服务,服务之间互相协调、互相配合,为用户提供最终价值。每个服务运行在其独立的进程中,服务与服务间采用轻量级的通信机制互相沟通(通常是基于HTTP的RESTful API)。每个服务都围绕着具体业务进行构建,并且能够独立地部署到生产环境、类生产环境等。另外,应尽量避免统一的、集中式的服务管理机制,对具体的一个服务而言,应根据上下文,选择合适的语言、工具对其进行构建。
有自己的堆栈,包括数据库和数据模型;
通过REST API,事件流和消息代理的组合相互通信;
它们是按业务能力组织的,分隔服务的线通常称为有界上下文。


pom.xml分析
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0modelVersion>
-
- <parent>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-parentartifactId>
- <version>2.7.3version>
- <relativePath/>
- parent>
- <groupId>com.zzgroupId>
- <artifactId>helloworldartifactId>
- <version>0.0.1-SNAPSHOTversion>
- <name>helloworldname>
- <description>helloworlddescription>
- <properties>
- <java.version>1.8java.version>
- properties>
- <dependencies>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
-
-
-
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-testartifactId>
- <scope>testscope>
- dependency>
- dependencies>
-
- <build>
-
- <plugins>
- <plugin>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-maven-pluginartifactId>
- plugin>
- plugins>
- build>
-
- project>
在主程序的同级目录下,新建一个controller包,一定要在同级目录下,否则识别不到
- package com.zz.helloworld;
-
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- //程序的主入口
- //本身就是一个程序的组件
- @SpringBootApplication
- public class HelloworldApplication {
-
- public static void main(String[] args) {
- //SpringApplication
- SpringApplication.run(HelloworldApplication.class, args);
- }
- }
- //自动装配
- @Controller
- @RequestMapping("/hello")
- public class HelloController {
- //接口: http://localhost:8080/hello
- @GetMapping("/hello")
- @ResponseBody
- public String hello(){
- //调用业务,接受前端的参数
- return "hello,world";
- }
- }
运行结果


Spring Boot banner在线生成工具,制作下载banner.txt,修改替换banner.txt文字实现自定义,个性化启动banner-bootschool.net
