Skip to content

Commit e3b3dd5

Browse files
author
58同城
committed
项目初始化
Argo是58.com内部项目wf的开源版本
0 parents  commit e3b3dd5

File tree

156 files changed

+21169
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+21169
-0
lines changed

LICENSE.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright Beijing 58 Information Technology Co.,Ltd.
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## 历史,动机(motivation)
2+
3+
Argo起源与[58同城]的内部web框架wf(web framework)。
4+
5+
目前wf支撑着[58同城]几乎所有的web站点,以及wap和手机端的访问,现在wf每天处理10亿级的pv。经过长时间的运作与运行,证明wf是一个可靠的、高效的web框架。
6+
7+
在2010年及以前,[58同城]的系统是基于Microsoft的.Net体系。在此之后,[58同城]技术架构逐步进行调整,技术体系逐步转向Open Source的解决方案,开发语言也调整为java。在迁移过程中,我们需要一个一站式的web开发体系,可以让开发人员可以聚焦在业务解决方案上,而不是项目的具体配置和架构。
8+
9+
spring mvc作为java下强大的web开发平台,但它不合适做于[58同城]公司级的框架。spring的哲学是开放集成,它几乎无所不能,给予程序员很大的想象空间,灵活的配置,形成每个程序员个性化的风格。
10+
11+
作为一个有一定规模的互联网企业,如果在变化的互联网环境中上线一个项目,在软件开发中需要在三方面进行平衡:
12+
13+
1. 组织/公司,在一个组织内部,需要每个项目开发尽量有统一的风格、架构,学习成本、维护成本等尽可能低;
14+
1. 运维,希望每个站点的配置和可执行部分分离,部署的方式相同;
15+
1. 项目内部,希望程序员聚焦在业务上,可以快速实现产品需求、响应产品变化。
16+
在此基础上,我们开发了wf。
17+
18+
Argo在wf做了大量优化和重构,以适应各组织软件开发的个性化需求,提升了系统性能,具有更好的可扩展性。Argo的开源反过来也促进wf2.0的开发。
19+
20+
**!!! Argo作为一个组织级的web开发框架,可能不太适合个人或者单个项目开发**
21+
22+
## 哲学观 (philosophy)
23+
1. [约定优于配置],减少软件开发人员需做决定的数量,获得简单的好处,而又不失灵活性。Argo体系中有且只有一个组织级约定,规定包的命名,配置文件路径,日志文件路径等。组织的约定是不容侵犯,每个项目在组织级约定下工作。组织级约定建议以jar形式下发给各项目。
24+
1. 简单,Argo可以不需要任何配置文件,项目代码结构简单,易于维护。
25+
1. 纪律,包和类的命名都受组织级约定的控制,任何违反约定的行为可能导致系统无法正常运行。
26+
27+
## 系统特点 (features)
28+
29+
1. SEO友好的URL结构,Argo天然支持RESTful的url结构,并能自动匹配合适的参数;
30+
1. 零配置,甚至你不要web.xml就能在tomcat上运行;
31+
1. 插拔式组件架构,可以灵活扩张功能;
32+
1. 高安全性,提供集群模式下,避免ip欺骗等功能。
33+
34+
## 系统约定 (convention)
35+
36+
Argo不是一个通用的web框架,一个问题解决方案可能有很多,但在Argo中只提供一种解决方案。Argo在以下约定中工作:
37+
38+
1. servlet 3.0环境,主要针对Tomcat 7.x;
39+
1. 基于[guice]的Ioc,组织和项目可以各提供一个module注入模块,而且module的命名必须符合约定;
40+
1. maven依赖,项目的代码体系和maven默认代码体系一致,maven以插件提供开发过程中所需要的开发运行环境([jetty:run][tomcat7:run])。
41+
42+
## Hello World
43+
44+
请参考例子 hello-world
45+
46+
## 进阶
47+
48+
TODO
49+
50+
## 如何实现 (how)
51+
52+
TODO
53+
54+
[58同城]: http://www.58.com/
55+
[约定优于配置]: http://zh.wikipedia.org/wiki/%E7%BA%A6%E5%AE%9A%E4%BC%98%E4%BA%8E%E9%85%8D%E7%BD%AE
56+
[guice]: http://code.google.com/p/google-guice/
57+
[jetty:run]: http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
58+
[tomcat7:run]: http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/run-mojo.html
59+

core/pom.xml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.bj58.spat</groupId>
5+
<artifactId>argo</artifactId>
6+
<version>1.0.0</version>
7+
<name>58.com argo</name>
8+
<description>58.com argo</description>
9+
<url>https://github.com/58code/Argo</url>
10+
11+
<organization>
12+
<name>58.com</name>
13+
<url>http://www.58.com/</url>
14+
</organization>
15+
16+
<licenses>
17+
<license>
18+
<name>The Apache Software License, Version 2.0</name>
19+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
20+
<distribution>repo</distribution>
21+
</license>
22+
</licenses>
23+
24+
<developers>
25+
<developer>
26+
<id>SPAT</id>
27+
<name>Service Platform Architecture Team</name>
28+
<url>https://github.com/58code</url>
29+
<email>spat@58.com</email>
30+
</developer>
31+
32+
<developer>
33+
<id>renjun</id>
34+
<name>renjun</name>
35+
<url>http://weibo.com/duoway</url>
36+
<email>rjun@outlook.com</email>
37+
</developer>
38+
39+
<developer>
40+
<id>liuzw</id>
41+
<name> liu zhongwei</name>
42+
<email>liuzw@58.com</email>
43+
</developer>
44+
</developers>
45+
46+
<scm>
47+
<connection>scm:git:git://github.com/58code/Argo</connection>
48+
<developerConnection>scm:git:git://github.com/58code/Argo</developerConnection>
49+
<url>https://github.com/58code/Argo</url>
50+
</scm>
51+
52+
<dependencies>
53+
54+
<dependency>
55+
<groupId>com.google.guava</groupId>
56+
<artifactId>guava</artifactId>
57+
<version>13.0.1</version>
58+
</dependency>
59+
60+
<dependency>
61+
<groupId>com.google.inject</groupId>
62+
<artifactId>guice</artifactId>
63+
<version>3.0</version>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>org.javassist</groupId>
68+
<artifactId>javassist</artifactId>
69+
<version>3.17.1-GA</version>
70+
</dependency>
71+
72+
<dependency>
73+
<groupId>org.apache.velocity</groupId>
74+
<artifactId>velocity</artifactId>
75+
<version>1.7</version>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>org.slf4j</groupId>
80+
<artifactId>slf4j-api</artifactId>
81+
<version>1.7.2</version>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>org.slf4j</groupId>
86+
<artifactId>slf4j-log4j12</artifactId>
87+
<version>1.7.2</version>
88+
</dependency>
89+
90+
<dependency>
91+
<groupId>log4j</groupId>
92+
<artifactId>log4j</artifactId>
93+
<version>1.2.16</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>javax.servlet</groupId>
98+
<artifactId>javax.servlet-api</artifactId>
99+
<scope>provided</scope>
100+
<version>3.0.1</version>
101+
</dependency>
102+
103+
<dependency>
104+
<groupId>org.testng</groupId>
105+
<artifactId>testng</artifactId>
106+
<version>6.8</version>
107+
<scope>test</scope>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.mockito</groupId>
112+
<artifactId>mockito-all</artifactId>
113+
<version>1.9.5</version>
114+
<scope>test</scope>
115+
</dependency>
116+
117+
</dependencies>
118+
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<artifactId>maven-source-plugin</artifactId>
123+
<version>2.1</version>
124+
<configuration>
125+
<attach>true</attach>
126+
</configuration>
127+
<executions>
128+
<execution>
129+
<phase>compile</phase>
130+
<goals>
131+
<goal>jar</goal>
132+
</goals>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
<plugin>
137+
<groupId>org.apache.maven.plugins</groupId>
138+
<artifactId>maven-compiler-plugin</artifactId>
139+
<version>2.5.1</version>
140+
<configuration>
141+
<source>1.6</source>
142+
<target>1.6</target>
143+
<encoding>UTF-8</encoding>
144+
</configuration>
145+
</plugin>
146+
147+
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-surefire-plugin</artifactId>
151+
<version>2.13</version>
152+
</plugin>
153+
154+
</plugins>
155+
</build>
156+
157+
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.bj58.argo;
2+
3+
/**
4+
* 所有Action的返回结果
5+
*
6+
*/
7+
public interface ActionResult {
8+
9+
public final static ActionResult NULL = null;
10+
11+
/**
12+
* 用于生成显示页面
13+
*
14+
* @param beatContext 需要渲染的上下文
15+
*/
16+
void render(BeatContext beatContext);
17+
}

0 commit comments

Comments
 (0)