关于java:如何基于盘古开发框架开发垂直分层单体应用

12次阅读

共计 1149 个字符,预计需要花费 3 分钟才能阅读完成。

本文介绍如何基于盘古开发框架开发一个单体分层架构的利用。文中所述仅为搭建一个单体利用的根本框架,减少 配置核心、数据长久化、缓存等能力 请参考 开发指南 的相干章节。

背景

软件架构的实质是一种在特定资源背景下折中均衡后谋求业务增长的一门艺术。尽管盘古框架的规范姿态是散布式微服务开发,但决定技术开发架构选型的因素很多,单体利用仍旧有很多利用场景。因而,盘古框架不会绑定用户到一个固定的开发范式和架构上,而是反对随便组合、主动拆卸、灵便插拔。既能构建大并发高可用的散布式微服务架构也能搭建玲珑的垂直单体分层架构。

装置相干盘古模块

<!-- 盘古 Parent -->
<parent>
    <groupId>com.gitee.pulanos.pangu</groupId>
    <artifactId>pangu-parent</artifactId>
    <version>latest.version.xxx</version>
    <relativePath/>
</parent>
<!-- 根底模块 -->
<dependency>
    <groupId>com.gitee.pulanos.pangu</groupId>
    <artifactId>pangu-spring-boot-starter</artifactId>
</dependency>
<!-- Web 模块 -->
<dependency>
    <groupId>com.gitee.pulanos.pangu</groupId>
    <artifactId>pangu-web-spring-boot-starter</artifactId>
</dependency>

本地配置

为便于了解,本文基于本地配置的形式编写。若改为规范的 Nacos 配置核心模式,请参阅:配置核心 章节。

spring.application.name=pangu-examples-empty-web
spring.jackson.time-zone=GMT+8

logging.level.root=INFO
logging.level.com.gitee.pulanos.pangu=INFO

启动入口

@SpringBootApplication
public class EmptyWebPanguApplication {public static void main(String[] args) {PanGuApplicationBuilder.init(EmptyWebPanguApplication.class).run(args);
    }
}

本文相干范例源码

  • pangu-examples-empty-web:单体分层 Web 利用范例

下一步

持续浏览其它章节获取你想要的答案或通过咱们的 开发者社区 寻求更多帮忙。

参考文献

  • 开发架构模式比照
  • 如何开发单体利用

正文完
 0