All Projects → alibaba → Cola

alibaba / Cola

Licence: lgpl-2.1
🥤 COLA: Clean Object-oriented & Layered Architecture

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Cola

Transport Eta
Twitch streamed 🎥playground repo, README speaks to you.
Stars: ✭ 223 (-96.4%)
Mutual labels:  clean, architecture
Go Restful Api
An idiomatic Go REST API starter kit (boilerplate) following SOLID principles and Clean Architecture
Stars: ✭ 1,043 (-83.14%)
Mutual labels:  clean, architecture
Rx.observe
Transform any method to an Rx Observable ! (VIPER)
Stars: ✭ 34 (-99.45%)
Mutual labels:  clean, architecture
Clean Architecture Zh
《架构整洁之道》中文翻译
Stars: ✭ 299 (-95.17%)
Mutual labels:  clean, architecture
React Redux Complete Example
A react+redux example project based on the folder structure proposed here: https://github.com/alexnm/re-ducks
Stars: ✭ 415 (-93.29%)
Mutual labels:  architecture
Web Skills
A visual overview of useful skills to learn as a web developer
Stars: ✭ 5,107 (-17.44%)
Mutual labels:  architecture
Explicit Architecture Php
This repository is a demo of Explicit Architecture, using the Symfony Demo Application.
Stars: ✭ 372 (-93.99%)
Mutual labels:  architecture
Scriptableobject Architecture
Makes using Scriptable Objects as a fundamental part of your architecture in Unity super easy
Stars: ✭ 370 (-94.02%)
Mutual labels:  architecture
Dephpend
Detect flaws in your architecture, before they drag you down into the depths of dependency hell ...
Stars: ✭ 449 (-92.74%)
Mutual labels:  architecture
Neovim Init.vim
🏮 The perfect Neovim configuration for productive people who wants to level up their Vim experience with a clean, minimal-looking aesthetic, as well as a highly extensible, easily customizable set of popular tools and shortcuts to boost productivity. 🏮
Stars: ✭ 440 (-92.89%)
Mutual labels:  clean
Phpinsights
🔰 Instant PHP quality checks from your console
Stars: ✭ 4,442 (-28.19%)
Mutual labels:  architecture
Architecture.of.internet Product
互联网公司技术架构,微信/淘宝/微博/腾讯/阿里/美团点评/百度/Google/Facebook/Amazon/eBay的架构,欢迎PR补充
Stars: ✭ 18,661 (+201.67%)
Mutual labels:  architecture
Onecloud
An open-source unified multi-cloud platform -- MOS 3.0
Stars: ✭ 417 (-93.26%)
Mutual labels:  architecture
Ppt
PPT I collected
Stars: ✭ 380 (-93.86%)
Mutual labels:  architecture
Awesome Ios Architecture
🏯 Better ways to structure iOS apps
Stars: ✭ 4,451 (-28.05%)
Mutual labels:  architecture
Laravel
[DEPRECATED] See https://github.com/lucidarch/lucid
Stars: ✭ 373 (-93.97%)
Mutual labels:  architecture
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (-93.37%)
Mutual labels:  architecture
Go Cleanarch
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Stars: ✭ 434 (-92.98%)
Mutual labels:  architecture
Peasy.net
A business logic micro-framework for .NET and .NET Core
Stars: ✭ 406 (-93.44%)
Mutual labels:  architecture
Habitat
Sitecore Modular Architecture Example
Stars: ✭ 407 (-93.42%)
Mutual labels:  architecture

🥤 COLA 4.0

Build Status Maven Central GitHub release JDK support
License GitHub Stars GitHub Forks GitHub issues

COLA 是 Clean Object-Oriented and Layered Architecture的缩写,代表“整洁面向对象分层架构”。 目前COLA已经发展到COLA 4.0

COLA分为两个部分,COLA架构和COLA组件。

COLA架构

COLA 概述

架构意义 就是 要素结构:

  • 要素 是 组成架构的重要元素;
  • 结构 是 要素之间的关系。

应用架构意义 就在于

  • 定义一套良好的结构;
  • 治理应用复杂度,降低系统熵值;
  • 从随心所欲的混乱状态,走向井井有条的有序状态。

archWhy

COLA架构就是为此而生,其核心职责就是定义良好的应用结构,提供最佳应用架构的最佳实践。通过不断探索,我们发现良好的分层结构,良好的包结构定义,可以帮助我们治理混乱不堪的业务应用系统。

cure

经过多次迭代,我们定义出了相对稳定、可靠的应用架构:COLA 4.0

cola

COLA Archetype

好的应用架构,都遵循一些共同模式,不管是六边形架构、洋葱圈架构、整洁架构、还是COLA架构,都提倡以业务为核心,解耦外部依赖,分离业务复杂度和技术复杂度等

COLA架构区别于这些架构的地方,在于除了思想之外,我们还提供了可落地的工具和实践指导。

为了能够快速创建满足COLA架构的应用,我们提供了两个archetype,位于cola-archetypes目录下:

  1. cola-archetype-service:用来创建纯后端服务的archetype
  2. cola-archetype-web:用来创建adapter和后端服务一体的web应用archetype

COLA Components

此外,我们还提供了一些非常有用的通用组件,这些组件可以帮助我们提升研发效率。

这些功能组件被收拢在cola-components目录下面。到目前为止,我们已经沉淀了以下组件:

组件名称 功能 版本 依赖
cola-component-dto 定义了DTO格式,包括分页 1.0.0
cola-component-exception 定义了异常格式,
主要有BizExceptionSysException
1.0.0
cola-component-statemachine 状态机组件 1.0.0
cola-component-domain-starter Spring托管的领域实体组件 1.0.0
cola-component-catchlog-starter 异常处理和日志组件 1.0.0 exception
dto组件
cola-component-extension-starter 扩展点组件 1.0.0
cola-component-test-container 测试容器组件 1.0.0

如何使用COLA

1. 创建应用

执行以下命令:

mvn archetype:generate  \
    -DgroupId=com.alibaba.cola.demo.web \
    -DartifactId=demo-web \
    -Dversion=1.0.0-SNAPSHOT \
    -Dpackage=com.alibaba.demo \
    -DarchetypeArtifactId=cola-framework-archetype-web \
    -DarchetypeGroupId=com.alibaba.cola \
    -DarchetypeVersion=4.0.1

命令执行成功的话,会看到如下的应用代码结构:

demo

注:也可以使用阿里云的应用生成器:https://start.aliyun.com/bootstrap.html 生成cola应用。

2. 运行应用

  • 项目目录下运行mvn install(如果不想运行测试,可以加上-DskipTests参数)。
  • 进入start目录,执行mvn spring-boot:run
    运行成功的话,可以看到SpringBoot启动成功的界面。
  • 生成的应用中,已经实现了一个简单的Rest请求,可以在浏览器中输入 http://localhost:8080/helloworld 进行测试。

如果要生成不是web工程而是service工程也类似,执行的是下面的命令:

mvn archetype:generate  \
    -DgroupId=com.alibaba.cola.demo.service \
    -DartifactId=demo-service \
    -Dversion=1.0.0-SNAPSHOT \
    -Dpackage=com.alibaba.demo \
    -DarchetypeArtifactId=cola-framework-archetype-service \
    -DarchetypeGroupId=com.alibaba.cola \
    -DarchetypeVersion=4.0.1

版本迭代

4.0.0 版本

https://blog.csdn.net/significantfrank/article/details/110934799

3.1.0 版本

https://blog.csdn.net/significantfrank/article/details/109529311

  1. 进一步简化了cola-core,只保留了扩展能力。
  2. exceptioncola-core移入到cola-common
  3. archetype中的分包逻辑进行重构,改成按照domain做划分。
  4. cola-archetype-web中的controller改名为adapter,为了呼应六边形架构的命名。

3.0.0 版本

https://blog.csdn.net/significantfrank/article/details/106976804

2.0.0 版本

https://blog.csdn.net/significantfrank/article/details/100074716

1.0.0 版本

https://blog.csdn.net/significantfrank/article/details/85785565

关于COLA的更多信息,请关注微信公众号:

qrcode_60.jpg

如果你有技术热情,对阿里有兴趣,可以email:[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].