Skip to content

Commit

Permalink
resolve merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fulan.zjf committed Jan 13, 2019
2 parents fbebaed + 31ab2ec commit eaff739
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 28 deletions.
504 changes: 504 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#
> COLA是Clean Object-Oriented and Layered Architecture的缩写,代表“整洁面向对象分层架构”,也叫“可乐”架构。
![image.png](http://ata2-img.cn-hangzhou.img-pub.aliyun-inc.com/9e7048ef11db23b0579a439676dec4c9.png)

# COLA架构
关于架构和设计的详细内容,请查看:https://www.atatech.org/articles/96063
<strong>COLA是Clean Object-Oriented and Layered Architecture的缩写,代表“整洁面向对象分层架构”,也叫“可乐”架构。</strong>
>注意本架构曾用名SOFA、COPA,以后统一使用COLA这个新名称,带来不便,表示抱歉
更多关于COLA架构的信息:
- COLA架构的设计思想和原理:[请点击](https://blog.csdn.net/significantfrank/article/details/85785565)
- 领域建模的方法论:[请点击](http://blog.csdn.net/significantfrank/article/details/79614915)

需要进一步交流的,可以微信咨询: josico-nie

# 项目说明
COLA框架包括两个Project,一个是cola-framework里面是框架的核心代码,另一个是cola-archetype是用来生成新应用的Maven Archetype源码。
Expand Down Expand Up @@ -39,8 +43,8 @@ com
该Module主要是提供一些开发测试的工具,可以使用TDD来进行开发。

## cola-archetype Project
该Project下面是Archetype的源码,先执行`mvn install`然后就可以用下面的命令来创建新应用了
该Project下面是Archetype的源码,先执行`mvn install`然后就可以用下面的命令来创建新应用
```
mvn archetype:generate -DgroupId=com.alibaba.demo -DartifactId=sample -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.demo -DarchetypeArtifactId=cola-framework-archetype -DarchetypeGroupId=com.alibaba.cola -DarchetypeVersion=1.0.0-SNAPSHOT
mvn archetype:generate -DgroupId=com.alibaba.sample -DartifactId=demo -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.sample -DarchetypeArtifactId=cola-framework-archetype -DarchetypeGroupId=com.alibaba.cola -DarchetypeVersion=1.0.0-SNAPSHOT
```
生成的应用主要包括demo-app, demo-domain, demo-tunnel, demo-config, demo-client和Start五个Module,分别代表不同层次(layer)和用途。
生成的应用主要包括demo-app, demo-domain, demo-infrastructure, demo-client和Start五个Module,分别代表不同层次(layer)和用途。
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
import com.alibaba.cola.dto.Command;
import com.alibaba.cola.exception.ColaException;
import com.google.common.collect.Iterables;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;


/**
* CommandRegister
*
Expand All @@ -34,6 +32,7 @@
public class CommandRegister implements RegisterI {

@Autowired

private CommandHub commandHub;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import com.alibaba.cola.dto.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
* Just send Command to CommandBus,
*
* @author fulan.zjf 2017年10月24日 上午12:47:18
*/
@Component
public class CommandBus implements CommandBusI{

@Autowired
private CommandHub commandHub;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.alibaba.cola.dto.Command;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.exception.ColaException;
import com.alibaba.cola.exception.DefaultExceptionHandler;
import com.alibaba.cola.exception.ExceptionHandlerFactory;
import com.alibaba.cola.exception.ExceptionHandlerI;
import com.alibaba.cola.logger.Logger;
import com.alibaba.cola.logger.LoggerFactory;
import com.google.common.collect.FluentIterable;
Expand All @@ -17,6 +14,7 @@

import java.util.List;


@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class CommandInvocation{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
*/
public enum BasicErrorCode implements ErrorCodeI{

/**
* Parameter Exception
*
* You can extend it by implementing ErrorCodeI in your Application
* For example:
*
* P_CUSTOMER_NameIsNull("P_CUSTOMER_NameIsNull","客户姓名不能为空")
*/
P_COMMON_ERROR("P_COMMON_ERROR" , "通用的参数校验错误"),

/**
* Business Exception
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void handleException(Command cmd, Response response, Exception exception)

private void printLog(Command cmd, Response response, Exception exception) {
if(exception instanceof BizException || exception instanceof ParamException){
//biz exception is expected, only warn it, 2 git remote test
//biz exception is expected, only warn it
logger.warn(buildErrorMsg(cmd, response));
}
else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import com.alibaba.cola.test.customer.validator.extensionpoint.AddCustomerValidatorExtPt;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.function.Function;

/**
* AddCustomerCmdExe
*
Expand Down

0 comments on commit eaff739

Please sign in to comment.