官术网_书友最值得收藏!

Summary

As you may have noticed, getting started with JPA and CDI isn't that complex. With an understanding of both, it's possible to build large applications which utilize these technologies for various business cases. We looked at how dependency injection promotes writing loosely coupled and testable code and how CDI, a ubiquitous API for dependency injection and context management in Java EE, helps us do that.

CDI 2 brings ordered and asynchronous events to further enrich this programming model. As of the 2.0 release, CDI is available for Java SE as well. JPA has been updated for utilizing Java 8 Streams, repeatable annotations, and date/time APIs along with better CDI integration support. The JPA entities are defined as classes using @Entity, @MappedSuperclass, and @Embeddable annotations. To track state changes, we get to use entity listeners that can be used with CDI as well. Bean Validation 2.0 can be leveraged when defining constraints on JPA entities; this declarative method makes adding validations a fairly easy task to do.

Having learnt about CDI and JPA, which are two fundamental APIs that are used for building Java EE solutions; we can now switch our focus to microservices as we explore API-driven architecture.

主站蜘蛛池模板: 遂溪县| 沙河市| 泽库县| 永嘉县| 察雅县| 北票市| 天柱县| 句容市| 华阴市| 洪雅县| 辉县市| 如东县| 隆昌县| 达拉特旗| 汶川县| 绥化市| 晋宁县| 玉屏| 常州市| 寻乌县| 襄城县| 普格县| 定西市| 多伦县| 明水县| 东乌珠穆沁旗| 五寨县| 师宗县| 青川县| 衡南县| 长治县| 高尔夫| 云安县| 灵宝市| 双城市| 巴中市| 宜丰县| 沁源县| 泸定县| 姜堰市| 阿克陶县|