forked from imooc-lego/students-learn-task
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request imooc-lego#175 from anfenzeCode/main
添加架构师第一周笔记
- Loading branch information
Showing
6 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
# 第一周架构师作业 | ||
## 学习目标 | ||
* 成功是一个replay的一个过程. | ||
* Success is no accident,It’s inevitable。 | ||
* Thank you now,Let’s go!!! | ||
## 关键词 | ||
|
||
流程图-分析需求工具 | ||
|
||
需要注意培养,全局思维、整体思维、闭环思维-架构师思维来分析需求 | ||
|
||
业务组件库-独立拆分出来,复用 | ||
|
||
自定义事件同一业务的重要性。如何实现 | ||
|
||
## 学习方法 | ||
|
||
要有耐心不要一心想着写代码,觉的需求和设计不重要 | ||
|
||
抛开你固有的程序员思维,开始准备接受架构师思维 | ||
|
||
要坚信:技术永远都是为业务服务的,技术是实现业务增长的工具 | ||
|
||
## 注意事项 | ||
|
||
不要关注细节,要看整体,看范围 | ||
|
||
设计时判断可行性,不确定性的就研究一下(这里需要大量的工作经验积累,技术能力) | ||
|
||
设计要考虑复杂度,越简单越好,不要过度设计,不要为了设计而设计 | ||
## 需求 | ||
需求既业务,技术服务业务。 | ||
[需求地址](https://www.yuque.com/imooc-lego/zlz87z) | ||
需求设计 | ||
|
||
脱离业务的架构就是耍流氓。架构师必须要深入理解需求、参与需求、看透需求背后的业务本质 | ||
|
||
## 主要产出 | ||
|
||
熟悉产品需求 | ||
|
||
学会架构师的思维分析需求 | ||
|
||
全局思维、整体思维、闭环思维 | ||
|
||
## 主要内容 | ||
|
||
如何以架构四思维去分析需求 | ||
|
||
项目浅层需求 | ||
|
||
项目深度需求 | ||
|
||
需求总览 | ||
|
||
## 注意事项 | ||
|
||
对待需求要有耐心,不要一心只想写代码 | ||
|
||
技术永远为业务服务,分清甲方乙方 | ||
|
||
需求即业务,无业务不架构,坚信 | ||
|
||
## 大转盘抽奖需求技术分析 | ||
![](./images/luckDraw.png) | ||
``` | ||
抽奖数据接口 | ||
luckDraw/activity?id=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjMxMjMxMjMiLCJpYXQiOiIyMDIxLTA2LTA5IDAwOjAwOjAwIiwiZXhwIjoiMjAyMS0wNi0yOSAwMDowMDowMCJ9.Y0CP4vile87vYWRZ__Ye-CAWJQHU6SDD7GBEDlBBk6Q | ||
data:{ | ||
code:1, //1成功 2失败 3网络请求过于频繁 | ||
luckDrawNumber:2, // 0次代表没有,以此类推 | ||
prescription:1, //1进行中 2已结束 | ||
msg:'请求成功' | ||
list:[ | ||
{ | ||
id:0520, | ||
title:'一等奖‘ | ||
icon:'www.xxx.png', | ||
}, | ||
{ | ||
id:89076, | ||
title:'二等奖‘ | ||
icon:'www.xxx.png', | ||
}.... | ||
] | ||
} | ||
抽奖接口 | ||
luckDraw/prize?id=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjMxMjMxMjMiLCJpYXQiOiIyMDIxLTA2LTA5IDAwOjAwOjAwIiwiZXhwIjoiMjAyMS0wNi0yOSAwMDowMDowMCJ9.Y0CP4vile87vYWRZ__Ye-CAWJQHU6SDD7GBEDlBBk6Q | ||
data:{ | ||
code:1, //1成功 2失败 3网络请求过于频繁 | ||
luckDrawNumber:1, // 0次代表没有,以此类推 | ||
prescription:1, //1进行中 2已结束 | ||
msg:'请求成功' | ||
prizeObj:{ //符合抽奖所有规程,返回中奖信息,否则null | ||
id: 0520, | ||
title:'一等奖‘ | ||
icon:'www.xxx.png', | ||
}, | ||
prizeMsg:'恭喜您,获得一等奖,您还有一次抽奖机会', | ||
} | ||
``` | ||
## 模块设计 | ||
![](./images/modular.png) | ||
|
||
## 数据结构形式 | ||
* node解构,不是规范的vnode形式 | ||
* computed计算索引 | ||
* vuex存储同步数据 | ||
* 根据图层关系对数据进行存储 | ||
## 数据结构示例 | ||
``` | ||
{ | ||
data: { | ||
title: '小min123', //标题 | ||
setting: {}, // 设置 | ||
props: {}, // 扩展设置 | ||
components: [ | ||
{ | ||
id: '8977', //数据id | ||
name: '文本1', //name | ||
tag: 'text', // 标识符 | ||
attrs: { // 样式解构 | ||
fontSize: '20px' | ||
}, | ||
children: ['文本1'] // 子级数据 | ||
}, | ||
{ | ||
id: '0089', | ||
name: '图片小mao', | ||
tag: 'image', | ||
attrs: { | ||
src: 'xxx.png', | ||
width: '130px' | ||
}, | ||
children: null | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
## 数据流转 | ||
![](./images/data.png) | ||
|
||
#### 核心 : B端、C端、管理后台,共用一个数据库 | ||
* 创建作品: 初始化一个 JSON 数据 | ||
* 保存作品: 修改 JSON 数据 | ||
* 发布作品: 修改一个标记 | ||
* C端浏览作品: 获取 JSON 数据, SSR渲染页面 | ||
* 屏蔽作品: 修改一个标记, C端来判断 | ||
|
||
|
||
|
||
## 第一周项目作业问题总结与归纳 | ||
![](./images/task.png) | ||
* 架构师Markdown地址:homework.imooc-lego.com(备注:向下滚动你会看到forl源码地址)文章中会有如何使用的架构师Markdown方法以及注意事项 | ||
* 报错原因是因为node升级以后gitbook报错,其实你会在polyfills.js的看到俩行注释 | ||
|
||
``` | ||
function statFix(){ | ||
// Older versions of Node erroneously returned signed integers for | ||
// uid + gid. | ||
......... | ||
} | ||
``` | ||
* 当然还有其他方法,仅供参考 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 逐月之月 | ||
你好,我是在慕课学习的逐月之月,很高心遇到你。 | ||
你有木有种感觉,在接手 '祖传' 代码的时候各种头疼,拿到项目打开 README.md 空空如也,'悲伤的到来我从不拒绝 反正亦是空空空空如也...' | ||
连最起码项目框架整体设计思路(以及项目介绍),都没有。修改样式还好,修改逻辑就难受了。 | ||
|
||
解:我个人认为,不论做架构师的前提 or 做技术提升,先需要做好提升的心态。不能动不动就:那东西有啥用 这东西我会 不就是那样。 | ||
## 技术的成长,往往堆叠在有耐心的失败中 | ||
由此可得,成功是一次必然事件。没有成功只能说明失败的次数不够,不能说明你没有努力 | ||
|
||
# 划重点了 | ||
《逐月之月》项目是一个架构师Markdown,该项目中在未来会若干个文件,其中 README.md 只会有一个,我会在后期的学习当中跟新. | ||
01-第xx周架构师作业.md 或 01-第xx周架构师xx.md 这类似这些文件,主要是记录我在学习当中所做的作业或者是笔记,还有可能会 | ||
记录在学习当中遇到诸多问题。imgaes中会存放一些我流程图或者是思维导图等 | ||
|
||
青春须早为,岂能长少年。 | ||
|
||
盛年不重来,一日难再晨。 | ||
及时当勉励,岁月不待人 | ||
|
||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.