the design principles and code analysis of hibernate lazy loading

as we all know,Hibernate is already one of the most popular ORM frameworks. and its performance is key highlight .when we use ORM framework,there will be a lot of convertions between  objects and database tables.if it can be handled well,it will make this framework extremely cumbersome. hibernate provides  many fabulous functionalities .or example  lazy loading. an domain object associates collections or another domain object, when initialition ,domain object will default not load collections and object entity. only when on demands.so it can impove performance.

what are the design principles of lazy loading?

well,proxy pattern is the core principle. for colletion mapping,like set,map ,list etc ,in hibernate codes,there are PersistentSet,PersistentMap,PersistentList classes to implement these interfaces.for associated collection,Hiberate will using CLGIB,JAVAASSIST create an proxy  object to represent collection,it actually not load during the creation of the object,only needs it load them.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
领域驱动设计(Domain-Driven Design,DDD)是一种软件开发方法论,旨在帮助开发团队更好地理解业务需求,并将其映射到软件设计中。"Patterns, Principles, and Practices of Domain-Driven Design" 是一本介绍DDD的书籍。 该书包含了许多相关的模式(patterns),原则(principles)和实践(practices)。模式指的是可重复应用的最佳实践,通过使用这些模式可以更好地解决一些常见的设计问题。原则则是指导设计决策的基本原则,这些原则有助于开发团队构建可维护、灵活和可扩展的软件。实践则是指在DDD中应用这些模式和原则的具体方法和技巧。 在"Patterns, Principles, and Practices of Domain-Driven Design" 中,作者将介绍如何使用DDD来进行软件开发,并详细解释了DDD的核心概念和重要组成部分。这包括战略设计(Strategic Design)和战术设计(Tactical Design)。战略设计关注领域的整体架构和组织,它定义了领域的边界、聚合根(Aggregate Roots)以及他们之间的关系。而战术设计则关注如何实现具体的业务逻辑,使用领域模型(Domain Model)来表达领域的核心概念。 该书强调了领域专家和开发团队之间的合作,推崇的是通过持续对话和深入理解业务,来捕捉业务需求和规则。它提倡使用通用语言(Ubiquitous Language)来统一业务和开发团队的沟通,避免因为术语不清晰而导致的误解和问题。 总之,"Patterns, Principles, and Practices of Domain-Driven Design" 提供了一个全面的指南,帮助开发团队理解和应用DDD的模式、原则和实践,以构建高质量、符合业务需求的软件系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值