-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
2260 lines (761 loc) · 67.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="theme-next muse use-motion" lang="zh">
<head><meta name="generator" content="Hexo 3.9.0">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">
<link href="/css/main.css?v=6.3.0" rel="stylesheet" type="text/css">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.3.0">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.3.0">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.3.0">
<link rel="mask-icon" href="/images/logo.svg?v=6.3.0" color="#222">
<script type="text/javascript" id="hexo.configurations">
var NexT = window.NexT || {};
var CONFIG = {
root: '/',
scheme: 'Muse',
version: '6.3.0',
sidebar: {"position":"left","display":"hide","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
fancybox: false,
fastclick: false,
lazyload: false,
tabs: true,
motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
algolia: {
applicationID: '',
apiKey: '',
indexName: '',
hits: {"per_page":10},
labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
}
};
</script>
<meta property="og:type" content="website">
<meta property="og:title" content="LuMing's blog">
<meta property="og:url" content="http://LuuMing.github.io/index.html">
<meta property="og:site_name" content="LuMing's blog">
<meta property="og:locale" content="zh">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="LuMing's blog">
<link rel="canonical" href="http://LuuMing.github.io/">
<script type="text/javascript" id="page.configurations">
CONFIG.page = {
sidebar: "",
};
</script>
<title>LuMing's blog</title>
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?4becdc28b5402c3ae70e696799455f76";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<noscript>
<style type="text/css">
.use-motion .motion-element,
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-title { opacity: initial; }
.use-motion .logo,
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion {
.logo-line-before i { left: initial; }
.logo-line-after i { right: initial; }
}
</style>
</noscript>
<link rel="stylesheet" href="/css/prism.css" type="text/css"></head>
<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh">
<div class="container sidebar-position-left
page-home">
<div class="headband"></div>
<header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-wrapper">
<div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">LuMing's blog</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
</div>
<div class="site-nav-toggle">
<button aria-label="Toggle navigation bar">
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home menu-item-active">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br>Home</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags/" rel="section">
<i class="menu-item-icon fa fa-fw fa-tags"></i> <br>Tags</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section">
<i class="menu-item-icon fa fa-fw fa-archive"></i> <br>Archives</a>
</li>
</ul>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<section id="posts" class="posts-expand">
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="http://LuuMing.github.io/2020/01/01/My2019/">
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="LuMing">
<meta itemprop="description" content="">
<meta itemprop="image" content="/images/avatar.gif">
</span>
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="LuMing's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2020/01/01/My2019/" itemprop="url">
我的 2019
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2020-01-01 20:59:10 / Modified: 21:15:51" itemprop="dateCreated datePublished" datetime="2020-01-01T20:59:10+08:00">2020-01-01</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>首先头等大事是从一名学生成为了工程师。仿佛如做梦一般,昨天还在学校里念书,今天就作起了影响数百万用户的事情。不可思议。</p>
<p>7月份开始就忙个不停,在潜意识里似乎是自找的,又或是说找上门来,潜意识把他当成自找的,一时半会儿也说不清楚。不过总比没事干强,我一般不太喜欢非得给自己做的事情找一个意义,比如为了梦想为了社会什么的,更喜欢接受的说法是我这么做是我的选择,因为选择,所以发生改变,因为存在,所以进行了选择。</p>
<p>人是没办法什么都不干,什么都不想,什么都不做的,除非是在梦里,那才是真正的精神自由。从一觉醒来开始就得开始做事,发呆的时候是越来越少了。</p>
<p>工作总会给人带来成就感,让人在一段时间内全身心投入的感觉真的非常棒。但有时候也有一些虚无感,脑子里会问自己,我做的这些东西真的真的对别人很重要吗?我做的东西这些功能真的是有用的吗?这些问题的答案只能在以后的工作道路上去寻找了。<br>在翻回日记的时候,看到了年初给自己定的目标:<br>“内心强悍的人,这个人做事有计划,偶尔偷懒但紧盯目标不妥协”。“温柔的人,这个人待人温和,从不轻易生气,能把握好与他人之间的距离,不谄媚也不怠慢”。“靠谱的人,这个人做事有着落,有时候不见得做的最好但从来不会不了了之”。</p>
<p>在年终时候看了让人感动,虽然这一年里几乎对它没什么印象,不过这几个目标似乎在潜意识里起了不少作用,比如我真的”躬身入局”到了一些事情里,并且有了着落。这段话还没背熟,明年的目标依旧是它(不是偷懒)。</p>
<p>年初时定下的翻译目标全部完成了,但读书计划没有全部完成,是因为有几本书太难找了(借口),看来每年读两三本就差不多了。</p>
<p>今年一个比较高光的时刻是给”成为什么样的人”这个问题了一个答案。成为一名行业精英?成为一方面领域的专家?成为一个外向活泼的社交达人?不,那些都是别人,人是无法成为别人的,人只能成为自己。所谓千人千面,但其实一人便有千面,我选择自己最真实的那一面。</p>
<p>明年”课余时光”,安卓,电影,电子书。每天跑步,按时睡觉,抽空背单词。仿佛以往的激情化作了星星点点前进的动力,我想要的是孤独但不寂寞,平凡而不平庸。</p>
<p>这不一定是一年发生的所有事情,但以上的话却是我在一年结束之际的真实想法。回看2019,充满变化的一年,各阶段有各阶段的烦恼,前路如何并不知道,小步向前迈,堕落与重燃往复,失落与希望并存,整体向前跨进,2020,加油!</p>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=33316436&auto=0&height=66"></iframe>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</div>
</article>
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="http://LuuMing.github.io/2019/01/29/read-build-to-win/">
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="LuMing">
<meta itemprop="description" content="">
<meta itemprop="image" content="/images/avatar.gif">
</span>
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="LuMing's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2019/01/29/read-build-to-win/" itemprop="url">
读《构建之法》
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2019-01-29 16:00:06" itemprop="dateCreated datePublished" datetime="2019-01-29T16:00:06+08:00">2019-01-29</time>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">Edited on</span>
<time title="Modified: 2019-04-18 20:54:48" itemprop="dateModified" datetime="2019-04-18T20:54:48+08:00">2019-04-18</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<pre><code>1.知识体系是构建出来的,而不是接受到的。与其灌输知识,不如让学生自己构建。
2.人的认知模型改变的非常缓慢,搞那些速成的,疯狂的,喊口号的培训未必改变了人的认知模型。
3.提问能帮助构建知识体系。所以我们要鼓励学生思考,辩论。
4.身心投入是学习的关键。没有一定的工作量,怎么能达到“身心投入”呢。
</code></pre><pre><code>NCL环境:N natural C critical L learning
</code></pre><pre><code>软件=程序+软件工程
软件企业=软件+商业模式
</code></pre><pre><code>软件工程是:“把系统的,有序的,可量化的方法应用到软件的开发,运营和维护上的过程”
</code></pre><pre><code>技能的反面是解决问题
</code></pre><pre><code>p136
君子和而不同,小人同而不和
</code></pre><pre><code>p156
NABCB模型:need ,approach,benefit,competitors,delivery
</code></pre><pre><code>p167
Y=X±X÷N
实际时间花费=估计时间±估计时间÷开发过类似工作次数
</code></pre><pre><code>P289
重构-尽量保持原有界面的基础上优化部分代码
重写-重新实现原有功能
</code></pre><pre><code>p302
Those entrepreneurs who start out with the idea that they'll make it big- and in a hurry-can be guaranteed failure
</code></pre>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</div>
</article>
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="http://LuuMing.github.io/2019/01/25/dsp/">
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="LuMing">
<meta itemprop="description" content="">
<meta itemprop="image" content="/images/avatar.gif">
</span>
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="LuMing's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2019/01/25/dsp/" itemprop="url">
印象——DSP
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2019-01-25 12:44:30" itemprop="dateCreated datePublished" datetime="2019-01-25T12:44:30+08:00">2019-01-25</time>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">Edited on</span>
<time title="Modified: 2019-04-18 20:54:48" itemprop="dateModified" datetime="2019-04-18T20:54:48+08:00">2019-04-18</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h3 id="从一个现象入手"><a href="#从一个现象入手" class="headerlink" title="从一个现象入手"></a>从一个现象入手</h3><p>都知道模拟信号经过要想通过计算机处理需要对其进行采样,采样的过程可以看作一个连续函数的离散化,也可以看作信号经过一个电子开关。当然,这样就会引入一个新的参数——采样频率。</p>
<p>假设有一信号,<code>y = cos(0.5x)</code>。我们使用 matlab 对其进行分析:</p>
<pre><code>n = 0:1:300;
x = cos(0.5*pi*n);
w = (0:1:1000)*pi/1000;
X= x* exp(-j).^(n'*w);
magX = abs(X);
plot(w/pi,magX);grid
</code></pre><p><img src="/2019/01/25/dsp/1.jpg" alt=""></p>
<p>使用 300 点的离散信号,可以看作对模拟信号的采样,自然而然地产生了采样频率 = 300 / 300 = 1 HZ。<br>从结果上看,响应大部分集中在 0.5pi 的区域,与原函数特性相符。<br>横轴用 1000 点的离散值逼近连续值,这样的分析方法称为 DTFT——<a href="https://wenku.baidu.com/view/7abd90dbb8f67c1cfad6b88f.html" target="_blank" rel="noopener">离散时间傅里叶变换</a>。变换特点为<strong>时域离散信号变为频域连续信号</strong>。</p>
<p>为了简便起见,频率(横轴)的范围是0~pi,会不会有什么东西漏掉了呢?<br>修改第三行将范围扩大:</p>
<pre><code>w = (0:1:1000)*5*pi/1000;
</code></pre><p><img src="/2019/01/25/dsp/2.jpg" alt=""></p>
<p>在 1.5pi、2.5pi、3.5pi…地方均出现了响应。为什么呢?</p>
<p>记得之前分析过,采样频率为 1HZ,使用公式 <code>Ω = 2pi * f</code> 可将其转换为角频率 = 1pi。<br>实际上在频域中,通过采样后的图像为<strong>原图像以采样频率进行的周期性延拓</strong>。因此会在 <code>0.5 ± N*采样频率(N=0,1,2,..)</code>的地方出现响应。可这是为什么呢?</p>
<p>还是回到时域中来,我们的信号就像一颗颗珠子:</p>
<pre><code>n = 0:1:300;
x = cos(0.5*pi*n);
plot(n,x,'*');
axis([0 50 -2 2]);
</code></pre><p><img src="/2019/01/25/dsp/3.jpg" alt=""></p>
<p>傅里叶分析的目的是观察信号的频率,而我们事先已经知道了这些点是频率为 0.5 pi 的信号,只不过离散处理了。那么我们是否能够用频率为 0.5 pi 的连续信号将其<strong>串起来</strong>呢?换句话说:<strong>想要知道信号的频率,就用此频率的信号去拟合,拟合上了就说明信号符合这一频率。</strong></p>
<p>使用 y = cos(0.5πx) 拟合:</p>
<pre><code>n = 0:1:300;
x = cos(0.5*pi*n);
plot(n,x,'*');
axis([0 50 -2 2]);
hold on;
t = 0:0.01:300;
plot(t,cos(0.5*pi*t),'r');
</code></pre><p><img src="/2019/01/25/dsp/4.jpg" alt=""></p>
<p>果不其然,信号完美的落在了红线上。就像串项链一般。<br>但<strong>串法唯一吗?</strong></p>
<p>既然傅里叶分析出了 1.5pi、2.5pi、3.5pi… 的频率,不妨试一试用 cos(1.5πx)、cos(2.5πx)、cos(3.5πx) 串一下:</p>
<pre><code>n = 0:1:300;
x = cos(0.5*pi*n);
t = 0:0.01:300;
subplot(3,1,1)
plot(t,cos(1.5*pi*t),'r');
hold on
plot(n,x,'*');
axis([0 50 -2 2]);
subplot(3,1,2)
plot(t,cos(2.5*pi*t),'r');
hold on
plot(n,x,'*');
axis([0 50 -2 2]);
subplot(3,1,3);
plot(t,cos(3.5*pi*t),'r');
hold on
plot(n,x,'*');
axis([0 50 -2 2]);
</code></pre><p><img src="/2019/01/25/dsp/5.jpg" alt=""></p>
<p>也都很好的被串在了一起。这也就解释了频域分析中出现延拓的现象。通俗来讲:<strong>信号离散后使得串法不唯一</strong>。</p>
<h3 id="频域采样"><a href="#频域采样" class="headerlink" title="频域采样"></a>频域采样</h3><p>连续的东西毕竟不方便使用计算机处理,时域通过采样即可解决。对于频域当然也可如法炮制,这样的变换就是 DFT。其特点为<strong>时域离散信号变为频域离散信号</strong>。<br>但这样又引来了新的参数:频域采样点数。幸好频率采样定理说只要频域采样点数大于信号长度即可。</p>
<p>可以用一张图来概括几种分析方法:<br><img src="/2019/01/25/dsp/DSP.jpg" alt=""></p>
<p>参考资料:<a href="https://zhuanlan.zhihu.com/p/45114376" target="_blank" rel="noopener">如何理解离散傅里叶变换及Z变换</a></p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</div>
</article>
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="http://LuuMing.github.io/2018/12/24/softWareEngineering/">
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="LuMing">
<meta itemprop="description" content="">
<meta itemprop="image" content="/images/avatar.gif">
</span>
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="LuMing's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2018/12/24/softWareEngineering/" itemprop="url">
软件工程
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2018-12-24 20:07:56" itemprop="dateCreated datePublished" datetime="2018-12-24T20:07:56+08:00">2018-12-24</time>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">Edited on</span>
<time title="Modified: 2019-04-18 20:54:49" itemprop="dateModified" datetime="2019-04-18T20:54:49+08:00">2019-04-18</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>学完了软件工程,不苟妄得多少分,但至少让我发表一下见解吧。</p>
<h3 id="“高内聚,低耦合?”-有点小陷阱"><a href="#“高内聚,低耦合?”-有点小陷阱" class="headerlink" title="“高内聚,低耦合?” 有点小陷阱"></a>“高内聚,低耦合?” 有点小陷阱</h3><p>结构化程序设计核心思想之一叫做“高内聚,低耦合”。很直观,模块与模块独立,模块之间保持简单的调用/依赖关系,模块之内完成单一的任务。<br>不错,你已经明白了其含义。让我画一张图,请问下图模块的内聚与耦合度呢?<br><img src="/2018/12/24/softWareEngineering/" alt=""><br>你一定会回答,“很明显,耦合度很高,是一个糟糕的设计”。<br>OK,A 调用 B、C。B 调用 C,C 调用 D。乱七八糟的的确让人感到不愉快。但是,如果让我换个角度看看呢?</p>
<p>请再次回答它的内聚与耦合程度。怎么,耦合度很低?<br>你有没有觉得,<strong>内聚和耦合其实是一回事</strong>。那么当我们谈论到“高内聚,低耦合”时,我们在谈论什么呢?<br>让我再给图上画一个圈,现在我问你,<strong>圈内</strong>的耦合度与内聚度?<br>一目了然吧。</p>
<p>好吧,我的观点其实是<strong>在讨论内聚与耦合程度时,应以某个界限作为划分</strong>,实际上在谈论“模块”这个概念时,就已经有了一条边界了,只不过很容易会忽视掉我们所讨论的对象的性质(之前虽然没有提到但阅读起来毫无违和感对吧?)所以还应该明确,<strong>内聚是边界之内,耦合是边界之间</strong>。</p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</div>
</article>
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="http://LuuMing.github.io/2018/12/09/My2018/">
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="LuMing">
<meta itemprop="description" content="">
<meta itemprop="image" content="/images/avatar.gif">
</span>
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="LuMing's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2018/12/09/My2018/" itemprop="url">
我的 2018