Skip to content

Commit 8324389

Browse files
committed
Moved note about DI frameworks and small typo [ci skip]
1 parent df5f7b7 commit 8324389

File tree

6 files changed

+77
-73
lines changed

6 files changed

+77
-73
lines changed

src/site/es/xdoc/getting-started.xml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,25 @@ public interface BlogMapper {
316316
<p>Es muy importante entender los distintos ámbitos y ciclos de vida
317317
de las clases de las que hemos hablado hasta ahora. Usarlas de
318318
forma incorrecta puede traer serias complicaciones.</p>
319+
<hr />
320+
<p>
321+
<span class="label important">NOTA</span>
322+
<strong>Ciclo de vida de los objetos y frameworks de inyección de
323+
dependencias</strong>
324+
</p>
325+
<p>
326+
Los frameworks de inyección de dependencias pueden crear
327+
SqlSessions y mappers
328+
<i>thread safe</i>
329+
(reeentrante) y
330+
transaccionales, e inyectarlos directmaente en tus beans de forma que puedes
331+
olvidarte de su ciclo de vida.
332+
Echa un vistazo a los sub-projectos MyBatis-Spring o MyBatis-Guice para
333+
conocer más detalles sobre cómo usar
334+
MyBatis con estos frameworks.
335+
</p>
336+
<hr />
337+
319338
<h4>SqlSessionFactoryBuilder</h4>
320339
<p>Esta clase puede instanciarse, usarse y desecharse. No es
321340
necesario mantenerla una vez que ya has creado la
@@ -382,24 +401,6 @@ try {
382401
}
383402
]]></source>
384403

385-
<hr />
386-
<p>
387-
<span class="label important">NOTA</span>
388-
<strong>Ciclo de vida de los objetos y frameworks de inyección de
389-
dependencias</strong>
390-
</p>
391-
<p>
392-
Los frameworks de inyección de dependencias pueden crear
393-
SqlSessions y mappers
394-
<i>thread safe</i>
395-
(reeentrante) y
396-
transaccionales, e inyectarlos directmaente en tus beans de forma que puedes
397-
olvidarte de su ciclo de vida.
398-
Echa un vistazo a los sub-projectos MyBatis-Spring o MyBatis-Guice para
399-
conocer más detalles sobre cómo usar
400-
MyBatis con estos frameworks.
401-
</p>
402-
<hr />
403404
</subsection>
404405
</section>
405406
</body>

src/site/fr/xdoc/getting-started.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,21 @@ public interface BlogMapper {
274274
qui ont été abordées jusqu'ici. Utilisées incorrectement, elles peuvent
275275
poser de sévères problèmes de concurrence.
276276
</p>
277+
<hr/>
278+
<p><span class="label important">NOTE</span>
279+
<strong>Cycle de vie au sein d'un framework d'injection de dépendance</strong>
280+
</p>
281+
<p>
282+
Les frameworks d'injection de dépendance (ou IoC, inversion de contrôle)
283+
peuvent créer des SqlSession et des mappers transactionnels, thread
284+
safe, et les injecter directement dans vos beans si bien que vous n'avez
285+
plus à vous soucier de leur cycle de vie.
286+
Vous serez probablement intéressé par les sous-projets MyBatis-Spring et
287+
MyBatis-Guice pour apprendre plus sur l'injection de dépendances avec
288+
MyBatis.
289+
</p>
290+
<hr/>
291+
277292
<h4>SqlSessionFactoryBuilder</h4>
278293
<p>
279294
Cette classe peut être instanciée, utilisée puis jetée aux oubliettes.
@@ -348,20 +363,6 @@ try {
348363
}
349364
]]></source>
350365

351-
<hr/>
352-
<p><span class="label important">NOTE</span>
353-
<strong>Cycle de vie au sein d'un framework d'injection de dépendance</strong>
354-
</p>
355-
<p>
356-
Les frameworks d'injection de dépendance (ou IoC, inversion de contrôle)
357-
peuvent créer des SqlSession et des mappers transactionnels, thread
358-
safe, et les injecter directement dans vos beans si bien que vous n'avez
359-
plus à vous soucier de leur cycle de vie.
360-
Vous serez probablement intéressé par les sous-projets MyBatis-Spring et
361-
MyBatis-Guice pour apprendre plus sur l'injection de dépendances avec
362-
MyBatis.
363-
</p>
364-
<hr/>
365366
</subsection>
366367
</section>
367368
</body>

src/site/ja/xdoc/getting-started.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ public interface BlogMapper {
235235
これまでに説明した様々なクラスに適したスコープや、そのライフサイクルについて理解しておくことは大変重要です。
236236
誤って使用すると、深刻な整合性の問題の原因となります。
237237
</p>
238+
<hr/>
239+
<p><span class="label important">NOTE</span>
240+
<strong>オブジェクトのライフサイクルと依存性注入(Dependency Injection)フレームワーク</strong>
241+
</p>
242+
<p>
243+
Dependency Injection フレームワークを使うと、スレッドセーフでトランザクション管理された SqlSession や Mapper のインスタンスを作成し、あなたの Bean にインジェクトすることもできます。
244+
こうすることで、SqlSession や Mapper のライフサイクルについてアプリケーションロジックと分離することができます。
245+
MyBatis と DI フレームワークの組み合わせについては、サブプロジェクトである MyBatis-Spring または MyBatis-Guice を参照してください。
246+
</p>
247+
<hr/>
238248
<h4>SqlSessionFactoryBuilder</h4>
239249
<p>
240250
このクラスは、インスタンス化し、使用し、破棄することができます。
@@ -293,16 +303,6 @@ try {
293303
session.close();
294304
}
295305
]]></source>
296-
<hr/>
297-
<p><span class="label important">NOTE</span>
298-
<strong>オブジェクトのライフサイクルと依存性注入(Dependency Injection)フレームワーク</strong>
299-
</p>
300-
<p>
301-
Dependency Injection フレームワークを使うと、スレッドセーフでトランザクション管理された SqlSession や Mapper のインスタンスを作成し、あなたの Bean にインジェクトすることもできます。
302-
こうすることで、SqlSession や Mapper のライフサイクルについてアプリケーションロジックと分離することができます。
303-
MyBatis と DI フレームワークの組み合わせについては、サブプロジェクトである MyBatis-Spring または MyBatis-Guice を参照してください。
304-
</p>
305-
<hr/>
306306
</subsection>
307307
</section>
308308
</body>

src/site/ko/xdoc/getting-started.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ public interface BlogMapper {
191191
<subsection name="스코프(Scope) 와 생명주기(Lifecycle)">
192192
<p>이제부터 다룰 스코프와 생명주기에 대해서 이해하는 것은 매우 중요하다. 스코프와 생명주기를 잘못 사용하는 것은 다양한
193193
동시성 문제를 야기할 수 있다..</p>
194+
<hr/>
195+
<p><span class="label important">참고</span>
196+
<strong>객체 생명주기와 의존성 삽입 프레임워크</strong>
197+
</p>
198+
<p>의존성 삽입 프레임워크는 쓰레드에 안전하도록 해준다. 트랜잭션 성질을 가지는 SqlSessions과 매퍼들 그리고 그것들을 직접 빈에 삽입하면 생명주기에 대해 기억하지 않아도 되게 해준다.
199+
DI프레임워크와 MyBatis를 사용하기 위해 좀더 많은 정보를 보기 위해서는 MyBatis-Spring이나 MyBatis-Guice 하위 프로젝트를 찾아보면 된다.
200+
</p>
201+
<hr/>
194202
<h4>SqlSessionFactoryBuilder</h4>
195203
<p>이 클래스는 인스턴스회되어 사용되고 던져질 수 있다. SqlSessionFactory 를 생성한 후 유지할 필요는 없다. 그러므로
196204
SqlSessionFactoryBuilder 인스턴스의 가장 좋은 스코프는 메서드 스코프(예를 들면, 메서드 지역변수)이다. 여러 개의
@@ -232,14 +240,6 @@ try {
232240
}
233241
]]></source>
234242

235-
<hr/>
236-
<p><span class="label important">참고</span>
237-
<strong>객체 생명주기와 의존성 삽입 프레임워크</strong>
238-
</p>
239-
<p>의존성 삽입 프레임워크는 쓰레드에 안전하도록 해준다. 트랜잭션 성질을 가지는 SqlSessions과 매퍼들 그리고 그것들을 직접 빈에 삽입하면 생명주기에 대해 기억하지 않아도 되게 해준다.
240-
DI프레임워크와 MyBatis를 사용하기 위해 좀더 많은 정보를 보기 위해서는 MyBatis-Spring이나 MyBatis-Guice 하위 프로젝트를 찾아보면 된다.
241-
</p>
242-
<hr/>
243243
</subsection>
244244
</section>
245245
</body>

src/site/xdoc/getting-started.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<subsection name="Installation">
3232
<p>
33-
To use the MyBatis you just need to include the
33+
To use MyBatis you just need to include the
3434
<code>
3535
mybatis-x.x.x.jar
3636
</code>
@@ -316,6 +316,19 @@ public interface BlogMapper {
316316
classes we've discussed so far. Using them incorrectly can cause
317317
severe concurrency problems.
318318
</p>
319+
320+
<hr/>
321+
<p><span class="label important">NOTE</span>
322+
<strong>Object lifecycle and Dependency Injection Frameworks</strong>
323+
</p>
324+
<p>
325+
Dependency Injection frameworks can create thread safe, transactional SqlSessions and mappers
326+
and inject them directly into your beans so you can just forget about their lifecycle.
327+
You may want to have a look at MyBatis-Spring or
328+
MyBatis-Guice sub-projects to know more about using MyBatis with DI frameworks.
329+
</p>
330+
<hr/>
331+
319332
<h4>SqlSessionFactoryBuilder</h4>
320333
<p>
321334
This class can be instantiated, used and thrown away. There is no need
@@ -388,17 +401,6 @@ try {
388401
}
389402
]]></source>
390403

391-
<hr/>
392-
<p><span class="label important">NOTE</span>
393-
<strong>Object lifecycle and Dependency Injection Frameworks</strong>
394-
</p>
395-
<p>
396-
Dependency Injection frameworks can create thread safe, transactional SqlSessions and mappers
397-
and inject them directly into your beans so you can just forget about their lifecycle.
398-
You may want to have a look at MyBatis-Spring or
399-
MyBatis-Guice sub-projects to know more about using MyBatis with DI frameworks.
400-
</p>
401-
<hr/>
402404
</subsection>
403405
</section>
404406
</body>

src/site/zh/xdoc/getting-started.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,17 @@ public interface BlogMapper {
276276
不正确的使用它们会导
277277
致严重的并发问题。
278278
</p>
279+
<hr/>
280+
<p><span class="label important">重要</span>
281+
<strong>Object lifecycle and Dependency Injection Frameworks</strong>
282+
</p>
283+
<p>
284+
Dependency Injection frameworks can create thread safe, transactional SqlSessions and mappers
285+
and inject them directly into your beans so you can just forget about their lifecycle.
286+
You may want to have a look at MyBatis-Spring or
287+
MyBatis-Guice sub-projects to know more about using MyBatis with DI frameworks.
288+
</p>
289+
<hr/>
279290
<h4>SqlSessionFactoryBuilder</h4>
280291
<p>
281292
这个类可以被实例化,使用和丢弃。一旦你创建了 SqlSessionFactory 后,这个类就不需
@@ -342,17 +353,6 @@ try {
342353
}
343354
]]></source>
344355

345-
<hr/>
346-
<p><span class="label important">重要</span>
347-
<strong>Object lifecycle and Dependency Injection Frameworks</strong>
348-
</p>
349-
<p>
350-
Dependency Injection frameworks can create thread safe, transactional SqlSessions and mappers
351-
and inject them directly into your beans so you can just forget about their lifecycle.
352-
You may want to have a look at MyBatis-Spring or
353-
MyBatis-Guice sub-projects to know more about using MyBatis with DI frameworks.
354-
</p>
355-
<hr/>
356356
</subsection>
357357
</section>
358358
</body>

0 commit comments

Comments
 (0)