-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpring_1_introduction.html
605 lines (446 loc) · 26.9 KB
/
Spring_1_introduction.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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.0.0">
<meta name="baidu-site-verification" content="codeva-PBoQMHcqc8" />
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"lfeng.tech","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"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"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
</script>
<meta name="description" content="1. Spring概述本章主要介绍Spring中的体系结构和常见概念,比如bean、控制反转(Inverse of Control,IoC)等。 1.1 体系结构Spring 框架提供约 20 个模块,可以根据应用程序的要求来使用。">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring MVC系列-(1) Spring概述">
<meta property="og:url" content="https://lfeng.tech/Spring_1_introduction.html">
<meta property="og:site_name" content="Vincent's Notes">
<meta property="og:description" content="1. Spring概述本章主要介绍Spring中的体系结构和常见概念,比如bean、控制反转(Inverse of Control,IoC)等。 1.1 体系结构Spring 框架提供约 20 个模块,可以根据应用程序的要求来使用。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223354_d8299.jpg">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223354_d7fce.jpg">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223354_a1c1f.jpg">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223355_95fdf.jpg">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223355_8a5fd.jpg">
<meta property="og:image" content="https://imgs.lfeng.tech/images/blog/20221211223355_580fc.jpg">
<meta property="article:published_time" content="2020-03-09T23:43:49.000Z">
<meta property="article:modified_time" content="2022-12-11T14:33:55.538Z">
<meta property="article:author" content="Vincent">
<meta property="article:tag" content="Spring">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://imgs.lfeng.tech/images/blog/20221211223354_d8299.jpg">
<link rel="canonical" href="https://lfeng.tech/Spring_1_introduction.html">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : false,
isPost : true,
lang : 'zh-CN'
};
</script>
<title>Spring MVC系列-(1) Spring概述 | Vincent's Notes</title>
<noscript>
<style>
.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-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<h1 class="site-title">Vincent's Notes</h1>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>
</li>
</ul>
</nav>
</div>
</header>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content post posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://lfeng.tech/Spring_1_introduction.html">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.jpg">
<meta itemprop="name" content="Vincent">
<meta itemprop="description" content="Vincent's tech blog">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Vincent's Notes">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
Spring MVC系列-(1) Spring概述
</h1>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-03-09 23:43:49" itemprop="dateCreated datePublished" datetime="2020-03-09T23:43:49Z">2020-03-09</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2022-12-11 14:33:55" itemprop="dateModified" datetime="2022-12-11T14:33:55Z">2022-12-11</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/Spring/" itemprop="url" rel="index"><span itemprop="name">Spring</span></a>
</span>
</span>
<span id="/Spring_1_introduction.html" class="post-meta-item leancloud_visitors" data-flag-title="Spring MVC系列-(1) Spring概述" title="阅读次数">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读次数:</span>
<span class="leancloud-visitors-count"></span>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-comment"></i>
</span>
<span class="post-meta-item-text">Valine:</span>
<a title="valine" href="/Spring_1_introduction.html#valine-comments" itemprop="discussionUrl">
<span class="post-comments-count valine-comment-count" data-xid="/Spring_1_introduction.html" itemprop="commentCount"></span>
</a>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223354_d8299.jpg" alt="Spring.png"></p>
<h2 id="1-Spring概述"><a href="#1-Spring概述" class="headerlink" title="1. Spring概述"></a>1. Spring概述</h2><p>本章主要介绍Spring中的体系结构和常见概念,比如bean、控制反转(Inverse of Control,IoC)等。</p>
<h3 id="1-1-体系结构"><a href="#1-1-体系结构" class="headerlink" title="1.1 体系结构"></a>1.1 体系结构</h3><p>Spring 框架提供约 20 个模块,可以根据应用程序的要求来使用。</p>
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223354_d7fce.jpg" alt="Screen Shot 2020-01-11 at 7.54.32 PM.png"></p>
<span id="more"></span>
<h4 id="核心容器"><a href="#核心容器" class="headerlink" title="核心容器"></a>核心容器</h4><p>核心容器由核心,Bean,上下文和表达式语言模块组成,它们的细节如下:</p>
<ul>
<li><p><strong>核心模块</strong>提供了框架的基本组成部分,包括 IoC 和依赖注入功能。</p>
</li>
<li><p><strong>Bean模块</strong>提供 BeanFactory,它是一个工厂模式的复杂实现。</p>
</li>
<li><p><strong>上下文模块</strong>建立在由核心和 Bean 模块提供的坚实基础上,它是访问定义和配置的任何对象的媒介。ApplicationContext 接口是上下文模块的重点。</p>
</li>
<li><p><strong>表达式语言模块</strong>在运行时提供了查询和操作一个对象图的强大的表达式语言。</p>
</li>
</ul>
<h4 id="数据访问-集成"><a href="#数据访问-集成" class="headerlink" title="数据访问/集成"></a>数据访问/集成</h4><p>数据访问/集成层包括 JDBC,ORM,OXM,JMS 和事务处理模块,它们的细节如下:</p>
<p>JDBC 模块提供了删除冗余的 JDBC 相关编码的 JDBC 抽象层。</p>
<p>ORM 模块为流行的对象关系映射 API,包括 JPA,JDO,Hibernate 和 iBatis,提供了集成层。</p>
<p>OXM 模块提供了抽象层,它支持对 JAXB,Castor,XMLBeans,JiBX 和 XStream 的对象/XML 映射实现。</p>
<p>Java 消息服务 JMS 模块包含生产和消费的信息的功能。</p>
<p>事务模块为实现特殊接口的类及所有的 POJO 支持编程式和声明式事务管理。</p>
<h4 id="Web"><a href="#Web" class="headerlink" title="Web"></a>Web</h4><p>Web 层由 Web,Web-MVC,Web-Socket 和 Web-Portlet 组成,它们的细节如下:</p>
<ul>
<li>Web 模块提供了基本的面向 web 的集成功能,例如多个文件上传的功能和使用 servlet 监听器和面向 web 应用程序的上下文来初始化 IoC 容器。</li>
<li>Web-MVC 模块包含 Spring 的模型-视图-控制器(MVC),实现了 web 应用程序。</li>
<li>Web-Socket 模块为 WebSocket-based 提供了支持,而且在 web 应用程序中提供了客户端和服务器端之间通信的两种方式。</li>
<li>Web-Portlet 模块提供了在 portlet 环境中实现 MVC,并且反映了 Web-Servlet 模块的功能。</li>
</ul>
<h4 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h4><p>还有其他一些重要的模块,像 AOP,Aspects,Instrumentation,Web 和测试模块,它们的细节如下:</p>
<ul>
<li>AOP 模块提供了面向方面的编程实现,允许你定义方法拦截器和切入点对代码进行干净地解耦,它实现了应该分离的功能。</li>
<li>Aspects 模块提供了与 AspectJ 的集成,这是一个功能强大且成熟的面向切面编程(AOP)框架。</li>
<li>Instrumentation 模块在一定的应用服务器中提供了类 instrumentation 的支持和类加载器的实现。</li>
<li>Messaging 模块为 STOMP 提供了支持作为在应用程序中 WebSocket 子协议的使用。它也支持一个注解编程模型,它是为了选路和处理来自 WebSocket 客户端的 STOMP 信息。</li>
<li>测试模块支持对具有 JUnit 或 TestNG 框架的 Spring 组件的测试。</li>
</ul>
<h3 id="1-2-Bean"><a href="#1-2-Bean" class="headerlink" title="1.2 Bean"></a>1.2 Bean</h3><p>Spring对Bean的官方定义如下:</p>
<blockquote>
<p>在 Spring 中,<strong>构成应用程序主干</strong>并由<strong>Spring IoC容器</strong>管理的<strong>对象</strong>称为bean。<strong>bean是一个由Spring IoC容器实例化、组装和管理的对象。</strong></p>
</blockquote>
<p>由上面的定义可以得到如下3点信息:</p>
<ul>
<li>bean是对象,一个或者多个不限定。</li>
<li>bean由Spring IoC容器管理。</li>
<li>应用程序由一个个bean构成。</li>
</ul>
<h3 id="1-3-控制反转(IoC)与依赖注入(DI)"><a href="#1-3-控制反转(IoC)与依赖注入(DI)" class="headerlink" title="1.3 控制反转(IoC)与依赖注入(DI)"></a>1.3 控制反转(IoC)与依赖注入(DI)</h3><p><strong>控制反转</strong>英文全称:Inversion of Control,简称就是IoC,这是管理Java实例协作关系的一种方式。这种方式还有另一个名称,<strong>依赖注入(Dependency Injection)</strong>,两者的含义相同。</p>
<p>传统方式下,当某个Java对象(调用者)需要调用另一个Java对象(被依赖对象)的方法时,通常有如下两种做法:</p>
<ul>
<li>原始做法: 调用者主动创建被依赖对象,然后再调用被依赖对象的方法。</li>
<li>简单工厂模式: 调用者先找到被依赖对象的工厂,然后主动通过工厂去获取被依赖对象,最后再调用被依赖对象的方法。</li>
</ul>
<p>注意上面的<strong>主动</strong>二字,这必然会导致调用者与被依赖对象实现类的硬编码耦合,非常不利于项目升级的维护。</p>
<p>使用Spring框架之后,调用者无需主动获取被依赖对象,调用者只要被动接受Spring容器为调用者的成员变量赋值即可,由此可见,使用Spring后,<strong>调用者获取被依赖对象的方式由原来的主动获取,变成了被动接受</strong>——所以Rod Johnson(Spring框架创始人)称之为<strong>控制反转</strong>。</p>
<p>另外从Spring容器的角度来看,<strong>Spring容器负责将被依赖对象赋值给调用者的成员变量——相当于为调用者注入它依赖的实例</strong>,因此Martine Fowler称之为<strong>依赖注入</strong>。</p>
<blockquote>
<p>Spring IoC容器就是这样的辅助程序,它负责对象的生成和依赖的注入。类的实例化、依赖的实例化、依赖的传入都交由Spring IoC容器控制,而不是用new方式实例化对象、通过非构造函数方法传入依赖等常规方式。</p>
</blockquote>
<h3 id="1-4-Bean的管理"><a href="#1-4-Bean的管理" class="headerlink" title="1.4 Bean的管理"></a>1.4 Bean的管理</h3><p>在Spring的应用中,Spring容器负责创建对象,装配对象,配置它们以及管理它们的整个生命周期,从生存到死亡。</p>
<p>容器是Spring框架的核心,Spring自带了多个容器的实现。可以归纳为两种不同的类型:</p>
<ul>
<li><strong>BeanFactory</strong>(由org.springframework.beans.factory.BeanFactory接口定义)是最简单的容器,提供基本的DI支持。</li>
<li><strong>应用上下文</strong>(由org.springframework.context.ApplicationContext接口定义)基于BeanFactory构建,并提供应用框架级别的服务,例如从属性文件解析文本信息,以及发布应用事件给感兴趣的事件监听者。</li>
</ul>
<p>通常情况下,会使用应用上下文来进行Bean的管理。Spring自带了多种类型的应用上下文,下面列举了几种常见的:</p>
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223354_a1c1f.jpg" alt="Screen Shot 2020-01-11 at 10.23.44 PM.png"></p>
<p>上面的上下文可以分为两类,加载配置文件和配置类。</p>
<ul>
<li>加载文件</li>
</ul>
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223355_95fdf.jpg" alt="Screen Shot 2020-01-12 at 2.51.51 PM.png"></p>
<ul>
<li>加载配置类</li>
</ul>
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223355_8a5fd.jpg" alt="Screen Shot 2020-01-12 at 2.52.04 PM.png"></p>
<hr>
<p>本文由『后端精进之路』原创,首发于博客 <a target="_blank" rel="noopener" href="http://teckee.github.io/">http://teckee.github.io/</a> , 转载请注明出处</p>
<p>搜索『后端精进之路』关注公众号,立刻获取最新文章和<strong>价值2000元的BATJ精品面试课程</strong>。</p>
<p><img src="https://imgs.lfeng.tech/images/blog/20221211223355_580fc.jpg" alt="后端精进之路.png"></p>
</div>
<div>
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>本文作者: </strong>Vincent
</li>
<li class="post-copyright-link">
<strong>本文链接:</strong>
<a href="https://lfeng.tech/Spring_1_introduction.html" title="Spring MVC系列-(1) Spring概述">https://lfeng.tech/Spring_1_introduction.html</a>
</li>
<li class="post-copyright-license">
<strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处!
</li>
</ul>
</div>
<footer class="post-footer">
<div class="post-tags">
<a href="/tags/Spring/" rel="tag"># Spring</a>
</div>
<div class="post-nav">
<div class="post-nav-item">
<a href="/JVM_7_deep_into_performance_optimization.html" rel="prev" title="JVM性能优化系列-(7) 深入了解性能优化">
<i class="fa fa-chevron-left"></i> JVM性能优化系列-(7) 深入了解性能优化
</a></div>
<div class="post-nav-item">
<a href="/Spring_2_Bean_Configuration.html" rel="next" title="Spring MVC系列-(2) Bean的装配">
Spring MVC系列-(2) Bean的装配 <i class="fa fa-chevron-right"></i>
</a></div>
</div>
</footer>
</article>
</div>
<div class="comments" id="valine-comments"></div>
<script>
window.addEventListener('tabs:register', () => {
let { activeClass } = CONFIG.comments;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}
</script>
</div>
<div class="toggle sidebar-toggle">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
<div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-Spring%E6%A6%82%E8%BF%B0"><span class="nav-number">1.</span> <span class="nav-text">1. Spring概述</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E4%BD%93%E7%B3%BB%E7%BB%93%E6%9E%84"><span class="nav-number">1.1.</span> <span class="nav-text">1.1 体系结构</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A0%B8%E5%BF%83%E5%AE%B9%E5%99%A8"><span class="nav-number">1.1.1.</span> <span class="nav-text">核心容器</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%95%B0%E6%8D%AE%E8%AE%BF%E9%97%AE-%E9%9B%86%E6%88%90"><span class="nav-number">1.1.2.</span> <span class="nav-text">数据访问/集成</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Web"><span class="nav-number">1.1.3.</span> <span class="nav-text">Web</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%85%B6%E4%BB%96"><span class="nav-number">1.1.4.</span> <span class="nav-text">其他</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-Bean"><span class="nav-number">1.2.</span> <span class="nav-text">1.2 Bean</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-%E6%8E%A7%E5%88%B6%E5%8F%8D%E8%BD%AC%EF%BC%88IoC%EF%BC%89%E4%B8%8E%E4%BE%9D%E8%B5%96%E6%B3%A8%E5%85%A5%EF%BC%88DI%EF%BC%89"><span class="nav-number">1.3.</span> <span class="nav-text">1.3 控制反转(IoC)与依赖注入(DI)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-4-Bean%E7%9A%84%E7%AE%A1%E7%90%86"><span class="nav-number">1.4.</span> <span class="nav-text">1.4 Bean的管理</span></a></li></ol></li></ol></div>
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="Vincent"
src="/images/avatar.jpg">
<p class="site-author-name" itemprop="name">Vincent</p>
<div class="site-description" itemprop="description">Vincent's tech blog</div>
</div>
<div class="site-state-wrap motion-element">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">65</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">15</span>
<span class="site-state-item-name">分类</span></a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/">
<span class="site-state-item-count">23</span>
<span class="site-state-item-name">标签</span></a>
</div>
</nav>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/teckee" title="GitHub → https://github.com/teckee" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="mailto:h0ck@foxmail.com" title="E-Mail → mailto:h0ck@foxmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
</span>
</div>
</div>
</div>
</aside>
<div id="sidebar-dimmer"></div>
</div>
</main>
<footer class="footer">
<div class="footer-inner">
<div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">沪ICP备19042895号-2 </a>
</div>
<div class="copyright">
©
<span itemprop="copyrightYear">2023</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">Vincent</span>
</div>
<div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
</div>
<div class="busuanzi-count">
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-user"></i>
</span>
<span class="site-uv" title="总访客量">
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="site-pv" title="总访问量">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
</div>
</div>
</footer>
</div>
<script src="/lib/anime.min.js"></script>
<script src="/lib/velocity/velocity.min.js"></script>
<script src="/lib/velocity/velocity.ui.min.js"></script>
<script src="/js/utils.js"></script>
<script src="/js/motion.js"></script>
<script src="/js/schemes/pisces.js"></script>
<script src="/js/next-boot.js"></script>
<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
var GUEST = ['nick', 'mail', 'link'];
var guest = 'nick,mail,link';
guest = guest.split(',').filter(item => {
return GUEST.includes(item);
});
new Valine({
el : '#valine-comments',
verify : false,
notify : false,
appId : 'cgQ905Fj6xbazWtyi9b1hafr-gzGzoHsz',
appKey : '68EFTwnd9XYY352gRUJlJyMu',
placeholder: "Just go go",
avatar : 'mm',
meta : guest,
pageSize : '10' || 10,
visitor : true,
lang : '' || 'zh-cn',
path : location.pathname,
recordIP : false,
serverURLs : ''
});
}, window.Valine);
});
</script>
</body>
</html>