如何基于「盘古开发框架」开发垂直分层单体应用

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

背景

软件架构的本质是一种在特定资源背景下折中平衡后追求业务增长的一门艺术。虽然盘古框架的标准姿势是分布式微服务开发,但决定技术开发架构选型的因素很多,单体应用依旧有很多应用场景。因此,盘古框架不会绑定用户到一个固定的开发范式和架构上,而是支持随意组合、自动装配、灵活插拔。 既能构建大并发高可用的分布式微服务架构也能搭建小巧的垂直单体分层架构。

安装相关盘古模块

<!-- 盘古 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);
	}
}

本文相关范例源码

下一步

继续阅读其它章节获取你想要的答案或通过我们的 开发者社区 寻求更多帮助。

参考文献

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值