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

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.

主站蜘蛛池模板: 凤阳县| 高邑县| 德令哈市| 德保县| 平南县| 兴山县| 吴桥县| 墨竹工卡县| 康平县| 毕节市| 福清市| 望都县| 景洪市| 波密县| 大石桥市| 会泽县| 凌海市| 紫阳县| 江阴市| 潮州市| 崇文区| 永春县| 略阳县| 翁牛特旗| 通山县| 商丘市| 乐业县| 龙山县| 山东省| 清镇市| 禄丰县| 遂溪县| 乐山市| 万宁市| 榆林市| 大埔县| 蓬莱市| 神农架林区| 景德镇市| 大石桥市| 米林县|